Gazebo | Ignition | Community
Ask Your Question

Gazebo not updating visual position in gzclient

asked 2018-08-07 03:42:02 -0500

Raskkii gravatar image

I've encountered an interesting situation in Gazebo 9.3. I'm not sure if it's a bug or not but when setting the position of my model either via /gazebo/set_model_state topic or via the Gazebo API (using SetWorldPose), the visual position of the model does not change.

Here's a simple example:

1) I have this wooden log with a position of x: 0.0 y: 0.1 z: 0.0.
image description
2) I attempt to change its position to x: 0.0 y: 0.0 z: 0.0. (by using either /gazebo/set_model_state or Gazebo API)
3) When viewing properties of the object in the Gazebo GUI, the position is displayed correctly.
image description
4) However the position of the visual object in the actual world does not display correctly. (it shows the object to still be at y: 0.1)

And the reason why I think this might be a bug is because this does not happen all the time. About 50% of the time, the position in the world changes correctly and the other 50% of the times the object does not change. I haven't noticed any reasonable logic as to when it changes and when it doesn't.

Does anyone have any insight to this?

Here's the sdf I'm using for the wooden log:

<?xml version="1.0"?>
<sdf version="1.4">
  <model name="wood">
    <link name="wood_link">
      <visual name="wood_visual">

I've tried different ways of spawning it into the world (or having it already there in the .world file) but it acts the same way.

edit retag flag offensive close merge delete


Is the model selected in the GUI at the moment you send the command? Try making sure the model is not selected and see if you can still reproduce the issue.

chapulina gravatar imagechapulina ( 2018-08-07 11:17:37 -0500 )edit

I've tried it either way. No difference.

Raskkii gravatar imageRaskkii ( 2018-08-08 01:25:33 -0500 )edit

I have the same problem, any updates on this? For my case, it is not a solution to use <static>false</static>

rezenders gravatar imagerezenders ( 2020-07-10 12:48:25 -0500 )edit

Any updates on this? I'm facing the same problem.

clawaster gravatar imageclawaster ( 2022-12-20 07:45:23 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-08-08 03:05:27 -0500

wentz gravatar image

This happens to me too. In my case the solution was simply to change static to false:


dont know exactly why but it worked(for me). I remember that static models are ignored by the physics engine and therefore not updated. Hope that helps.

edit flag offensive delete link more


Thank you. This does make the object spawn consistently at places i tell it to spawn in. However, the problem is without the static tag, the object falls down whenever I attempt to spawn it higher on the z axis. For my simulation, I need the object to be able to stay statically in the air. Any ideas?

Raskkii gravatar imageRaskkii ( 2018-08-08 05:02:51 -0500 )edit

Oh, I can just set gravity of the model to 0. Now everything works as I need it to. Thanks again!

Raskkii gravatar imageRaskkii ( 2018-08-08 05:16:35 -0500 )edit

I am facing the same issue. I know by changing static to false and gravity to 0, it always works in GUI. However, I don't want to change static to false because I want to allow models penetrate into each other without flying away. If I keep static to true, I don't need to worry about collision at all, but not if I set static to false. Any suggestions?

captainzhao gravatar imagecaptainzhao ( 2020-08-20 02:11:20 -0500 )edit

Question Tools

1 follower


Asked: 2018-08-07 03:42:02 -0500

Seen: 1,739 times

Last updated: Aug 08 '18