Robotics StackExchange | Archived questions

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

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?

Asked by apache8080 on 2019-09-23 17:19:30 UTC

Comments

Answers

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.

Asked by eric1221bday on 2019-09-23 18:00:27 UTC

Comments