Function rcl_action_process_cancel_request

Function Documentation

rcl_ret_t rcl_action_process_cancel_request(const rcl_action_server_t *action_server, const rcl_action_cancel_request_t *cancel_request, rcl_action_cancel_response_t *cancel_response)

Process a cancel request using an action server.

This is a non-blocking call.

This function will compute a list of goals that a cancelation request is attempting to cancel. It does not change the state of any goal. The following cancel policy applies based on the goal ID and the timestamp contained in the cancel request:

  • If the goal ID is zero and timestamp is zero, cancel all goals.

  • If the goal ID is zero and timestamp is not zero, cancel all goals accepted at or before the timestamp.

  • If the goal ID is not zero and timestamp is zero, cancel the goal with the given ID regardless of the time it was accepted.

  • If the goal ID is not zero and timestamp is not zero, cancel the goal with the given ID and all goals accepted at or before the timestamp.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • action_server[in] handle to the action server that will process the cancel request

  • cancel_request[in] a C-typed ROS cancel request to process

  • cancel_response[out] a zero-initialized cancel response struct where the goal info of goals which should be cancelled are copied

Returns:

RCL_RET_OK if the response was sent successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_ACTION_SERVER_INVALID if the action server is invalid, or

Returns:

RCL_RET_BAD_ALLOC if allocating memory failed, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.