Function rcl_action_server_get_goal_handles

Function Documentation

rcl_ret_t rcl_action_server_get_goal_handles(const rcl_action_server_t *action_server, rcl_action_goal_handle_t ***goal_handles, size_t *num_goals)

Get the goal handles for all goals an action server is tracking.

A pointer to the internally held array of pointers to goal handle structs is returned along with the number of items in the array.

The returned handle is made invalid if the action server is finalized, if rcl_shutdown() is called, or if rcl_action_expire_goals() is called and one or more goals are expired. The returned handle is not guaranteed to be valid for the life time of the action server as it may be finalized and recreated itself. Therefore, it is recommended to get the handle from the action server using this function each time it is needed and avoid use of the handle concurrently with functions that might change it.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • action_server[in] handle to the action server

  • goal_handles[out] is set to the array of pointers to goal handles if successful.

  • num_goals[out] is set to the number of goals in the returned array if successful, not set otherwise.

Returns:

RCL_RET_OK if successful, or

Returns:

RCL_RET_ACTION_SERVER_INVALID if the action server is invalid, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.