|
World File SyntaxThe world file contains a description of the world to be simulated by Gazebo. It describes the layout of robots, sensors, light sources, user interface components, and so on. The world file can also be used to control some aspects of the simulation engine, such as the force of gravity or simulation time step.
Gazebo world files are written in XML, and can thus be created and modified using a text editor. Sample world files can be found in the /usr/local/share/gazebo/worlds/ Key Concepts and Basic SyntaxThe world consists mainly of model declarations. A model can be a robot (e.g. a Pioneer2AT or SegwayRMP), a sensor (e.g. SICK LMS200), a static feature of the world (e.g. MapExtruder) or some manipulable object. For example, the following declaration will create a Pioneer2AT namedrobot1 :
<model:Pioneer2AT> <id>robot1</id> <xyz>0 0 0.40</xyz> <rpy>0 0 45</rpy> </model:Pioneer2AT>
Associated with each model is a set of attributes such as the model's position Models can also be composed. One can, for example, attach a scanning laser range-finder to a robot:
<model:Pioneer2AT> <id>robot1</id> <xyz>0 0 0.40</xyz> <rpy>0 0 45</rpy> <model:SickLMS200> <id>laser1</id> <parentBody>chassis</parentBody> <xyz>0.15 0 0.20</xyz> <rpy>0 0 0</rpy> </model:SickLMS200> </model:Pioneer2AT>
The Graphical User InterfaceWhile Gazebo can operate without a GUI, it is often useful to have a viewport through which the user can inspect the world. In Gazebo, such user interface components are provided through special models (such as theObserverCam ) that can be declared and configured in the world file. See the documentation on the ObserverCam model for details.Canonical World File LayoutThe standard layout for the world file is can be seen from the examples included in theworlds directory. The basic components are as follows:
A detailed list of models and their attributes can be found in Models. Coordinate Systems and UnitsBy convention, Gazebo uses a right-handed coordinate system, with x and y in the plane, and z increasing with altitude. Most models are designed such that the are upright (with respect to the z axis) and pointing along the positive x axis. The tag<xyz;> is used to indicate an object's position (x, y and z coordinates); the tag <rpy;> is used to indicate an objects orientation (Euler angles; i.e., roll, pitch and yaw). For example, <xyz;>1 2 3</xyz;> indicates a translation of 1~m along the x-axis, 2~m along the y-axis and 3~m along the z-axis; <rpy;>10 20 30</rpy;> indicates a rotation of 30~degrees about the z-axis (yaw), followed by a rotation of 20~degrees about the y-axis (pitch) and a rotation of 10~degrees about the x-axis (roll).Unless otherwise specified, the world file uses SI units (meters, seconds, kilograms, etc). One exception is angles and angular velocities, which are measured in degrees and degrees/sec, respectively. |