0
$\begingroup$

Rosanswers logo

Hi folks,

I believe there is an error in the ROS Bag 2.0 format specification on the wiki (at the time of this post, page rev 21, last edited 2010-07-08):
http://www.ros.org/wiki/Bags/Format/2.0#Index_data

The wiki states that data portion of the index data record consists of repeated occurences of:
time - 8 bytes
chunk_pos - 8 bytes
offset - 4 bytes

However, when my bag file (ROSBAG V2.0, with data_index records that show ver=1) is parsed this way, the number of messages of this size (20 bytes) is larger than the data_len field in the record preamble. Also, looking at the source code, in the file bag.cpp at:
https://code.ros.org/svn/ros/stacks/ros_comm/tags/electric/tools/rosbag/src/bag.cpp
the function readConnectionIndexRecord200 shows the following code:
read((char*) &sec, 4);
read((char*) &nsec, 4);
read((char*) &index_entry.offset, 4);

which appears to indicate that time is 8 bytes, there is no chunk position, and the offset is 4 bytes. When interpreted this way, the number_messages of this size equals the data_len value from the record preamble.

I certainly could be wrong, but it looks like the wiki should be updated to reflect this.


Originally posted by LeeL on ROS Answers with karma: 11 on 2011-12-10

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

That does look right. Updated wiki: http://wiki.ros.org/Bags/Format/2.0?action=diff&rev1=21&rev2=22


Originally posted by tfoote with karma: 58457 on 2013-09-06

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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