This tutorial demonstrates how to parse MCAP bag files using indexing to achieve 75x faster performance compared to sequential parsing. It walks through parsing footer records, summary offsets, chunk indexes, and message indexes to efficiently extract specific topic messages from ROS2 bag files. The implementation uses
Table of contents
The PlanStep 1 - Parsing the FooterStep 2 - Parsing Summary OffsetsStep 3 - Summary Schemas and ChannelsStep 4 - Chunk Index ProcessingSteps 5 & 6 - Processing Message Indexes and MessagesCompression DisclaimerPulling it TogetherConclusionSort: