Repository navigation
Conversation
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 <yadunund@gmail.com>
skyegalaxy
requested review from
jmachowinski and
skyegalaxy
and removed request for
jmachowinski
October 16, 2026 21:53
nevlife
added a commit
to nevlife/rcl
that referenced
this pull request
Oct 21, 2026
… every clock tick (ros2#1352)
nevlife
added a commit
to nevlife/rcl
that referenced
this pull request
Oct 24, 2026
… every clock tick (ros2#1352)
skyegalaxy
approved these changes
Nov 2, 2026
Member
|
Pulls: ros2/rclcpp#3344, #1352 |
Yadunund
marked this pull request as ready for review
November 2, 2026 23:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Helps address ros2/rclcpp#3342
ROS time jumps can change a timer's next call time without notifying the executor. This causes
EventsCBGExecutorto miss timer updates after backward/clockjumps or whenuse_sim_timeis toggled.This PR adds
rcl_timer_set_on_schedule_change_callback()to notify consumers when a timer's next call time changes due to:No ABI changes.
Is this user-facing behavior change?
Yes. Enables executors to correctly reschedule timers after ROS time changes, preventing timers from stalling.
Did you use Generative AI?
Yes. Claude Fable 5.1
Additional Information
Tests:
test_timertests pass.ament_uncrustifyandament_cpplintpass.