Rosanswers logo

Hi all,

We have some sensor data that are saved as .csv files (data+timestamp) from a robot, which does not run ROS. To run some algorithms, I converted once such file into a ROS bag file using a python script.

After setting the /use_sim_time parameter and when playback this bag file with rosbag play --clock abc.bag, all the data seems to be flushed at once.

I need to know what determines the natural play speed of a bag file. I thought it is done using the header.stamp

Thank you in advance


Originally posted by ChickenSoup on ROS Answers with karma: 387 on 2012-11-13

Post score: 0


1 Answer 1


Rosanswers logo

In your Python script, I guess you were using Bag.write. Did you specify the t parameter and set it to the correct time stamp? As far as I know, that's the parameter that controls playback speed.

The system cannot use header.stamp for a simple reason: not every message has a stamp but rosbag needs time information. Also, the C++ rosbag library uses the raw (serialized) message data blobs to store them in the file. There is just no way to access the header without knowing the exact message definition.

Originally posted by Lorenz with karma: 22731 on 2012-11-13

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by ChickenSoup on 2012-11-13:
Thank you very much. Yeah it was the 't' paramater.


Your Answer

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