Skip to content

improved rcl_wait in the area of timeout computation and spurious wakeups#1146

Merged
mjcarroll merged 3 commits into
ros2:rollingfrom
cellumation:timer_imporvements2
Apr 3, 2024
Merged

improved rcl_wait in the area of timeout computation and spurious wakeups#1146
mjcarroll merged 3 commits into
ros2:rollingfrom
cellumation:timer_imporvements2

Conversation

@jmachowinski
Copy link
Copy Markdown
Contributor

This fixes the issues reported by #1142.

Fixed a bug that a ready override timer would not wake up the wait set.

Adopted the test to catch this condition.

@clalancette, @mjcarroll , @fujitatomoya , @wjwwood

Janosch Machowinski added 2 commits March 31, 2024 12:18
Signed-off-by: Janosch Machowinski <j.machowinski@nospam.org>
Signed-off-by: Janosch Machowinski <j.machowinski@nospam.org>
Copy link
Copy Markdown
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. i think this should work for failed cases https://ci.ros2.org/job/ci_linux/20668/testReport/.

@jmachowinski thank you very much for your effort including weekend!

I will start the CI. (I will exclude ros2/rclcpp#2469, to verify this specific PR 1st.)

Comment thread rcl/src/rcl/wait.c
@fujitatomoya
Copy link
Copy Markdown
Collaborator

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

Added special handling for timers with a clock that has time override
enabled. For these timer we should not compute a timeout, as the waitset
is waken up by the associated guard condition.
Before this change, the waitset could wait up, because of an expected ready
timer, that was acutally not ready, as the time update to the ROS_TIME had
not yet arrived.

Signed-off-by: Janosch Machowinski <j.machowinski@nospam.org>
@jmachowinski
Copy link
Copy Markdown
Contributor Author

fixed the linting problem

@jmachowinski jmachowinski force-pushed the timer_imporvements2 branch from 10bb656 to 3191f3a Compare April 2, 2024 10:16
@fujitatomoya
Copy link
Copy Markdown
Collaborator

Full CI: (ros2/rclcpp#2469 is already merged)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@fujitatomoya
Copy link
Copy Markdown
Collaborator

Comment thread rcl/src/rcl/wait.c
Comment thread rcl/src/rcl/wait.c
Comment thread rcl/src/rcl/wait.c
Comment thread rcl/src/rcl/wait.c
Comment thread rcl/src/rcl/wait.c
@mjcarroll mjcarroll merged commit db366ac into ros2:rolling Apr 3, 2024
n8hui added a commit to n8hui/rcl that referenced this pull request May 3, 2025
(cherry-picked from commit 2e9549c)

Signed-off-by: Nathan Hui <ncynhui@gmail.com>
n8hui added a commit to n8hui/rcl that referenced this pull request Feb 21, 2026
(cherry-picked from commit 2e9549c)

Signed-off-by: Nathan Hui <ncynhui@gmail.com>
n8hui added a commit to n8hui/rcl that referenced this pull request Feb 21, 2026
(cherry-picked from commit 2e9549c)

Signed-off-by: Nathan Hui <205866820+n8hui@users.noreply.github.com>
jmachowinski pushed a commit that referenced this pull request Apr 7, 2026
* Added rcl_timer_get_next_call_time (#1146)
(cherry-picked from commit 2e9549c)

Signed-off-by: Nathan Hui <205866820+n8hui@users.noreply.github.com>

* Add unit test for rcl_timer_get_next_call_time

Signed-off-by: Nathan Hui <205866820+n8hui@users.noreply.github.com>

---------

Signed-off-by: Nathan Hui <205866820+n8hui@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants