-
Notifications
You must be signed in to change notification settings - Fork 305
Description
Description
Feature request: Provide the --clock option so that rosbag2 publishes to the /clock topic alongside its messages.
Implementation Suggestion
Using starting_time of the bag and the stored (received) timestamp with every message, we can start a publisher for the /clock topic on playback and run it at a fixed rate, publishing messages when the next clock message is past their publishing time.
This requires no introspection or modification of the message contents themselves.
Note that player.cpp is already using message timestamps to sleep in between publishing, to approximate the original rates. In this loop (play_messages_until_queue_empty) we could potentially insert the clock publisher there.
Another option would be to put the clock publisher on a timer, and have it publish the last-published message time.
Original Ticket
From ros 1 I'm used to the --clock option in order that the topics have time stamps as If the system would run right now. I couldn't find this option in the documentation of rosbag2. How can I activate simulated time with rosbag2?