You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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
-c
as argument in ros2 bag play. Otherwise ros2bag play performs as default.Example:
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
The text was updated successfully, but these errors were encountered: