1
$\begingroup$

I am running into a strange issue with ros2 where bag data gets played back much too quickly. I have a ~12s recording of a pointcloud stream, but when visualizing the replay in RVIZ there are about 3-4 seconds between the first and last update to the point cloud. What seems to happen is that all the database files from the bag get decompressed and read one after the other, then once that's done all messages are dumped "at the same time". Inspecting the pointcloud topic with ros2 topic hz also reveals a much faster rate than when recording.

Could this be an issue with my recording setup (multiple compressed sql files), QOS profile (which I leave at defaults) or some other synchronization issue? The data was recorded on a desktop install of ros2 galactic/Ubuntu 20.04 and the playback is happening with the same installation but through WSL on Windows 10.

Thanks!

$\endgroup$

2 Answers 2

1
$\begingroup$

you could try playing your bag with the clock tag, if you have not recorded the /clock topic:

ros2 bag play rosbag2 --clock 20

and be sure your nodes are having the use_sim_time parameter set to true.

$\endgroup$
1
$\begingroup$

This may be due to a bug in rosbag2 with split recordings, as per these github issues:

These should be fixed in more recent ROS releases (from may 2022) but the recommendation is to avoid splitting the recordings. The proposed solution for already recorded bags to update the starting time in the metadata.yaml file didn't work for me, however.

Edit:

With ROS2 humble, the convert action was added to ros2 bag which, with the starting timestamp modification in metadata.yaml, allows to recombine bags into a single file. These then play at much more consistent rates.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.