Skip to main content

roboto-mcap-codec

A fast, shared Rust decoder for ROS and DDS message data, packaged as a Python extension. It parses the schema languages used in MCAP and ROS bags — omgidl, ros2idl, ros2msg, ros1msg — and decodes message payloads across every common CDR framing (plain XCDR1/XCDR2, parameter-list PL_CDR, delimited D_CDR2) and the unaligned ROS1 wire, into plain Python dict / list / scalar values.

It powers message decoding in the Roboto Python SDK, where one Rust implementation serves both ingest-time field statistics and query-time message reads.

Install

pip install roboto-mcap-codec

Prebuilt abi3 wheels are published for CPython 3.10+ on Linux (manylinux2014 / glibc 2.17 and musllinux_1_2 / Alpine, x86-64 and aarch64), macOS (Intel and Apple Silicon), and Windows (x86-64 and ARM64). No Rust toolchain is needed to install.

Quick start

A RosCdrCodec is built once per channel schema, then reused to decode every message on that channel.

from mcap_codec import RosCdrCodec

# schema_encoding: "omgidl" | "ros2idl" | "ros2msg" | "ros1msg"
# schema_data:     the raw schema bytes (e.g. an MCAP Schema record's `data`)
# schema_name:     the fully-scoped root type name
codec = RosCdrCodec("ros2msg", schema_data, "sensor_msgs/msg/Imu")

# payload = the raw message bytes, including the 4-byte CDR encapsulation header
message = codec.decode(payload)        # -> nested dict / list / scalars

Decode only the fields you need (everything else is skipped, not materialized):

partial = codec.decode_fields(
    payload,
    ["angular_velocity.x", "header.stamp.sec"],
)
# -> {"angular_velocity": {"x": ...}, "header": {"stamp": {"sec": ...}}}

