What are description files and how to create them

This page explains what are description files, why we need them and how to create them. We can distinguish Gazebo .world files that describe the simulated environment, the associated models that are simulated and ROS .scene files that contain information about the collisions.

Note

For convenience sake, you can gather all these files in a folder (or even better a ROS package), like this one.

Gazebo models folder

This folder must contain at least all the objects used to compose a world, defined as SDF files. The minimal directory structure of such a folder is the following: .. code-block:: bash

models +– <model_using_mesh_name> | +– meshes | +– <model_using_mesh_name>.stl | +– model.config | +– model.sdf +– <model_no_mesh_name> | +– model.config | +– model.sdf

Please note that the meshes can also be .dae files, allowing you to add texture. You can find an example of a gazebo models folder here.

Gazebo world files

Gazebo worls allow you to simulate your robot’s environement. It can be either static or contain some dynamics mechanisms. It exists several ways of creating gazebo worlds. We detail here three options.

Using the Gazebo interface

If you want to use the native Gazebo interface, you can follow this tutorial.

Using the Shadow World Generator

We have implemented a software that helps in the process of creating Gazebo world files. All the dependencies are already installed in the container. You just need to follow these instructions.

Manually creating world files

If you are not a big fan of GUIs and/or you already have a good hang of how to design Gazebo world files, you can still quickly create your world file manually.
The most important part is to have all the objects that will be used to create your world in a single Gazebo models folder. In this case, you can just modify the following template and save the file with a .world extension, and that’s it you have your Gazebo world created!

Note

This template is a backbone allowing to create simple (but most of the time sufficient) world files. You can freely adjust the different parameters to better fit your constraints.

If you want to add a sensor with its corresponding model, you can do so in this template. For instance adding a RGB-D sensor such as a kinect, which will already create the ROS topics containing the data.

Scene files

Scene files contain all the information about the collision scene of the robot. You can either create a simplified version of your environment using primitive shapes (not recommended) or use the .world file that you have just created. You can either follow these instructions or directly use GRIP to create the scene file.
In simulation mode, specify the world file corresponding to the scene you want to generate. Once the robot is running in simulation, go to RViz. If you don’t have the Motion Planning on the left part of your window, add it. Then go in the tab Scene Objects and click on Export As Text. Choose the path to the folder in which you want to save the scene, pick a name and save it. And here is your scene file.