Gazebo | Ignition | Community
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:


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

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

chapulina gravatar image

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

answered 2018-02-15 08:34:29 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Thanks for your comments.However I face the same issue with a similar file attached. I'm running on gazebo8. I tried to remove the <state> tag, but it didn't work. Thanks for any help.

edit flag offensive delete link more


Please post a new question, an answer on an old question is not the best place for this ;)

chapulina gravatar imagechapulina ( 2018-02-15 11:52:24 -0500 )edit

Question Tools

1 follower


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

Seen: 1,375 times

Last updated: Feb 15 '18