Skip to content

Implement Clock::sleep_for and Clock::sleep_until #1730

@emersonknapp

Description

@emersonknapp

Feature request

Feature description

Implement the sleep_for and sleep_until functions specified in the "Clock and Time" design document for ROS 2 https://design.ros2.org/articles/clock_and_time.html#public-api

Implementation considerations

This will probably be best implemented using a condition_variable's wait_until and wait_for functions.

For stead/system time, these can be used, but the CV will need to be interrupted if time source type changes.

For ROS time, the CV can be awakened on receiving new clock samples, in order to check if the latest /clock time is >= the requested sleep_until time.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions