Function rcl_take_response_with_info

Function Documentation

rcl_ret_t rcl_take_response_with_info(const rcl_client_t *client, rmw_service_info_t *request_header, void *ros_response)

Take a ROS response using a client.

It is the job of the caller to ensure that the type of the ros_response parameter and the type associate with the client (via the type support) match. Passing a different type to take_response produces undefined behavior and cannot be checked by this function and therefore no deliberate error will occur. The request_header is an rmw struct for meta-information about the request sent (e.g. the sequence number). The caller must provide a pointer to an allocated struct. This function will populate the struct’s fields. ros_response should point to an already allocated ROS response message struct of the correct type, into which the response from the service will be copied.

Attribute

Adherence

Allocates Memory

Maybe [1]

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

[1] only if required when filling the message, avoided for fixed sizes

Parameters:
  • client[in] handle to the client which will take the response

  • request_header[inout] pointer to the request header

  • ros_response[inout] type-erased pointer to the ROS response message

Returns:

RCL_RET_OK if the response was taken successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_CLIENT_INVALID if the client is invalid, or

Returns:

RCL_RET_CLIENT_TAKE_FAILED if take failed but no error occurred in the middleware, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.