Home | Tutorials | Wiki | Issues
Ask Your Question

world shifts after reset

asked 2017-05-11 17:06:03 -0500

ethanabrooks gravatar image

updated 2017-05-11 17:08:08 -0500

For a few (not all) of my world files, the world (as in, the walls and static objects) suddenly move (as in rotate and translate, all together) after calling the '/gazebo/reset_world' service. All the walls and static objects maintain the same position relative to each other. This would not be a problem, except my robot does not move with everything else, and in some worlds, this puts my robot inside a wall. I should add that for the problem worlds, the issue occurs whether or not I load the robot.

Here's a gist of one of the problem worlds: https://gist.github.com/lobachevzky/9...


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-12 10:17:36 -0500

I think this happens because of the <state> tag in your world file.

Basically, when Gazebo loads the world, it first loads the <world> tag and then applies the state changes described in <state>. When you reset the world, it goes back to before the states, so the world looks different from when you first loaded it.

The solution is to remove the state tags and apply those changes directly in the first world description.

(You might have generated this world by saving it through the Gazebo UI, correct? I just ticketed an issue about this)

edit flag offensive delete link more


Thank you so much for the answer. That is really strange! I did create some of those worlds using the GUI. What is the `<state>` field for, and what behavior in the GUI generates it?

ethanabrooks gravatar imageethanabrooks ( 2017-05-12 15:19:03 -0500 )edit

The `<state>` field is most useful for logging and playback. What it means is that the state of the world has changed since it was first generated. So most probably your models were moved before saving the file, which explains the offset...

chapulina gravatar imagechapulina ( 2017-05-13 13:11:29 -0500 )edit

I see. Thanks!

ethanabrooks gravatar imageethanabrooks ( 2017-05-14 07:55:59 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-05-11 17:06:03 -0500

Seen: 60 times

Last updated: May 12