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

Support use_sim_time (equivalent) in ros2cs #15

Open
adamdbrw opened this issue Feb 1, 2022 · 0 comments
Open

Support use_sim_time (equivalent) in ros2cs #15

adamdbrw opened this issue Feb 1, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@adamdbrw
Copy link
Member

adamdbrw commented Feb 1, 2022

The implementation should be rather straightforward.

In ros2, point of interest is time_source.cpp. It involves adding a "/clock" subscription that runs in it's own executor and using it as a time source if the parameter is set (with rcl_set_ros_time_override). This is preceded by resetting clocks and calling rcl_enable_ros_time_override. Since we interface with rcl, we need to replicate the behavior around calling these.

The work is as follows:

  1. Expose API to set use_sim_time (on Ros2cs level)
  2. Make this setting control whether we add a subscriber to "/clock" topic which in callback calls the *ros_time_override api. We would do this internally within Ros2cs. The subscription is best effort, keep last 1.

The current api for getting time should then just work (give system or "/clock" time depending on the parameter).

@adamdbrw adamdbrw added the enhancement New feature or request label Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant