roboto.formats.mcap.dialect#

The message dialect of an MCAP file, resolved from its schema encoding.

Two decode decisions depend on which robotics framework wrote a file: the names a ROS time struct’s subfields carry (secs/nsecs for ROS1, sec/nanosec for ROS2) and the signedness of the deprecated byte/char scalar aliases (ROS1 ``byte``=int8/``char``=uint8; ROS2 reverses both).

Module Contents#

class roboto.formats.mcap.dialect.McapDialect(*args, **kwds)#

Bases: enum.Enum

The robotics framework dialect of an MCAP file’s messages.

OTHER covers every non-ROS encoding (JSON, omgidl, protobuf, flatbuffer, self-describing) and any absent or unknown encoding.

OTHER = 'other'#
ROS1 = 'ros1'#
ROS2 = 'ros2'#
roboto.formats.mcap.dialect.dialect_from_schema_encoding(encoding)#

The McapDialect named by an MCAP Schema record’s encoding.

ros1msg -> ROS1; ros2msg/ros2idl -> ROS2; every other encoding (including None, an unknown string, or a non-ROS well-known encoding) -> OTHER. Literals are taken from mcap.well_known.SchemaEncoding.

Examples

>>> dialect_from_schema_encoding("ros1msg")
<McapDialect.ROS1: 'ros1'>
>>> dialect_from_schema_encoding("ros2idl")
<McapDialect.ROS2: 'ros2'>
>>> dialect_from_schema_encoding(None)
<McapDialect.OTHER: 'other'>
Parameters:

encoding (Optional[str])

Return type:

McapDialect