rcl_action  master
C API providing common functionality for ROS actions.
Functions
wait.h File Reference
#include "rcl_action/action_client.h"
#include "rcl_action/action_server.h"
#include "rcl_action/visibility_control.h"
#include "rcl/wait.h"
Include dependency graph for wait.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

RCL_ACTION_PUBLIC 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. More...
 
RCL_ACTION_PUBLIC rcl_ret_t rcl_action_wait_set_add_action_server (rcl_wait_set_t *wait_set, const rcl_action_server_t *action_server, size_t *service_index)
 Add a rcl_action_server_t to a wait set. More...
 
RCL_ACTION_PUBLIC rcl_ret_t rcl_action_client_wait_set_get_num_entities (const rcl_action_client_t *action_client, size_t *num_subscriptions, size_t *num_guard_conditions, size_t *num_timers, size_t *num_clients, size_t *num_services)
 Get the number of wait set entities associated with a rcl_action_client_t. More...
 
RCL_ACTION_PUBLIC rcl_ret_t rcl_action_server_wait_set_get_num_entities (const rcl_action_server_t *action_server, size_t *num_subscriptions, size_t *num_guard_conditions, size_t *num_timers, size_t *num_clients, size_t *num_services)
 Get the number of wait set entities associated with a rcl_action_server_t. More...
 
RCL_ACTION_PUBLIC rcl_ret_t rcl_action_client_wait_set_get_entities_ready (const rcl_wait_set_t *wait_set, const rcl_action_client_t *action_client, bool *is_feedback_ready, bool *is_status_ready, bool *is_goal_response_ready, bool *is_cancel_response_ready, bool *is_result_response_ready)
 Get the wait set entities that are ready for a rcl_action_client_t. More...
 
RCL_ACTION_PUBLIC rcl_ret_t rcl_action_server_wait_set_get_entities_ready (const rcl_wait_set_t *wait_set, const rcl_action_server_t *action_server, bool *is_goal_request_ready, bool *is_cancel_request_ready, bool *is_result_request_ready, bool *is_goal_expired)
 Get the wait set entities that are ready for a rcl_action_server_t. More...
 

Function Documentation

◆ rcl_action_wait_set_add_action_client()

RCL_ACTION_PUBLIC 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
See also
rcl_wait_set_add_subscription

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
[in,out]wait_setstruct where action client service client and subscription are to be stored
[in]action_clientthe action client to be added to the wait set
[out]client_indexthe starting index in the wait set's client container where the action clients underlying service clients were added. Optionally, set to NULL if ignored.
[out]subscription_indexthe 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
RCL_RET_WAIT_SET_INVALID if the wait set is zero initialized, or
RCL_RET_WAIT_SET_FULL if the subscription set is full, or
RCL_RET_ACTION_CLIENT_INVALID if the action client is invalid, or
RCL_RET_ERROR if an unspecified error occurs.

◆ rcl_action_wait_set_add_action_server()

RCL_ACTION_PUBLIC rcl_ret_t rcl_action_wait_set_add_action_server ( rcl_wait_set_t wait_set,
const rcl_action_server_t action_server,
size_t *  service_index 
)

Add a rcl_action_server_t to a wait set.

This function will add the underlying services to the wait set.

This function behaves similar to adding services to the wait set, but will add three services.

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

Attribute Adherence
Allocates Memory Yes
Thread-Safe No
Uses Atomics No
Lock-Free Yes
Parameters
[in,out]wait_setstruct where action server services are to be stored
[in]action_serverthe action server to be added to the wait set
[out]service_indexthe starting index in the wait set's service container where the action servers underlying services were added. Optionally, set to NULL if ignored.
Returns
RCL_RET_OK if added successfully, or
RCL_RET_WAIT_SET_INVALID if the wait set is zero initialized, or
RCL_RET_WAIT_SET_FULL if the subscription set is full, or
RCL_RET_ACTION_SERVER_INVALID if the action server is invalid, or
RCL_RET_ERROR if an unspecified error occurs.

◆ rcl_action_client_wait_set_get_num_entities()

RCL_ACTION_PUBLIC rcl_ret_t rcl_action_client_wait_set_get_num_entities ( const rcl_action_client_t action_client,
size_t *  num_subscriptions,
size_t *  num_guard_conditions,
size_t *  num_timers,
size_t *  num_clients,
size_t *  num_services 
)

Get the number of wait set entities associated with a rcl_action_client_t.

Returns the number of entities that are added to the wait set if rcl_action_wait_set_add_action_client() is called.


