Skip to main content

Module format

Module format 

Source
Expand description

Serialization format identity (RFC-0088, phase-421 W1).

ROS 2 names its serialization format with a string because rosidl_typesupport_c resolves the format’s implementation through dlopen — “if the identifier is the same as this handle’s typesupport_identifier, then the handle is simply returned, otherwise it’s loaded from a shared library”. The string is a dynamic-linker key.

nano-ros links one image, so the key can be a type. A message declares its format, a backend declares its format, and the two are compared at compile time. Nothing is resolved, dispatched or compared at run time on the publish path.

§The discriminant is image-local; the string is not

SerializationFormatId is a u8 assigned within one image. nano-ros cannot allocate a globally unique discriminant to a third-party format, so the value is meaningful only inside the build that produced it. The NAME string is the identity that crosses image boundaries — the bridge config, tooling output, and the get_serialization_format vtable slot all carry the string, never the number.

Treating the discriminant as global is the one mistake this module exists to prevent: two independently built images would disagree about what 3 means, which is a wire-visible bug with a compile-time-looking cause.

Structs§

Cdr
ROS 2’s wire encoding, and nano-ros’s default.
Uorb
PX4 uORB: the payload is the struct, so there is no encoding step.

Enums§

SerializationFormatId
Image-local discriminant for a serialization format.

Traits§

SerializationFormat
A serialization format, as a type.