ROS BAG V2 Enhancement for Random Access

I have made rosbag v2 random access by adding a Summary Header (opcode=0) which contains the filepos of the first opcode6 or 7 header.
The Summary Header has constant size, by making all fields mandatory and no data field, just 0 for data Length.
This enabled me to jump immediately to the chunk info headers, and connection headers, then to all the rest.

Other information includes the total number of records for each opcode, the total number of records, the global start time, the global end time, as well as the global min and max numbers of connections, any chunk (chunk info) will have.

The summary header is optional, but its presence can easily be detected because it has a constant size placed at the end of a rosbag file. It may even be in a separate file with additional .summary extension from its original name. The c code is in the picture below.

Summary%20OpCode0

The sample app (still a work in progress) is using datasets from UDACITY.

Rosbag%20Dataset

1 Like