ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Does rosbag::View iterator iterate sequentially and sync all the timestamps?

asked 2019-09-23 17:19:30 -0500

apache8080 gravatar image

I had some questions about the following code:

rosbag::View view(bag, rosbag::TopicQuery(topics));

foreach(rosbag::MessageInstance const m, view)

Is this iterator going to be sequentially going through the rosbag? I was also wondering if the MessageInstance is all the topics values at a specific synced timestamp? For example if I have two camera topics and an imu topic will each MessageInstance m have the camera data and imu data all at the same timestamp?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-09-23 18:00:27 -0500

eric1221bday gravatar image

I believe the rosbag messages are ordered at the order the rosbag stores them in, which is to say the order in why the rosbag interface recorded it. This does mean that in some cases you can have messages with out of order internal timestamps, since transport delay or other network problems can cause some messages to arrive later than it should. The rosbag does internally maintain the timestamp of each message which is pegged to when it received it, which is what is being used to determine the order.

edit flag offensive delete link more

Question Tools



Asked: 2019-09-23 17:19:30 -0500

Seen: 538 times

Last updated: Sep 23 '19