McapMessage

āš ļø This type is unstable and may change significantly in a way that the data won't be backwards compatible. The binary payload of a single MCAP message, without metadata.

This archetype represents only the raw message data from an MCAP file. It does not include MCAP message metadata such as timestamps, channel IDs, sequence numbers, or publication times. The binary payload represents sensor data, commands, or other information encoded according to the format specified by the associated channel.

See archetypes.McapChannel for channel definitions that specify message encoding, archetypes.McapSchema for data structure definitions, and the MCAP specification for complete format details.

Fields fields

Required required

Can be shown in can-be-shown-in

Example example

Simple MCAP message simple-mcap-message

"""Log a simple MCAP message with binary data."""

import rerun as rr

rr.init("rerun_example_mcap_message", spawn=True)

# Example binary message data (could be from a ROS message, protobuf, etc.)
# This represents a simple sensor reading encoded as bytes
sensor_data = b"sensor_reading: temperature=23.5, humidity=65.2, timestamp=1743465600"

rr.log(
    "mcap/messages/sensor_reading",
    rr.McapMessage(
        data=sensor_data,
    ),
)