ros2_controllers
ros2_controllers copied to clipboard
Wrap around time problem with diff_driver_controller.
Analysis:
Working on ros2_controller_demo I happened to have systematically the following exception:
[ros2_control_node-1] ros2_control_node: /opt/ros/foxy/include/rcppmath/clamp.hpp:41: constexpr const T& rcppmath::clamp(const T&, const T&, const T&) [with T = double]: Assertion !(hi < lo)' failed.
see related issue here
The clamp is triggered from here:
https://github.com/ros-controls/ros2_controllers/blob/3586acec2d541545b1575c80eb46a91b7232a28d/diff_drive_controller/src/diff_drive_controller.cpp#L244
I checked the speed_limiter and it does not come from here.
It is due to negative duration. This is quite surprising.
The test is run in a docker.
I was wondering if somebody else happen to have the problem or if this is a setup problem ?
Quick way around:
In order to avoid the problem, I just tested if update_dt is negative and returns if this is the case.
Any feedback appreciated.