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

Solution proposed to implementing sim clock feature in ros2 bag play #299

Closed
scoopySHI opened this issue Feb 18, 2020 · 2 comments
Closed

Comments

@scoopySHI
Copy link

scoopySHI commented Feb 18, 2020

ros2 bag play with sim time (current time) as time stamper in header

As mentioned in issue #99, there is no proper way to play the rosbag file with sim colock (current time) as the time stamper. Therefore the rosbag file cannot be properly handled with some packages like robot_localization.
@kikass13 and i managed to find a solution to implementing this feature. We figured out the exact position of "Header" in Fastrtps serialized data and memcpy the current sim time into it as the new time stamper.
This feature is triggered with-cas argument in ros2 bag play. Otherwise ros2bag play performs as default.

Example:

ros2 bag play -c yourbagfiles.db3

Fork + branch:
https://github.com/scoopySHI/rosbag2/tree/time_fix


Test instances:
Originally it was tested with sensor_msgs/Imu and sensor_msgs/NavSatFix. In order to test the feature more comprehensively, multiple custom ros messages are also used to generate the testing rosbag files. The header is not required to be always at the first place inside the message. These custom messages are meaningless but cover thoroughly the types of messages including string, wide string, array etc. There can also be custom messages in front of the header.
Rosbags and custom messages tested:
https://github.com/scoopySHI/msg_ws

We would like to hear any feedback plus test results of this feature. @Karsten1987 @dirk-thomas @ivanpauno

@kikass13
Copy link

👍

@emersonknapp
Copy link
Collaborator

Closing this issue as there is already #99 tracking the feature, and this approach was decided against

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

No branches or pull requests

3 participants