Robot Simulation Markup Language (RoSiML) is the XSD grammar used by YARS.
YARS is fully configured by a RoSiML XML file, which contains all the information required to set-up a simulation (excluding the robot controller). This posts discusses the different sections of a RoSiML and how to read the documentation that can be generated from YARS yars --export=png/pdf
.
Contents
rosiml
1 2 3 4 5 6 7 8 9 |
<rosiml version="0.8.40"> <simulator> ... </simulator> <screens> ... </screens> <macros> ... </macros> <environment> ... </environment> <robots> ... </robots> <traces> ... </traces> <logging> ... </logging> </rosiml> |
simulator
The simulator section contains the parameters to control the physics and other simulator parameters. The parameters are explained in the following paragraphs. The following figure shows all parameters and their respective types. The frequency attribute controls the number of physics iterations that are visible. This needs some explanation. There are two different frequencies, that can be configured in YARS. The controller frequency (see below), which determines, how often the controller is executed, i.e., how often sensor values are provided to the controller and motor commands are handed from the controller to the physics engine. The second frequency (which is controlled here), determines how often the physics is iterated per simulated second. Naturally, the simulator frequency must be larger than the controller frequency and the controller frequency must be a integer divider of the simulator frequency. The simulator frequency also determines how often the logging (see below) takes place per simulated second. Each step of the physics engine leads to new states of the sensors, actuators, segments, etc. which can be logged.
1 2 3 4 |
<simulator frequency="100"> <solver iterations="10"/> <control iterations="10000" reset="1000"/> </simulator> |
solver
The solver subsection of the simulator configuration determines how many iterations are performed between two updates of the physics state. This must be clarified. The frequency attribute, described above, determines how many times the physics is updated per simulated second. All of these updates are visible, which means that they are visualised (see below) and can be logged. The solver iterations determine the precision between two physics updates. For more complex morphologies, more iterations are needed for the solver to converge to the correct distribution of forces. This is the number of iterations that is controlled by the solver iteration tag. Is is the number of calculations that bullet performs between to physics updates (see above).
control
The control subsection contains parameters which determine the number of simulator updates, the number of iterations until an automatic reset is performed, and finally, a seed for the random number generator.
screens
Previous versions of YARS supported several views on the same scene. Future versions of YARS will again support several cameras on the same scene, each with their own configuration and possibility of recording. This is the reason why the screens section of RoSiML still allows to configure multiple screens, although this is not supported in the current version of YARS (0.8.41).
Any number of screens may be configured. Any number of these screens may be opened at runtime (see show attribute) or on keyboard command. If more windows are opened than specified in the screens section, a default window will be opened. The default window can be configured by the default tag (see below).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
<screens> <screen name="Braiternberg" show="true" follow="false"> <size width="800" height="800"/> <camera> <position x="0.00" y="0.00" z="10"/> <lookAt x="0.0" y="0.01" z="0.0"/> </camera> <osd> <time font="Time" size="25" colour="FFFF00"/> <robot font="Robot" size="25" colour="FFFFFF"/> </osd> </screen> <screen name="Braiternberg 2" show="true" follow="true"> <resolution name="vga"/> <camera> <position x="3.0" y="3.0" z="3.0"/> <lookAt x="0.0" y="0.01" z="0.0"/> </camera> <osd> <time font="Time" size="25" colour="FFFF00"/> <robot font="Robot" size="25" colour="FFFFFF"/> </osd> </screen> <cameras> <orbit speed="0.5"> <lookAtX p="0.05" i="0.001" d="0.002"/> <lookAtY p="0.05" i="0.001" d="0.002"/> <lookAtZ p="1.0" i="0.0" d="0.0"/> <fromX p="0.01" i="0.0001" d="0.0002"/> <fromY p="0.01" i="0.0001" d="0.0002"/> <fromZ p="0.0" i="0.0" d="0.0"/> </orbit> <centre speed="1.5"/> </cameras> <followables> <followable name="main body"/> </followables> </screens> |
cameras
This tag defines the initial position of the camera in this window. It is defined by two 3D vectors, position and lookAt. The tag position defines the origin of the camera, whereas lookAt defines the position in YARS world coordinate system, towards which the camera is directed at.
orbit, centre
Both cameras have the same set of parameter, which is why they are discussed together in this paragraph. The lookAtX/Y/Z tags define the PID-controller parameters for the position of the followed object. The fromX/Y/Z tags define the PID-controller parameter for the position of the camera. Assume that the PID parameters of the lookAt tags are all set to zero, than the camera would not follow the object. Assume that the P-parameter of the lookAt tags are set to 1.0, than the camera would perfectly follow the position of the object. For the from tags, the initial distance from the followed object is try to kept constant (offset) or defines the radius with which the camera rotates around the object (orbit). The orbit has an additional attribute, which defines the rotational velocity in degree per second.
1 2 3 4 5 6 7 8 9 |
<orbit speed="0.5"> <lookAtX p="0.05" i="0.001" d="0.002"/> <lookAtY p="0.05" i="0.001" d="0.002"/> <lookAtZ p="1.0" i="0.0" d="0.0"/> <fromX p="0.01" i="0.0001" d="0.0002"/> <fromY p="0.01" i="0.0001" d="0.0002"/> <fromZ p="0.0" i="0.0" d="0.0"/> </orbit> <centre speed="1.5"/> |
sky
The sky tag allows to define the texture that is used for the sky. For a description how to includes textures in YARS, please see Sec. SECREF TEXTURES
1 |
<sky name="YARS/CloudySky"/> |
followables
The followables tag is a list of objects (see robot tag below) which can be followed by the camera. The objects are given by followable tags, which require nothing more but the unique object name.
1 2 3 |
<followables> <followable name="main body"/> </followables> |
recording
The recording tags contains a list of interval tags, which define at which iteration of the physics (see simulator frequency above) automatic recording is stated and terminated. This intention of this tag is to e.g. record the initial phase of a learning experiment as well as the converged state, without the need of constant monitoring of the experiment by the experimenter.
1 2 3 4 |
<recording> <interval start="0" end="120000"/> <interval start="9640000" end="10000000"/> </recording> |
visualise
At the current version of YARS, the visualise tag allows to configure if and how the joint coordinate systems are visualised. The joints tag allows to define the height and with of the axes visualisations as well as a possible offset in x,y,z coordinates.
1 2 3 |
<visualise> <joints radius="0.01" height="1.0" x="YARS/Red" y="YARS/Green" z="YARS/Blue"/> </visualise> |
screen, default
The screen section (as the default section) defines the appearance of window which displays the experiment. The first thing to notice is that every window must have a name, which is displayed in the titlebar of the window. There are a few optional attributes that determine if the window is shown as soon as YARS is running (show), if capturing the window’s content is also initiated immediately after the window is shown (capture), and finally, if the window’s camera should immediately follow the first object specified in the followables section (follow, followables is discussed below).
1 2 3 4 5 6 7 8 9 10 11 |
<screen name="Braiternberg" show="true" follow="false"> <size width="800" height="800"/> <camera> <position x="0.00" y="0.00" z="10"/> <lookAt x="0.0" y="0.01" z="0.0"/> </camera> <osd> <time font="Time" size="25" colour="FFFF00"/> <robot font="Robot" size="25" colour="FFFFFF"/> </osd> </screen> |
position
This tag has two attributes, x and y, which determine the monitor coordinates (centre of the window with respect to the upper left corner of the monitor).
resolution
The tags resolution and size mutually exclusive. Standard resolutions are defined and can are specified by the name attribute of the resolution tag, whereas the size tag allows to define the window size freely through the weight and height attributes.
osd
This section defines the fonts (type, size, colour) for the fonts used in the on-screen-display of YARS. This includes the font for the display of the simulated time (time, upper left corner) as well as the information that can be generated by the RobotController (robot, lower left corner, RobotController is discussed below).
macros
A macro is identified by a unique name and contains a set of objects (please see below). The macros can be referenced in the environments and body (see robot) as many times as desired. The position and textures defined in the macro can be modified, when the macro is referenced (see below).
The objects are described below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<macros> <macro name="wall"> <box name="box"> <dimension height="0.5" width="8" depth="0.25"/> <pose x="0" y="0" z="0" alpha="0" beta="0" gamma="0"/> <visualisation> <first name="YARS/GreenSkin"/> <second name="YARS/GreenSkin"/> <third name="YARS/GreenSkin"/> <fourth name="YARS/GreenSkin"/> <fifth name="YARS/GreenSkin"/> <sixth name="YARS/GreenSkin"/> </visualisation> <physics> <static/> </physics> </box> </macro> </macros> |
robots
The robots tag contains all actively controlled entities. Any number of robots may be configured in YARS.
robot
A robot has a unique name and consists of five subsections, which must be given in the following order: body, actuators, sensors, pose, controller.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<robots> <robot name="Braitenberg"> <body> ... </body> <pose x="2.25" z="0.05" gamma="15"/> <actuators> ... </actuators> <sensors> ... </sensors> <controller module="Braitenberg2b" frequency="10"/> </robot> </robots> |
body
The body section contains the definition of the physical objects. This section determines the shape, the weight distribution and friction of the robots morphology. The objects are specified below.
sphere
box
cylinder
capsule
mesh
ply
visualisation
physics
actuators
There are four different actuators available in YARS, which are; hinge, slider, fixed, and generic. They can be added in any order and in any number.
hinge
The hinge joint connects two bodies with a rotational/revolute joint.
1 2 3 4 5 6 7 8 |
<hinge name="wheel left hinge" type="velocity" mode="active"> <source name="wheel left"/> <destination name="main body"/> <force max="10.0"/> <velocity max="10.0"/> <pose x="0.0" y="0.0" z="0.0" gamma="90.0"/> <mapping min="-1" max="+1"/> </hinge> |
slider
The slider joint connects two bodies with a prismatic joint.
1 2 3 4 5 6 7 8 |
<slider name="example slider" type="velocity" mode="active"> <source name="source body"/> <destination name="second body"/> <force max="10.0"/> <velocity max="10.0"/> <pose x="0.0" y="0.0" z="0.0" gamma="90.0"/> <mapping min="-1" max="+1"/> </slider> |
fixed
The fixed joint connects two body and constraints their relative position and rotation to the original relative pose. In other words, the two bodies are connected and no rotation or translation is allowed. Because this is a joint, large forces may induces some change in the relative pose.
1 2 3 |
<fixed> <source name="main body"/> </fixed> |
if the destination object’s name is omitted, the actuators is attached to ,,to environment”. This means that in this example, it main body is fixed at its initial position.
generic
This joint allows to configure the constraints in all six dimensions, i.e. translation in x,y,z and rotation around x,y,z independently.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<generic name="front left Fe-Ma" spring="true"> <source name="main"/> <destination name="femur front left"/> <pose x="-0.345967" y="0.356388" z="-0.094383" gamma="30"/> <rotational> <x type="angular" mode="active"> <force max="7.5"/> <velocity max="0.5"/> <deflection min="-5.0" max="20.0"/> <mapping min="-1" max="1"/> <spring damping="1.0" stiffness=".1"/> </x> <z type="angular" mode="active"> <force max="7.5"/> <velocity max="0.5"/> <deflection min="-25" max="35"/> <mapping min="-1" max="1"/> <spring damping="1.0" stiffness=".1"/> </z> </rotational> </generic> |
sensors
YARS provides a number of sensors.
proximity
This is a generic proximity sensor that is simulated by five rays.
1 2 3 4 5 6 7 |
<proximity name="left 1"> <object name="main body"/> <pose x="0.0" y="0.1" z="0" alpha="-90" beta="90"/> <distance meter="0.5"/> <mapping min="1" max="-1"/> <openingAngles x="25" y="2.5"/> </proximity> |
ambientLight
This is a generic ambient light sensor.
orientation
This is a generic orientation sensor.
position
This is a generic position sensor.
ldr
This is a light dependent resistor position sensor.
This is a sharpDM2Y3A003K0F proximity sensor.
This is a sharpGP2D12_37 proximity sensor.
velocity
This is a velocity sensor.
deflection
This is a deflection sensor.
binaryContact
This is a binaryContact sensor.
generic
This is a generic joint sensor.
ov
This is a generic object velocity sensor.
oav
This is a generic object angular velocity sensor.
logging
actuator
sensor
object
gnuplot
console
controller
csv (logging)
blender
traces