Shared Rust CDR/IDL decoder for ROS and DDS message data (omgidl, ros2idl, ros2msg, ros1msg).
Project description
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
(manylinux_2_28, x86-64 and aarch64), macOS (Intel and Apple Silicon), and
Windows (x86-64). No Rust toolchain is needed to install.
Quick start
A CdrCodec is built once per channel schema, then reused to decode every
message on that channel.
from mcap_codec import CdrCodec
# 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 = CdrCodec("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/uint8arrays →bytes(matchingmcap_ros2; signedint8arrays staylist[int], sincebytescan't hold negatives). The deprecatedbyte/charaliases follow their dialect: ROS2byte→uint8/char→int8, ROS1 the reverse - scalars → native
bool/int/float; strings →str - enums → integers
- unions →
{"discriminator": <value>, "<active member>": <value>} Time/Duration→{"sec": int, "nanosec": int}- absent
@optionalmembers are omitted from thedict
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 CdrCodec, 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
CdrCodec(...)raisesValueErrorif the schema cannot be parsed.decode(...)/decode_fields(...)raiseValueErroron a genuine decode failure (malformed payload), andUnsupportedMessagefor a message that is intentionally declined (see above).
License
Apache-2.0. Part of the Roboto platform.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file roboto_mcap_codec-0.1.9.tar.gz.
File metadata
- Download URL: roboto_mcap_codec-0.1.9.tar.gz
- Upload date:
- Size: 110.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63c8e306065ddc7b84d900a79e28efaadbffe661a9a137b3fc29454d83eec445
|
|
| MD5 |
f0a76595bb75b08649ace65a6e52d022
|
|
| BLAKE2b-256 |
3daa05e072b8dbd9debb4373911c6ee1ef8db68f29a58856c9eb34887a2d1f9c
|
Provenance
The following attestation bundles were made for roboto_mcap_codec-0.1.9.tar.gz:
Publisher:
wheels.yml on roboto-ai/roboto-mcap-codec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
roboto_mcap_codec-0.1.9.tar.gz -
Subject digest:
63c8e306065ddc7b84d900a79e28efaadbffe661a9a137b3fc29454d83eec445 - Sigstore transparency entry: 1732670536
- Sigstore integration time:
-
Permalink:
roboto-ai/roboto-mcap-codec@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/roboto-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Trigger Event:
push
-
Statement type:
File details
Details for the file roboto_mcap_codec-0.1.9-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: roboto_mcap_codec-0.1.9-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
185a795303e1034bdf13d1e0408210a0063264b3dc1cc090a0f25919c9162347
|
|
| MD5 |
582875bb42fafe22316f52bda132c1aa
|
|
| BLAKE2b-256 |
1b4a845671b5aabe53578c22f048de1d24e776790c83ed166197fb7f688fd6d8
|
Provenance
The following attestation bundles were made for roboto_mcap_codec-0.1.9-cp310-abi3-win_amd64.whl:
Publisher:
wheels.yml on roboto-ai/roboto-mcap-codec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
roboto_mcap_codec-0.1.9-cp310-abi3-win_amd64.whl -
Subject digest:
185a795303e1034bdf13d1e0408210a0063264b3dc1cc090a0f25919c9162347 - Sigstore transparency entry: 1732670733
- Sigstore integration time:
-
Permalink:
roboto-ai/roboto-mcap-codec@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/roboto-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Trigger Event:
push
-
Statement type:
File details
Details for the file roboto_mcap_codec-0.1.9-cp310-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: roboto_mcap_codec-0.1.9-cp310-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3af2e4920f63aa90e2412c53efe8d22814e07da91dcaff9b29f2142bcb72705
|
|
| MD5 |
48186c4667062fb148e7475eb9cd912e
|
|
| BLAKE2b-256 |
deaf8629952b859b028ff934aa1c66528c2a6c6efb49debd3527163e685e2208
|
Provenance
The following attestation bundles were made for roboto_mcap_codec-0.1.9-cp310-abi3-manylinux_2_28_x86_64.whl:
Publisher:
wheels.yml on roboto-ai/roboto-mcap-codec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
roboto_mcap_codec-0.1.9-cp310-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
c3af2e4920f63aa90e2412c53efe8d22814e07da91dcaff9b29f2142bcb72705 - Sigstore transparency entry: 1732670633
- Sigstore integration time:
-
Permalink:
roboto-ai/roboto-mcap-codec@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/roboto-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Trigger Event:
push
-
Statement type:
File details
Details for the file roboto_mcap_codec-0.1.9-cp310-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: roboto_mcap_codec-0.1.9-cp310-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c202b82f08fd6516a75b3105a1ffb0728aa1b3f2fae094326885442d227085e
|
|
| MD5 |
18818639f18b5de0d261e6855e3789a4
|
|
| BLAKE2b-256 |
80b85ae10fa7ed4b0ba683b724801a4ca9e0d063915a17240e05544c3816a87d
|
Provenance
The following attestation bundles were made for roboto_mcap_codec-0.1.9-cp310-abi3-manylinux_2_28_aarch64.whl:
Publisher:
wheels.yml on roboto-ai/roboto-mcap-codec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
roboto_mcap_codec-0.1.9-cp310-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
8c202b82f08fd6516a75b3105a1ffb0728aa1b3f2fae094326885442d227085e - Sigstore transparency entry: 1732670844
- Sigstore integration time:
-
Permalink:
roboto-ai/roboto-mcap-codec@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/roboto-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Trigger Event:
push
-
Statement type:
File details
Details for the file roboto_mcap_codec-0.1.9-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: roboto_mcap_codec-0.1.9-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2e42e454af8c0974c50d15f673733511ce379bfcbe71a1aa91da388b3a202df
|
|
| MD5 |
59a07c3f91ca4ad8437c54080a8b003a
|
|
| BLAKE2b-256 |
677bb2d477895f394fd99e43f8c19dd32ed1a62603b690486fd858fd5c26c215
|
Provenance
The following attestation bundles were made for roboto_mcap_codec-0.1.9-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
wheels.yml on roboto-ai/roboto-mcap-codec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
roboto_mcap_codec-0.1.9-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
d2e42e454af8c0974c50d15f673733511ce379bfcbe71a1aa91da388b3a202df - Sigstore transparency entry: 1732670787
- Sigstore integration time:
-
Permalink:
roboto-ai/roboto-mcap-codec@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/roboto-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Trigger Event:
push
-
Statement type:
File details
Details for the file roboto_mcap_codec-0.1.9-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: roboto_mcap_codec-0.1.9-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f00d724bd740e57b66309e6cf082f6eaf0af55e5d3f1ac62f7433d23242a579
|
|
| MD5 |
912e87eebd7e059b35a48db0776d2bfd
|
|
| BLAKE2b-256 |
ed568b3f8a3067c1496c0027ea97cd787f726638d911b5886c5b0a45e84dc89f
|
Provenance
The following attestation bundles were made for roboto_mcap_codec-0.1.9-cp310-abi3-macosx_10_12_x86_64.whl:
Publisher:
wheels.yml on roboto-ai/roboto-mcap-codec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
roboto_mcap_codec-0.1.9-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
8f00d724bd740e57b66309e6cf082f6eaf0af55e5d3f1ac62f7433d23242a579 - Sigstore transparency entry: 1732670690
- Sigstore integration time:
-
Permalink:
roboto-ai/roboto-mcap-codec@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/roboto-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@8d5e274002538b675434ec4d833f85ab0cc58b03 -
Trigger Event:
push
-
Statement type: