Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ClockWaiter and ClockConditionalVariable #2691

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from

Conversation

jmachowinski
Copy link
Contributor

This replaces the Clock::cancel_sleep_or_wait with two new synchronization primitives, that can be instantiated separate from the Clock object.

The old API turned out the be a bad design, as one can not simply copy or create new clock objects.

If one copys a clock object, the same internal pimpl is copied, which is undesirable in combination with this API,
as they then all share the same conditional. Therefore one can't do sleeps with multiple threads without waking up
other threads.

If one tries to create a new clock, then there is no clockprovider registered to it. Leading to an unexpected
behavior in simulation mode. We should perhaps add a BIG warning to the constructor to not do this.

This merge request is a first step in reworking the clock code, and I want to get some feedback on the API / class names, before refactoring further.

@arneboe Can you have a look the documentation and API ?

Janosch Machowinski added 2 commits December 2, 2024 17:56
Added two new synchronization primitives to perform waits
using an rclcpp::Clock.

Signed-off-by: Janosch Machowinski <[email protected]>
Signed-off-by: Janosch Machowinski <[email protected]>
@ros-discourse
Copy link

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/next-client-library-wg-meeting-friday-6th-december-2024-8am-pt/40954/2

@sloretz
Copy link
Contributor

sloretz commented Dec 20, 2024

Assigned @wjwwood, and recommend Client Library Working group review 🧇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants