Gazebo | Ignition | Community
Ask Your Question
0

Problem with inserting model

asked 2017-04-07 03:36:22 -0500

Lawrence gravatar image

updated 2017-04-07 10:16:10 -0500

chapulina gravatar image

When I'm following the tutorial, I meet a problem after creating my first model configuration. In the following command:

mkdir -p ~/.gazebo/models/my_robot

I change the direction "~/.gazebo/models/my_robot" with my own file direction, because I don't find the file name of the given example.

After that, during the 'gedit' command for the 'model.sdf' file and 'model.config' file, I do the same action for gedit in the my same model direction.

Then the problem occurs, when I run the gazebo and try to find my_robot file in the "Insert" interface, I can't find the model direction which I set. My model direction is: '/home/iclab/gazebo_models/my_robot' But it didn't appear in the Insert list.

image description

Now I can't find the model direction in the Insert interface, resulting I can't do anything with my model. I've been stuck in this problem for days, hope someone can help me. Thanks a lot!

Update

I've try the method in here

I use

sudo gedit ~/.bashrc

and add this

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

My model locates in my_robot file. After I save the changes, I close and open gazebo again, but the Insert interface still remain the same: image description

I don't know what is going on here...

edit retag flag offensive close merge delete

Comments

Please don't complement your question with an answer, I just moved the answer to an Update section above ;)

chapulina gravatar imagechapulina ( 2017-04-07 10:16:59 -0500 )edit

Thanks! Sorry about that, I did so because I want to attach an image with my question

Lawrence gravatar imageLawrence ( 2017-04-07 23:52:01 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-04-07 10:37:54 -0500

chapulina gravatar image

Ok, just double-checking, your model is not the My Robot which shows on the screenshots, right? I can see a couple of them, one under /home/iclab/.gazebo/models and another under /home/iclab/gazebo_models.

I can also see you've added the directories /home/iclab/gazebo_models/my_robot and /home/iclab/Gazebo_simulation/my_robot, and they show up empty. The reason is a little tricky. The path you should tell Gazebo is not your model's directory (the directory which has the model.config and model.sdf files), but its parent directory.

For example, if you have this structure:

/home/iclab/gazebo_models
└── my_robot
    ├── model.sdf
    └── model.config

You should add the following to your path:

export GAZEBO_MODEL_PATH=/home/iclab/gazebo_models:$GAZEBO_MODEL_PATH
edit flag offensive delete link more

Comments

I've add the commands and reopen Gazebo, but the insert interface still remain the same... Should I reload the computer? I initially don't want to change the default directions, but I can't find the file name of the official tutorial...

Lawrence gravatar imageLawrence ( 2017-04-08 00:02:23 -0500 )edit

What's your robot's name?

chapulina gravatar imagechapulina ( 2017-04-08 11:24:38 -0500 )edit

Same as your response, I save the "model.sdf" and "model.config" in the file "my_robot"

Lawrence gravatar imageLawrence ( 2017-04-10 00:19:48 -0500 )edit

Your robot is not the "My Robot" which shows on the screenshots?

chapulina gravatar imagechapulina ( 2017-04-10 10:06:04 -0500 )edit

No, I save the model file(.sdf & .config) in 'my_robot' file, so 'my_robot' should be a file direction. But above 'My Robot' is a model box, and when I choose the box model it is floating freely with my mouse rather than fix at the origin as set up in the tutorial. So 'My Robot' may not be the model I want.

Lawrence gravatar imageLawrence ( 2017-04-10 20:56:57 -0500 )edit

Actually the name which will show on the insert tab is not the directory name, but the name you gave to your model under `model.config`. The behavior you're seeing is correct, the model is supposed to move with your mouse until you click somewhere on the scene to place it.

chapulina gravatar imagechapulina ( 2017-04-10 22:01:37 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-04-07 03:36:22 -0500

Seen: 3,328 times

Last updated: Apr 07 '17