Function rmw_deserialize

Function Documentation

rmw_ret_t rmw_deserialize(const rmw_serialized_message_t *serialized_message, const rosidl_message_type_support_t *type_support, void *ros_message)

Deserialize a ROS message.

The given rmw_serialized_message_t’s internal byte stream buffer is deserialized into the given ROS message. The serialization format expected in the rmw_serialized_message_t depends on the underlying implementation.

Attribute

Adherence

Allocates Memory

Maybe [1]

Thread-Safe

No

Uses Atomics

Maybe [2]

Lock-Free

Maybe [2]

[1] if the given ROS message contains unbounded fields [2] rmw implementation defined, check the implementation documentation

Pre:

Given serialized message must be a valid non-null instance, such as that returned by rmw_serialize(), matching provided typesupport and ROS message.

Pre:

Given typesupport must be a valid non-null instance, as provided by rosidl APIs.

Pre:

Given ROS message must be a valid non-null instance, initialized by the caller.

Parameters:
  • serialized_message[in] the serialized message holding the byte stream

  • type_support[in] the typesupport for the typed ros message

  • ros_message[out] destination for the deserialized ROS message

Returns:

RMW_RET_OK if successful, or

Returns:

RMW_RET_BAD_ALLOC if memory allocation failed, or

Returns:

RMW_RET_ERROR if an unexpected error occurs.