gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.17k stars 476 forks source link

Issue moving static object in Gazebo 7.0 and Gazebo 8.4. #2488

Open osrf-migration opened 6 years ago

osrf-migration commented 6 years ago

Original report (archived issue) by Fabricio Emder (Bitbucket: creativa_femder).


I am using Gazebo 7.0 and Gazebo 8.4 for a project where we need to move static object with this command:

#!bash

rosservice call /gazebo/set_model_state '{model_state: { model_name:model_name_0, pose: { position: { x: 2, y: 0 , z: 0.5 }, orientation: {x: 0, y: 0, z: 0, w: 0 } }, twist: { linear: {x: 0.0 , y: 0 ,z: 0 } , angular: { x: 0.0 , y: 0 , z: 0.0 } } , reference_frame: world } }'

When the objects are not static, the ros service works ok. But objects have weird behaviors when they are static. The gazebo GUI and Physics engine have synchronization problems when we use rosservice call /gazebo/set_model_state. If we move the models from the GUI using the mouse we don't have any problems.

The problems that I have when I use this command with static object you can see in the following.

box1.gif

In the command I change x between 2 and -2. The weird part is that I can select the object and see the collision and the inertial all the time in -2, but as you see in the gif.

In the following gif, a static box is above the dynamic box, but Gazebo doesn’t show it that way. Again, there’s a mismatch between what Gazebo is showing and what the physics engine is doing.

box5.gif

Other more thing. I tried to change the static flag from a world plugin with model method and if the model starts as static and then I change it to dynamic, Gazebo GUI shows the change in the flag but the physics engine still takes it as static. We have the same problems if the model starts as dynamic; we can’t change it to static.

The last thing. Trying to create the gift for this issue. I discover that this happens when I am using a ray plugin. In this case hokuyo sensor.

osrf-migration commented 6 years ago

Original comment by Fabricio Emder (Bitbucket: creativa_femder).


To add : This issue (#2482). Just to clarified: For a project i am using a custom sensor with ray plugin.

osrf-migration commented 6 years ago

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


I can reproduce the issue even without ROS, just open an empty world and run:

gz model -m ground_plane -z 2

The visualization changes, but the physics still behaves as if the ground plane were on the origin.

I tried to change the static flag from a world plugin with model method and if the model starts as static and then I change it to dynamic, Gazebo GUI shows the change in the flag but the physics engine still takes it as static.

This is probably issue #1526, changing the static flag at runtime doesn't work right now.

I discover that this happens when I am using a ray plugin.

I'm not sure what you mean by "this", what happens? I can reproduce the original issue without a ray sensor in the world.

osrf-migration commented 6 years ago

Original comment by Fabricio Emder (Bitbucket: creativa_femder).


Thank you for your answer @chapulina ! I tested it with your command:

#!bash

gz model -m ground_plane -z 2

And I can reproduce it without Ray plugins and ROS. Before that I tried with two box and I couldn't reproduce it.

And thank you for the issue about static flag.