Function rcl_action_send_cancel_request

Function Documentation

rcl_ret_t rcl_action_send_cancel_request(const rcl_action_client_t *action_client, const void *ros_cancel_request, int64_t *sequence_number)

Send a cancel request for a goal using a rcl_action_client_t.

This is a non-blocking call.

The caller is responsible for ensuring that the type of ros_cancel_request 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 following cancel policy applies based on the goal ID and the timestamp provided by the ros_cancel_request message:

  • 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

No

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • action_client[in] handle to the client that will make the cancel request

  • ros_cancel_request[in] pointer the ROS cancel request message

  • sequence_number[out] pointer to the cancel request sequence number

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_ERROR if an unspecified error occurs.