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.
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.
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:
- Attachment position at parent part, 0-3
- Part type (full CamelCase string or character code)
- Unique identification string/ name of the part. This can be anything you choose, but all parts must be given unique ID string
- Orientation relative to parent, 0-3, representing increments of 90 degrees
- Parameters for parametrized parts (if applicable)
For the parametrized joint the parameters are, in correct order:
- Length: (in meters, between 0.02 and 0.1)
- Rotation-Angle: rotation angle in transverse/horizontal plane, relative to parent, in degrees between -90 and 90
- 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
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
0 or more params lines of the form:
<part id string> <part io id> <bias>
<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
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.