How to structure a model database for Gazebo Ignition
Hello,
I'd like to create a model/world database for my Gazebo Ignition projects.
I've created the following folder structure for my database:
├─ gazebo-database/
│ ├─ models/
│ │ ├─ model1/
│ │ ├─ model2/
│ ├─ worlds/
│ │ ├─ world1/
│ │ │ ├─ world1.sdf
│ │ ├─ world2/
I'd like to be able to open a world (let's say world1.sdf) using:
ros2 launch ros_ign_gazebo ign_gazebo.launch.py ign_args:="-v -r world1.sdf"
I tried to set IGN_GAZEBO_RESOURCE_PATH env variable to /gazebo-database but it didn't work.
It seems that the database is not parsed to find the model.
It only works if I set the IGN_GAZEBO_RESOURCE_PATH to /gazebo-database/worlds/world1/
I don't want to have to add all the path to the worlds manually...
Can someone explain me how to do ?
Do the worlds really need to be in their own subdirectories?
No not really, but it would be cleaner to have everything related to a world in its directory.
In this repository, they create a folder for each world: https://github.com/osrf/gazebo_models
The folders in the
gazebo_models
repo are models, not worlds. There's a difference between the two. What you have for the models in your original example should work, but you'd setIGN_GAZEBO_RESOURCE_PATH
to/gazebo-detabase/models
. More info here: https://classic.gazebosim.org/tutoria...