Skip to main content
Definition: autonomy/communication/utils/osi_to_dds_converter.h (line 17)

Functions

Function CreateDdsMessageFromOsiProto

Converts an OSI proto message to a DDS GenericBytesMessage. parameterlist {"type":"element","name":"parameterlist","attributes":{"kind":"templateparam"},"children":[{"type":"element","name":"parameteritem","attributes":{},"children":[{"type":"text","text":"\n"},{"type":"element","name":"parameternamelist","attributes":{},"children":[{"type":"text","text":"\n"},{"type":"element","name":"parametername","attributes":{},"children":[{"type":"text","text":"OsiProtoType"}]},{"type":"text","text":"\n"}]},{"type":"text","text":"\n"},{"type":"element","name":"parameterdescription","attributes":{},"children":[{"type":"text","text":"\n"},{"type":"element","name":"para","attributes":{},"children":[{"type":"text","text":"The OSI proto message type (e.g., osi3::SensorView, osi3::SensorData, osi3::TrafficUpdate) "}]},{"type":"text","text":"\n"}]},{"type":"text","text":"\n"}]},{"type":"text","text":"\n"}]} Parameters:
  • frame_counter: The frame counter for the message
  • header_name: The header name to use for the DDS message (e.g., “SensorView”, “SensorData”, “TrafficUpdate”, “MotionRequest”)
  • osi_proto_msg: The OSI proto message to convert
Returns: A GenericBytesMessage containing the serialized OSI proto message ?> The OsiProtoType must have:
  • timestamp() method returning an object with seconds() and nanos() methods
  • ByteSizeLong() method
  • SerializeToArray() method
?> Supported OSI message types include: SensorView, SensorData, TrafficUpdate, MotionRequest Parameters: Return type: rtidds::GenericBytesMessage

Function ParseOsiProtoFromDdsMessage

Converts a DDS GenericBytesMessage back to an OSI proto message. parameterlist {"type":"element","name":"parameterlist","attributes":{"kind":"templateparam"},"children":[{"type":"element","name":"parameteritem","attributes":{},"children":[{"type":"text","text":"\n"},{"type":"element","name":"parameternamelist","attributes":{},"children":[{"type":"text","text":"\n"},{"type":"element","name":"parametername","attributes":{},"children":[{"type":"text","text":"OsiProtoType"}]},{"type":"text","text":"\n"}]},{"type":"text","text":"\n"},{"type":"element","name":"parameterdescription","attributes":{},"children":[{"type":"text","text":"\n"},{"type":"element","name":"para","attributes":{},"children":[{"type":"text","text":"The OSI proto message type (e.g., osi3::SensorView, osi3::SensorData, osi3::TrafficUpdate) "}]},{"type":"text","text":"\n"}]},{"type":"text","text":"\n"}]},{"type":"text","text":"\n"}]} Parameters:
  • dds_msg: The DDS GenericBytesMessage to convert
  • osi_proto_msg: Reference to the OSI proto message to populate
Exceptions:
  • std::runtime_error: If parsing fails
?> The OsiProtoType must have:
  • ParseFromArray() method
?> Supported OSI message types include: SensorView, SensorData, TrafficUpdate Parameters: Return type: void

Function ConvertAutonomyMsgToGenericBytes

Convert an Autonomy message to a DDS GenericBytesMessage. Parameters:
  • frame_counter: Frame counter to store in the DDS header.
  • header_name: Header name for the DDS message.
  • msg: The AutonomyMsg message to serialize into the GenericBytesMessage.
Returns: A rtidds::GenericBytesMessage containing the serialized autonomy message. Exceptions:
  • std::runtime_error: If serialization fails (e.g., buffer overflow).
Parameters: Return type: rtidds::GenericBytesMessage

Function ConvertGenericBytesToAutonomyMsg

Parse an Autonomy message from a DDS GenericBytesMessage. Parameters:
  • dds_msg: The DDS GenericBytesMessage containing serialized bytes.
  • msg: Reference to the message object to populate.
Exceptions:
  • std::runtime_error: If parsing fails (e.g., buffer underflow or malformed data).
Parameters: Return type: void