2020-12-01 15:58

diff_drive_controller reacts badly to dt < 0

As discussed here, the behaviour of diff_drive_controller when passed a -ve dt for update period is very undesireable.

This can be warned against in docs/tutorials, but perhaps some sort of corrective action could be done by the controller as well, such as overriding negative periods with zero, or entirely skipping the loop.

This would have the same general effect (net change in speed would be bound to 0), which would make sense since the speed_limiter can't reasonably limit the speed when the time change is unknown.


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • weixin_39654848 weixin_39654848 5月前


    点赞 评论 复制链接分享
  • weixin_39839968 weixin_39839968 5月前

    I'd prefer having a fix for it over doc warnings. Anyone working on it?

    Anyone wants to? ... or shall we throw a dice? :)

    点赞 评论 复制链接分享
  • weixin_39714528 weixin_39714528 5月前

    Let's first take a look to where the control period is used. Apparently, it's only used here, in the speed limiter. Would it make sense to actually handle negative control periods?, like taking the absolute value of the period?. If it does makes sense, apart from the implementation changes, we could add a note to the respective documentation.

    Negative control periods is something that in general should not occur, and should be enforced at the robot hardware level. As stated in the link of the OP, the actual policy on what to do in these circumstances should not be imposed by ros_control, though.

    点赞 评论 复制链接分享
  • weixin_39839968 weixin_39839968 5月前

    A related one #202

    点赞 评论 复制链接分享
  • weixin_39839968 weixin_39839968 5月前

    This issue has been hanging in the air for almost a year. Let's put at least one nail into the coffin of it. How about adding a check & warning & link to this issue? It wouldn't solve the problem but would help people not trip over it.

    I can add these changes if you agree.

    点赞 评论 复制链接分享