Repository navigation
Add timer on reset callback - #995
Conversation
Signed-off-by: Mauro Passerino <[email protected]>
73918e1 to
174f2f3
Compare
Signed-off-by: Mauro Passerino <[email protected]>
|
@wjwwood @clalancette It would be very nice to merge this and #995 soon. We are trying to use https://github.com/irobot-ros/events-executor/, but it requires these pull requests, and manually rebuilding rcl and rclcpp with the pull requests merged is not sufficient because the rclcpp pull request includes ABI changes that require a rebuild of all packages using |
|
Another ping on this one due to the breaking ABI changes and the need to build nearly everything from source as a consequence if the events executor is used in a single node. Also I think you mean ros2/rclcpp#1979 @timonegk right? |
|
As the maintainers were updated recently also a frindly ping at @audrow and @ivanpauno |
Could you explain that in more detail? |
There are two situations in which a wait-set based executor can be awaken when something changes related to the timer, by means of triggering its guard condition: Before these same situations, the |
I think we trigger the guard condition because the timeout used in
IMO, that sounds better. |
Signed-off-by: Mauro Passerino <[email protected]>
Yes, no need to add an extra callback for it. |
Signed-off-by: Mauro Passerino <[email protected]>
Signed-off-by: Mauro Passerino <[email protected]>
audrow
left a comment
There was a problem hiding this comment.
Looks good to me with green CI!
A timer on ROS time moves its next call time inside its clock jump callback when the clock jumps backward past the last call time and when ROS time is activated or deactivated. Nothing told an executor that keeps its own copy of the next call time about it: the on reset callback is only called by rcl_timer_reset(), on purpose (#995), so the EventsCBGExecutor in rclcpp kept sleeping until the old deadline. Add a separate callback that is called at exactly those two places, after the new next call time was stored. It is kept apart from the on reset callback because it runs inside the clock jump callback, on the thread and under the locks of whoever set the clock, so a consumer has to handle it without blocking, while a reset callback may lock. Signed-off-by: Yadunund Vijay <[email protected]>
A timer on ROS time moves its next call time inside its clock jump callback when the clock jumps backward past the last call time and when ROS time is activated or deactivated. Nothing told an executor that keeps its own copy of the next call time about it: the on reset callback is only called by rcl_timer_reset(), on purpose (#995), so the EventsCBGExecutor in rclcpp kept sleeping until the old deadline. Add a separate callback that is called at exactly those two places, after the new next call time was stored. It is kept apart from the on reset callback because it runs inside the clock jump callback, on the thread and under the locks of whoever set the clock, so a consumer has to handle it without blocking, while a reset callback may lock. (cherry picked from commit 0224ede) Signed-off-by: Yadunund Vijay <[email protected]> Co-authored-by: yadunund <[email protected]>
@wjwwood this PR is created after discussions originated from this PR: #966
Instead of adding an
on_triggercallback to the rcl guard conditions, we add here anon_resetcallback to the rcl timers.The issue which originated this need, is wake up an events based executor when a timer is reset (which could also be caused by a time jump).
FYI @alsora