[ros-users] [Discourse.ros.org] [Next Generation ROS] ROS BAG V2 Enhancement for Random Access

3TowersInternational ros.discourse at gmail.com
Mon Jun 11 08:38:28 UTC 2018



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|690x348](upload://rcxnhSDYKg496IZAlDBsS2NegoF.jpg)





---
[Visit Topic](https://discourse.ros.org/t/ros-bag-v2-enhancement-for-random-access/5066/1) or reply to this email to respond.




More information about the ros-users mailing list