0
$\begingroup$

Gazebo Answers logo

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 ?


Originally posted by Clement on Gazebo Answers with karma: 3 on 2022-06-09

Post score: 0


Original comments

Comment by azeey on 2022-06-11:
Do the worlds really need to be in their own subdirectories?

Comment by Clement on 2022-06-13:
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

Comment by azeey on 2022-06-13:
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 set IGN_GAZEBO_RESOURCE_PATH to /gazebo-detabase/models. More info here: https://classic.gazebosim.org/tutorials?tut=model_structure&cat=build_robot

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

And here: https://github.com/robotology/gym-ignition-models they use python to add the full path to the worlds in IGN_GAZEBO_RESOURCE_PATH.
I'll do something similar then.


Originally posted by Clement with karma: 3 on 2022-06-13

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.