Function rcl_action_wait_set_add_action_client

Function Documentation

rcl_ret_t rcl_action_wait_set_add_action_client(rcl_wait_set_t *wait_set, const rcl_action_client_t *action_client, size_t *client_index, size_t *subscription_index)

Add a rcl_action_client_t to a wait set.

This function will add the underlying service clients and subscribers to the wait set.

This function behaves similar to adding subscriptions to the wait set, but will add five entities:

  • Three service clients

  • Two subscriptions

If this function fails for any reason, client_index and subscription_index are not set. It is also possible the provided wait set is left in an inconsistent state (e.g. some of the clients and subscriptions were added to the wait set, but not all).

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • wait_set[inout] struct where action client service client and subscription are to be stored

  • action_client[in] the action client to be added to the wait set

  • client_index[out] the starting index in the wait set’s client container where the action clients underlying service clients were added. Optionally, set to NULL if ignored.

  • subscription_index[out] the starting index in the wait set’s subscription container where the action clients underlying subscriptions were added. Optionally, set to NULL if ignored.

Returns:

RCL_RET_OK if added successfully, or

Returns:

RCL_RET_WAIT_SET_INVALID if the wait set is zero initialized, or

Returns:

RCL_RET_WAIT_SET_FULL if the subscription set is full, or

Returns:

RCL_RET_ACTION_CLIENT_INVALID if the action client is invalid, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.