Function rcl_action_take_cancel_response

Function Documentation

rcl_ret_t rcl_action_take_cancel_response(const rcl_action_client_t *action_client, rmw_request_id_t *response_header, void *ros_cancel_response)

Take a cancel response using a rcl_action_client_t.

Todo:

TODO(jacobperron) blocking of take?

Todo:

TODO(jacobperron) pre-, during-, and post-conditions for message ownership?

Todo:

TODO(jacobperron) is this thread-safe?

The caller is responsible for ensuring that the type of ros_cancel_response and the type associate with the client (via the type support) match. Passing a different type produces undefined behavior and cannot be checked by this function and therefore no deliberate error will occur.

The caller is responsible for allocating the ros_cancel_response message with a zero-initialization (the internal array should not be allocated). If a successful response is taken, then ros_cancel_response is populated using the allocator given in the action client options. It is the callers responsibility to deallocate ros_cancel_response using the allocator given in the action client options.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • action_client[in] handle to the client that will take the cancel response

  • response_header[out] pointer to the cancel response header

  • ros_cancel_response[out] a zero-initialized ROS cancel response message where the cancel response is copied.

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_ACTION_CLIENT_INVALID if the action client is invalid, or

Returns:

RCL_RET_BAD_ALLOC if allocating memory failed, or

Returns:

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

Returns:

RCL_RET_ERROR if an unspecified error occurs.