Ask Your Question
0

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
0

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 12 times

Last updated: Sep 23