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.EnumThe robotics framework dialect of an MCAP file’s messages.
OTHERcovers 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
McapDialectnamed by an MCAP Schema record’sencoding.ros1msg-> ROS1;ros2msg/ros2idl-> ROS2; every other encoding (includingNone, an unknown string, or a non-ROS well-known encoding) -> OTHER. Literals are taken frommcap.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: