Cookbook

circle-exclamation

How are the model files resolved?

For large world, it's impossible to store all the model definition in the .sdf world file. Instead, models are commonly stored in a subdirectory models. For example, in the aws-robomaker-bookstore-world, we have the following project structure

~/workspace/gazebo-projects/aws-robomaker-bookstore-world$ tree -L 1
.
β”œβ”€β”€ CMakeLists.txt
β”œβ”€β”€ CODE_OF_CONDUCT.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ docs
β”œβ”€β”€ launch
β”œβ”€β”€ LICENSE
β”œβ”€β”€ maps
β”œβ”€β”€ models
β”œβ”€β”€ my_note.txt
β”œβ”€β”€ package.xml
β”œβ”€β”€ README.md
β”œβ”€β”€ routes
└── worlds

And the models directory looks like the following:

These models are reference in the world file. For instance:

As we can see, the model path is a relative path. Therefore, when launching the Gazebo, we need to set the model path. Depending on the Gazebo version, there may be many environment variables available. According to the documentationarrow-up-right, we have the following variables:

  • GAZEBO_MODEL_PATH: colon-separated set of directories where Gazebo will search for models

  • GAZEBO_RESOURCE_PATH: colon-separated set of directories where Gazebo will search for other resources such as world and media files.

  • GAZEBO_MASTER_URI: URI of the Gazebo master. This specifies the IP and port where the server will be started and tells the clients where to connect to.

  • GAZEBO_PLUGIN_PATH: colon-separated set of directories where Gazebo will search for the plugin shared libraries at runtime.

  • GAZEBO_MODEL_DATABASE_URI: URI of the online model database where Gazebo will download models from.

For Gazebo Fortress, we need to set the variable IGN_GAZEBO_RESOURCE_PATH to the models directory. This variable is documented on this pagearrow-up-right, Models, Lights, actors section.

Where are the Gazebo plugins installed on Ubuntu?

  • Check the environment variable IGN_GAZEBO_SYSTEM_PLUGIN_PATH

  • Check directory similar to /usr/lib/x86_64-linux-gnu/gazebo-7.0/plugins

Last updated