Gazebo | Ignition | Community
Ask Your Question
0

How to include a model which is not in default path

asked 2020-04-24 01:37:10 -0500

Idontwan gravatar image

I have build a model by myself, it's a folder named "My_Model", it has correct .config and .sdf file. I can include it by moving the folder to default GAZEBO_MODEL_PATH, and write " <include> <uri>model://My_Model</uri> </include> " in the .world file. It works.

But what if I don't move this folder to the default path, and I don't want to modify the default GAZEBO_MODEL_PATH, how can I include it? For example, its absolute path is /home/idontwan/Documents/My_Model, how should I write the script?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2020-05-05 09:10:32 -0500

ahcorde gravatar image

Hi Idontwan,

As Clement mentioned you only need to add to GAZEBO_MODEL_PATH the path of your model. There is no risk if you modify this variable. When you open a new terminal this variable is reseted. If you want to make this change permanent edit your ~/.bashrc.

You can check the current value of GAZEBO_MODEL_PATH typing:

echo $GAZEBO_MODEL_PATH
/usr/share/gazebo-9/models

then you can add your model path with, you can add as much as paths as you want, you need to split them using :

export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:<path to your model>

Regards

edit flag offensive delete link more
0

answered 2020-04-27 05:20:56 -0500

Clément Rolinat gravatar image

hello, you have to add the path to your model to the GAZEBO_MODEL_PATH variable.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-04-24 01:37:10 -0500

Seen: 204 times

Last updated: Apr 27 '20