Output shape

  • structs → dict; sequences and arrays → list (multi-dimensional arrays → nested lists); octet / uint8 arrays → bytes (matching mcap_ros2; signed int8 arrays stay list[int], since bytes can't hold negatives). The deprecated byte / char aliases follow their dialect: ROS2 byteuint8 / charint8, ROS1 the reverse
  • scalars → native bool / int / float; strings → str
  • enums → integers
  • unions → {"$discriminator": <value>, "<active member>": <value>}
  • Time / Duration{"sec": int, "nsec": int} (ROS2 nanosec normalized to nsec)
  • absent @optional members are omitted from the dict

Undecodable messages

Some fields have no portable CDR encoding and cannot be decoded reliably. When a message cannot be decoded for such a reason, decode() raises UnsupportedMessage (rather than returning a wrong value). Catch it to skip the message and keep reading the rest of the file:

from mcap_codec import RosCdrCodec, UnsupportedMessage

try:
    message = codec.decode(payload)
except UnsupportedMessage:
    message = None   # e.g. an implementation-defined `wstring`, or HASH autoid

This matches how the Roboto SDK and the Foxglove decoders treat the same cases.

Errors

  • RosCdrCodec(...) raises ValueError if the schema cannot be parsed.
  • decode(...) / decode_fields(...) raise ValueError on a genuine decode failure (malformed payload), and UnsupportedMessage for a message that is intentionally declined (see above).

License

Apache-2.0. Part of the Roboto platform.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roboto_mcap_codec-0.1.16.tar.gz (164.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

roboto_mcap_codec-0.1.16-cp310-abi3-win_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10+Windows ARM64

roboto_mcap_codec-0.1.16-cp310-abi3-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.10+Windows x86-64

roboto_mcap_codec-0.1.16-cp310-abi3-musllinux_1_2_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

roboto_mcap_codec-0.1.16-cp310-abi3-musllinux_1_2_aarch64.whl (1.9 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

roboto_mcap_codec-0.1.16-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

roboto_mcap_codec-0.1.16-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

roboto_mcap_codec-0.1.16-cp310-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

roboto_mcap_codec-0.1.16-cp310-abi3-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file roboto_mcap_codec-0.1.16.tar.gz.

File metadata

  • Download URL: roboto_mcap_codec-0.1.16.tar.gz
  • Upload date:
  • Size: 164.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for roboto_mcap_codec-0.1.16.tar.gz
Algorithm Hash digest
SHA256 c6c18fce8b50155f7049193ad550b4fb66ec8b049926d813a7e3997b35ae0956
MD5 2d72d29b52886903206499ee3da63923
BLAKE2b-256 7e3b353d9a8e6a4654d2100fc5c93bfa017ea9b95fc4a667275afaf061edf9aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.16.tar.gz:

Publisher: wheels.yml on roboto-ai/roboto-mcap-codec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file roboto_mcap_codec-0.1.16-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.16-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 6c1cfc6a92e31c83a6808e2cba005c7429fc780e63891c9020d00842a9301303
MD5 97579ad8f82a66870b81ea339f4709dd
BLAKE2b-256 a8113c99363c42867415ae5dc34786eac6e49362e197aa95018069a2607b6bcd

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.16-cp310-abi3-win_arm64.whl:

Publisher: wheels.yml on roboto-ai/roboto-mcap-codec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file roboto_mcap_codec-0.1.16-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.16-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8c37b5a04fab2d89693b9df2e81fc88c0ab3760f57d7b1fbcbed9a3f3abfbd90
MD5 89fb104b69c4694248ce9f62a9dd5ada
BLAKE2b-256 0b47e949c0d7ea4b0de3597f1e26137c189dc8afb7f80d69fb70244eec470d2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.16-cp310-abi3-win_amd64.whl:

Publisher: wheels.yml on roboto-ai/roboto-mcap-codec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file roboto_mcap_codec-0.1.16-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.16-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2e5a3753079ec685cb2231db8d0b4a8881698a49d7005c8fed45185e52bd2b0f
MD5 30a216632c37bcbe9965fcbe9bac4b8a
BLAKE2b-256 d4cdd8ebeaf7cc594e3f1bfb548dbf09b256367ed38e6ff24a34dc8b3d4808b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.16-cp310-abi3-musllinux_1_2_x86_64.whl:

Publisher: wheels.yml on roboto-ai/roboto-mcap-codec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file roboto_mcap_codec-0.1.16-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.16-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 eae7a9fc62b01343aa64306d888b7ea37181e7de1550d8f326e4832ffb7a7fe8
MD5 1b4ef1535ec6c9450e8c42e7e92bdc1a
BLAKE2b-256 0f43a3989bac515002b69e8a448e5787cb08625db7cb1c9690f73e4f4d97075a

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.16-cp310-abi3-musllinux_1_2_aarch64.whl:

Publisher: wheels.yml on roboto-ai/roboto-mcap-codec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file roboto_mcap_codec-0.1.16-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.16-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f4b372a47aa514c8f3db47c51dc7db3ce89f39006efda499c88772aad527c50
MD5 b32113eb37ef14e45e236eb082b79b14
BLAKE2b-256 a97ff51216cbaf7063e8ad31e3886b6a953f6452686b24d48c6893c4d6e9dbef

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.16-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on roboto-ai/roboto-mcap-codec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file roboto_mcap_codec-0.1.16-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.16-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9b724dd15d69c3bfe3692d3478ec23db90f792fa092887fbef76f91fb6b8b4cf
MD5 0f2b664f7076e5e268373e8e22898b70
BLAKE2b-256 28e3bf0c5aebe696031faf02265b3054a1dfa0bab58db5cc07bfa81d2c0f3e77

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.16-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: wheels.yml on roboto-ai/roboto-mcap-codec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file roboto_mcap_codec-0.1.16-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.16-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 97757c1591513afe92392bb8f36af32057f1a96236830e9181be95e333f52565
MD5 7eec0a4d63ccc7b4756a0eb5af02ddfa
BLAKE2b-256 b9e388d73f7ee91b8d9a65b42d36d30937c2e12de92e48c7ddcfc4fd509e82e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.16-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: wheels.yml on roboto-ai/roboto-mcap-codec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file roboto_mcap_codec-0.1.16-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.16-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 afdd611d95850a415ba26432d08532309bd43dc3a3772a1fa43a2de8fb1ea9c9
MD5 73092b16c43371249ae6bcb5ac1ec453
BLAKE2b-256 e50f80b548100c3ab213738c4615a73a85cd3aa70112cd0970eebc509b82e3a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.16-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: wheels.yml on roboto-ai/roboto-mcap-codec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.18

9 files

0.1.17

9 files

This release

0.1.16 This release

9 files

0.1.15

9 files

0.1.13

6 files

0.1.12

6 files

0.1.11

6 files

0.1.10

6 files

0.1.9

6 files

0.1.8

6 files

0.1.6

6 files

0.1.5

6 files

0.1.4

6 files

0.1.3

6 files

0.1.2

6 files

0.1.1

6 files

0.1.0

6 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page