0
$\begingroup$

Gazebo Answers logo

I was looking at the tutorial of the "Making a mobile robot"

And here I meet a problem

I can't find my_robot file in the left side of the Gazebo GUI image description

I bet the problem is because I didn't setup the model directory correctly, so I check up the previous section of this part:

mkdir -p ~/.gazebo/models/my_robot <= this is in the tutorial, but I didn't find the "models" file in my "gazebo" file, so I change into this direction: mkdir -p /home/iclab/gazebo_models/my_robot <= gazebo_models is another file I create

Then I follow the instructions to create model.config and model.sdf file

But after I want to insert my own model, I can't find my_robot file in the left side as tutorial

Can anyone tell me why?

Thanks a lot!


Originally posted by Lawrence on Gazebo Answers with karma: 3 on 2017-03-28

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

Gazebo looks for models in a few specific directories. The tutorial tells you to place the model inside ~/.gazebo/models because Gazebo always looks there by default (unless you made some custom installation).

If the ~/.gazebo/models directory doesn't exist, it should be fine to create it yourself. In fact, that's what the -p flag in the mkdir command in the tutorial is doing.

(by the way, it looks like you already have some models in that directory, look on the top left corner of your screenshot)

It's also fine to use a custom directory path as you did. But in this case, you must tell Gazebo to look there too. Gazebo checks an environment variable GAZEBO_MODEL_PATH to know where to look. You can prepend your path to that variable like this:

export GAZEBO_MODEL_PATH=/home/iclab/gazebo_models:$GAZEBO_MODEL_PATH

Note that this will only work for the current shell (terminal). To make it persistent for the next terminals you open, you can do:

echo "export GAZEBO_MODEL_PATH=/home/iclab/gazebo_models:$GAZEBO_MODEL_PATH" >> ~/.bashrc


Originally posted by chapulina with karma: 7504 on 2017-03-28

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Lawrence on 2017-03-29:
Thanks for your reply so quickly! I can insert the model box now. It seems the left and above table of contents is the record of the models I've called. I'll keep going until I meet another problem. Thanks!

Comment by chapulina on 2017-03-29:
Glad to help! Make sure you mark this answer as correct if it solved your problem, so other users can know it ;)

$\endgroup$

Your Answer

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