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.17.tar.gz (166.2 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.17-cp310-abi3-win_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10+Windows ARM64

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

Uploaded CPython 3.10+Windows x86-64

roboto_mcap_codec-0.1.17-cp310-abi3-musllinux_1_2_x86_64.whl (2.0 MB view details)

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

roboto_mcap_codec-0.1.17-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.17-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.17-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.17-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.17-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.17.tar.gz.

File metadata

  • Download URL: roboto_mcap_codec-0.1.17.tar.gz
  • Upload date:
  • Size: 166.2 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.17.tar.gz
Algorithm Hash digest
SHA256 69b4584d0019dca1c69f1b61f5dff8d871d8f19b7103ab81c7b7b67e2ae0f47e
MD5 f773277817f62aa2197857ec1a6b90d3
BLAKE2b-256 7891c52c60d869dd1688fb384f99afcf40ccaf0730f84749bb652fbac470910d

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.17.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.17-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.17-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 9fc96466df695484166e46f2057b7971808e00eb5bad3d1c11868e9e65a7fd7b
MD5 8c0bc065889a670e5a071adbfa73927a
BLAKE2b-256 7b926b30f040dd6754e9de7d913a6fe1f0d7e5921ca24bd360c0d7f8d830c58d

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.17-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.17-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.17-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 113a6f0d8c389f75158340525fc0893872dbc461241f6e97cba0c1681f78a451
MD5 6db80281dec24b101d38b85305bf41a3
BLAKE2b-256 b836ad341217c5b3c10153eb3e5c707fe94c7a62314fd661a785269cd332a44b

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.17-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.17-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.17-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8c41b4b0db70c39a21c94029b2997c36f7dfc73641b92626b7bc24571ceee594
MD5 c770da843caf539250ef275363225144
BLAKE2b-256 7c11ff180a1d2d8f410fb95253a2392969a5bf3409dc7e53516208f218d45de0

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.17-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.17-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.17-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 b976da08048d2686d7e190ad5bf16150113cc03c68471b77d2dc353521fb891d
MD5 1057fe5e3382c298c2dd0241eb9bd83c
BLAKE2b-256 72972ea230239d96a05af546073624f762c78550c95149b33aae493c4a6229a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.17-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.17-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.17-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4043d29d46512abc1540e38f2a91d7cb1d81ce19448b33bf87a7fbbaf214151c
MD5 be14efe0e3a6815bc3a475a2ff0c6ec1
BLAKE2b-256 d0189f3a9b31717bea80ba0b5c1272f73bcaa971c0497f159825ea56e7d01a34

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.17-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.17-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.17-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f5d3dd977555793450853e4860b65ff93cfee6c5980de29323f00a8c0d1f62ff
MD5 4f83d85112fc9ee4b0e7e976c3f4e1d3
BLAKE2b-256 8a9786d3e2e150cf8a4ae24703f903773d73cbb958d63fba753efdb8aa723a70

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.17-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.17-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.17-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8a3cfae127a813f9144c6c28f0be17b45be6a803dd42565e49a867e92f0b818c
MD5 50c2dc730b5fdaab84d697935a81cadd
BLAKE2b-256 36a6ff73b2b5ea226decf82a8a763d6df024f53dfc220ba919dabf65bc8074e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.17-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.17-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for roboto_mcap_codec-0.1.17-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 57f340c123bf077ae1d0b7be4f615002df3c99b5e02ce8e0d8cf6e01741bdae8
MD5 9d18bad3fd7e2fb11c61f4f775c4ea77
BLAKE2b-256 156f48e478fc7f0b92e76be8e777dfca5db41587c3645d6eeabad294021614d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for roboto_mcap_codec-0.1.17-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

This release

0.1.17 This release

9 files

0.1.16

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