Gazebo | Ignition | Community
Ask Your Question

Reseting time or world messes with joint_state_controller

asked 2021-06-02 10:23:32 -0500

m.bahno gravatar image

After time or world reset, joint_state_controller stops publishing /joint_states for a while and then it catches. This window can take quite a long time. I suppose, it is caused by publishing frequency mechanism, which cannot recover from time reset and just waits to get to the time of reset (source code here).

Is this a standard behaviour? Can it be avoided otherwise then rewriting the controller itself?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-06-03 04:40:26 -0500

nlamprian gravatar image

The ros controllers were not developed for Gazebo. So, for a real robot, this code is valid.

If this behavior is a problem for you, then you have two options:

  • write a world plugin that initializes time upon reset, such that it's strictly increasing
  • write a model plugin that reloads the controllers upon reset. You can use the controller manager services for that

    class Plugin : public ModelPlugin { virtual void Reset() override {; } };

Otherwise, GazeboRosControlPlugin should address this directly.

edit flag offensive delete link more


Thanks for the answer! Looking at the code, I believe that JointStateController will not be corrected by GazeboRosControlPlugin on time restart, since it holds its own last update time value. This was also my experience from experiments. Another thing was, that also other controllers misbehaved after time resetting (even with GazeboRosControlPlugin). However, on world reset they worked just fine.

m.bahno gravatar imagem.bahno ( 2021-06-04 01:19:57 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2021-06-02 10:23:32 -0500

Seen: 32 times

Last updated: Jun 03