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

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

tfoote gravatar image
edit flag offensive delete link more

Question Tools

Stats

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

Seen: 778 times

Last updated: Sep 06 '13