Gazebo | Ignition | Community
Ask Your Question

[ros2] reset_world/reset_simulation fail with URDF

asked 2019-01-03 10:30:22 -0500

nzlz gravatar image

Hi everyone,

First of all I'm not sure if its correct to comment a still not accepted PR, so I'm just leaving this here. This is about Port time commands (pause / reset) PR.

I want to be able to reset my robot, but I'm not achieving the desired results with neither /reset_world nor /reset_simulation. Images are self explanatory, only the pure gazebo model works as expected, not the urdf.

  • In reset_world MARA model is not affected.
  • In reset_simulation MARA loses all joint forces, or something like that.





edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-01-03 12:00:34 -0500

chapulina gravatar image

Thank you for trying out that pull request!

Images are self explanatory

Actually, could you describe what are the expected outcomes? You say that "In reset_simulation MARA loses all joint forces", and that's what I would expect. I'm not sure how you're applying forces to the model, but on your plugin, you should override the Plugin::Reset method and make sure your controllers respond accordingly. Another way to check if a reset occurred is to get the current simulation time and detect if it has moved backwards.

Also, a side note, the ROS 2 pull request you're testing is only exposing Gazebo functionality which you could also access through the GUI. These are the hotkeys on gzclient:

  • Ctrl + R: Reset simulation
  • Ctrl + Shift + R: Reset world
edit flag offensive delete link more


The plugin I'm using is probably the failing part. But I really don't know how to proceed or what could be failing. (Reset is not implemented.) I would really appreciate if you can give me some hints : I have to mention I've seen (2 times only) the robot recover by itself after a long time, and start moving normal again. Really don't know why or how this happened.

nzlz gravatar imagenzlz ( 2019-01-04 09:38:50 -0500 )edit

I want to mention also that I don't get any console error. The last message is: [INFO] [mara_joint_state]: Negative sim time difference detected.

nzlz gravatar imagenzlz ( 2019-01-04 09:39:18 -0500 )edit

On your plugin, I'd check if `joints_[MARAGazeboPluginRosPrivate::AXIS1]->SetPosition(0, goal_position_axis1_rad, false);` is still being called after reset. seconds_since_last_update is probably negative.

chapulina gravatar imagechapulina ( 2019-01-04 11:39:28 -0500 )edit

Thanks!! Removing negative time check + Adding initialization variables to Reset() fixed the issue. reset_simulation is working as expected now.

nzlz gravatar imagenzlz ( 2019-01-07 05:08:12 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-01-03 10:30:22 -0500

Seen: 620 times

Last updated: Jan 03 '19