Cookbook
We use Gazebo version Fortress in our local experiment but the linked documentation may involve a different version of Gazebo.
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:
~/workspace/gazebo-projects/aws-robomaker-bookstore-world/models$ tree -L 2 | head -n 15
.
βββ aws_robomaker_retail_AirConditionerC_01
βΒ Β βββ materials
βΒ Β βββ meshes
βΒ Β βββ model.config
βΒ Β βββ model.sdf
βββ aws_robomaker_retail_Bicycle_01
βΒ Β βββ materials
βΒ Β βββ meshes
βΒ Β βββ model.config
βΒ Β βββ model.sdf
These models are reference in the world file. For instance:
<model name="AirConditionerC_01_001">
<include>
<uri>model://aws_robomaker_retail_AirConditionerC_01</uri>
</include>
<pose frame="">7.458202 1.422453 3.290944 0 -0 -1.564217</pose>
</model>
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 documentation, 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 page, 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