Skip to main content

API Reference

MCAP libraries are available for C++, Go, Python, Rust, Swift, and TypeScript. All libraries are tested for conformance with the MCAP specification.

Feature Matrix

C++GoPythonRustSwiftTypeScript
Indexed unordered message readingYesYesYesYesNoYes
Timestamp-ordered message readingYesYesYesNoYesYes
Indexed metadata readingYes 1Yes 1YesYesYes 1Yes 1
Indexed attachment readingYes 1Yes 1YesYesYes 1Yes 1
Non-materialized attachment readingYes 2NoNoYesNoNo
Non-indexed readingYesYesYesYesYesYes
CRC validationNoYesNoYesYesYes
ROS1 wrapperNoNoYesNoNoNo
ROS2 wrapperYes 3NoYes 3NoNoNo
Protobuf wrapperNoNoYesNoNoNo
Record writingYesYesYesYesYesYes
Easy chunked writingYesYesYesYesYesYes
Automatic summary writingYes 4Yes 4Yes 4YesYes 4Yes 4
1: These readers don’t have a single call to read an attachment or metadata record by name, but do allow you to read the summary, seek to that location, read a record and parse it.
2: Using the [MCAP Rosbag2 storage plugin](https://github.com/ros-tooling/rosbag2_storage_mcap).
3: The C++ reader interface does not preclude one from backing it with a memory-mapped file. This could be used to implement message and attachment parsing without copying data into memory.
4: All writers currently do not compute a CRC for the DataEnd record.