Reference files

See “simpleRobot.txt”  for a reference for writing robot text files.

The body part

The part of the file describing the body begins at the start of the robot text file and continues until the first empty line..

Tree representation of the body

Before looking at notation that is used to encode the robot body, let’s have a look at the tree representation of the robot body.

Robot body parts

RoboGen robots are composed of the following types of parts (compare to Robot body parts):
CamelCase part name shown in parentheses.

Image Part name Code Arity Motors Sensors Image Part name Code Arity Motors Sensors
Core Component
Core Component
(CoreComponent)
E 4 0 6
Fixed Brick
Fixed Brick
(FixedBrick)
F 3 0 0
Parametric Joint
Parametric Bar Joint
(ParametricJoint)
B 1 0 0
Passive Hinge
Passive Hinge Joint
(PassiveHinge)
H 1 0 0
ActiveHinge_ServoHolder_FrameWithoutHorn_Servo_20 deg
Active Hinge Joint
(ActiveHinge)
I 1 1 0 LightSensor External Light Sensor
(LightSensor)
L 0 0 1 (analog)
IRsensor Infrared Sensor
(IrSensor)
D 0 0 1

Where “arity” stands for the number of parts that can be attached to the given part if that part is already attached to another part. This concept is a direct consequence from the tree representation, where one part (the core component brick) is the root of the tree and all parts attached to it are its children, and so forth.

Tree structure

Consider this example of a robot and the tree representation of its body structure:

As mentioned above, the top of the tree is the root/core component brick, and for each node the adjacent parts are its children. For the core component the order of the children determines their position in the following way:
0 Front face
1 Back face
2 Right face
3 Left Face

This may sound confusing, but if you play with a robot.txt file and visualize the results you will quickly be able to see the results.

Text representation of the body

The robot text file contains one line per body part which specifies, in this order:

  1. Attachment position at parent part, 0-3
  2. Part type (full CamelCase string or character code)
  3. Unique identification string/ name of the part.  This can be anything you choose, but all parts must be given unique ID string
  4. Orientation relative to parent, 0-3, representing increments of 90 degrees
  5. Parameters for parametrized parts (if applicable)

For the parametrized joint the parameters are, in correct order:

  1. Length: (in meters, between 0.02 and 0.1)
  2. Rotation-Angle: rotation angle in transverse/horizontal plane, relative to parent, in degrees between -90 and 90
  3. Inclination-Angle: currently rotating out of the transverse plane is disallowed, so this value must be 0

 

The tree structure is represented by indentation: The children of a part must follow directly after it and have to be indented by exactly one more level than the parent. Use tab to indent. Consider the representation of the above robot:

The following is a typical line representing a parametric  joint:

1 ParametricJoint Neck 0 0.03 30 0

Looks at simpleRobot.txt for a complete example of the tree structure.

The brain part

Remember your robot file must always first contain the body description.  Then, you can optionally encode weights, biases, parameters, and structure of the neural network as follows.

Empty line after body description
0 or more add-hidden-neuron lines of the form:
<part id string> <type string>
these lines each add a hidden neuron of the given type to the given part
Empty line
0 or more weight lines of the form:
<source part id string> <source part io id> <destination part id string> <destination part io id> <weight>
these lines each specify a connection weight between 2 neurons
Empty line
0 or more params lines of the form:
<part id string> <part io id> <bias>
or
<part id string> <part io id> <neuron type> <param> [<param> …]
these lines allow you to optionally change the type of an existing neuron and specify it’s parameters, as in the example.
Note: oscillators take three parameters: period, phase-offset, amplitude. Sigmoid neurons just take one parameter: bias.

Refer to Robot body parts for the IO id specification. Note that a source can be a sensor neuron, motor neuron or hidden neuron, while a destination can only be a motor neuron or hidden neuron

Design constraints

The robot of your design should satisfy the following criteria:

  • There should be no intersecting body parts
  • There should be exactly one core component
  • There should be between 1 and 8 motors.
  • There may not be more sensors than there are pins on the Arduino.