Skip to main content

Module msg

Module msg 

Source
Expand description

CDR serialization and the geometry messages a robot is driven by.

ROS 2 and rmw_zenoh put messages on the wire as CDR, the OMG Common Data Representation. A CDR stream opens with a four-byte encapsulation header naming the byte order, after which each primitive is written in that byte order and aligned to its own size relative to the start of the body. Getting the alignment padding wrong is the classic CDR bug, so the CdrWriter and CdrReader handle it once, and the message types build on them. This slice covers the little-endian encapsulation and the geometry messages used to command motion; more messages and big-endian decoding arrive with the live bridge.

Structsยง

CdrReader
Reads primitives from a little-endian CDR buffer, handling alignment padding.
CdrWriter
Writes primitives as little-endian CDR, handling alignment padding.
Twist
A body velocity command (geometry_msgs/msg/Twist): a linear and an angular Vector3.
Vector3
A three-dimensional vector (geometry_msgs/msg/Vector3): three 64-bit floats.