Home | Tutorials | Wiki | Issues
Ask Your Question
0

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">
    <static>true</static>
    <link name="wood_link">
      <visual name="wood_visual">
        <geometry>
          <cylinder>
            <radius>0.03</radius>
            <length>0.1</length>
          </cylinder>
        </geometry>
        <material>
          <script>
            <name>Gazebo/WoodFloor</name>
          </script>
        </material>
      </visual>
    </link>
  </model>
</sdf>

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

Comments

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

1 Answer

Sort by ยป oldest newest most voted
1

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:

<static>false</static>

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

Comments

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
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 46 times

Last updated: Aug 08