Attribute Adherence
Allocates Memory No
Thread-Safe No
Uses Atomics No
Lock-Free Yes
Parameters
[in]action_clientan action client to query
[out]num_subscriptionsthe number of subscriptions added when the action client is added to the wait set
[out]num_guard_conditionsthe number of guard conditions added when the action client is added to the wait set
[out]num_timersthe number of timers added when the action client is added to the wait set
[out]num_clientsthe number of clients added when the action client is added to the wait set
[out]num_servicesthe number of services added when the action client is added to the wait set
Returns
RCL_RET_OK if call is successful, or
RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
RCL_RET_ACTION_CLIENT_INVALID if the action client is invalid, or
RCL_RET_ERROR if an unspecified error occurs.

◆ rcl_action_server_wait_set_get_num_entities()

RCL_ACTION_PUBLIC rcl_ret_t rcl_action_server_wait_set_get_num_entities ( const rcl_action_server_t action_server,
size_t *  num_subscriptions,
size_t *  num_guard_conditions,
size_t *  num_timers,
size_t *  num_clients,
size_t *  num_services 
)

Get the number of wait set entities associated with a rcl_action_server_t.

Returns the number of entities that are added to the wait set if rcl_action_wait_set_add_action_server() is called.


Attribute Adherence
Allocates Memory No
Thread-Safe No
Uses Atomics No
Lock-Free Yes
Parameters
[in]action_serveran action server to query
[out]num_subscriptionsthe number of subscriptions added when the action server is added to the wait set
[out]num_guard_conditionsthe number of guard conditions added when the action server is added to the wait set
[out]num_timersthe number of timers added when the action server is added to the wait set
[out]num_clientsthe number of clients added when the action server is added to the wait set
[out]num_servicesthe number of services added when the action server is added to the wait set
Returns
RCL_RET_OK if call is successful, or
RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
RCL_RET_ACTION_SERVER_INVALID if the action server is invalid, or
RCL_RET_ERROR if an unspecified error occurs.

◆ rcl_action_client_wait_set_get_entities_ready()

RCL_ACTION_PUBLIC rcl_ret_t rcl_action_client_wait_set_get_entities_ready ( const rcl_wait_set_t wait_set,
const rcl_action_client_t action_client,
bool *  is_feedback_ready,
bool *  is_status_ready,
bool *  is_goal_response_ready,
bool *  is_cancel_response_ready,
bool *  is_result_response_ready 
)

Get the wait set entities that are ready for a rcl_action_client_t.

The caller can use this function to determine the relevant action client functions to call: rcl_action_take_feedback(), rcl_action_take_status(), rcl_action_take_goal_response(), rcl_action_take_cancel_response(), or rcl_action_take_result_response().


Attribute Adherence
Allocates Memory No
Thread-Safe No
Uses Atomics No
Lock-Free Yes
Parameters
[in]action_clientan action client to query
[out]is_feedback_readytrue if there is a feedback message ready to take, false otherwise
[out]is_status_messagetrue if there is a status message ready to take, false otherwise
[out]is_goal_response_readytrue if there is a goal response message ready to take, false otherwise
[out]is_cancel_response_readytrue if there is a cancel response message ready to take, false otherwise
[out]is_result_response_readytrue if there is a result response message ready to take, false otherwise
Returns
RCL_RET_OK if call is successful, or
RCL_RET_WAIT_SET_INVALID if the wait set is invalid, or
RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
RCL_RET_ACTION_CLIENT_INVALID if the action client is invalid, or
RCL_RET_ERROR if an unspecified error occurs.

◆ rcl_action_server_wait_set_get_entities_ready()

RCL_ACTION_PUBLIC rcl_ret_t rcl_action_server_wait_set_get_entities_ready ( const rcl_wait_set_t wait_set,
const rcl_action_server_t action_server,
bool *  is_goal_request_ready,
bool *  is_cancel_request_ready,
bool *  is_result_request_ready,
bool *  is_goal_expired 
)

Get the wait set entities that are ready for a rcl_action_server_t.

The caller can use this function to determine the relevant action server functions to call: rcl_action_take_goal_request(), rcl_action_take_cancel_request(), or rcl_action_take_result_request().


Attribute Adherence
Allocates Memory No
Thread-Safe No
Uses Atomics No
Lock-Free Yes
Parameters
[in]action_serveran action server to query
[out]is_goal_request_readytrue if there is a goal request message ready to take, false otherwise
[out]is_cancel_request_readytrue if there is a cancel request message ready to take, false otherwise
[out]is_result_request_readytrue if there is a result request message ready to take, false otherwise
[out]is_goal_expiredtrue if there is a goal that expired, false otherwise
Returns
RCL_RET_OK if call is successful, or
RCL_RET_WAIT_SET_INVALID if the wait set is invalid, or
RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
RCL_RET_ACTION_CLIENT_INVALID if the action server is invalid, or
RCL_RET_ERROR if an unspecified error occurs.