ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

ROS BAG Format - Wiki Spec. Error?

asked 2011-12-10 04:01:06 -0500

LeeL gravatar image

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):

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:
the function readConnectionIndexRecord200 shows the following code:
read((char) &sec, 4);
) &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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-09-06 13:36:24 -0500

tfoote gravatar image
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


Asked: 2011-12-10 04:01:06 -0500

Seen: 739 times

Last updated: Sep 06 '13