Function rcl_action_goal_handle_init

Function Documentation

rcl_ret_t rcl_action_goal_handle_init(rcl_action_goal_handle_t *goal_handle, const rcl_action_goal_info_t *goal_info, rcl_allocator_t allocator)

Initialize a rcl_action_goal_handle_t.

After calling this function on a rcl_action_goal_handle_t, it can be used to update the goals state with rcl_action_update_goal_state(). It can also be used to query the state of the goal with rcl_action_goal_handle_get_message() and rcl_action_goal_handle_is_active(). Goal information can be accessed with rcl_action_goal_handle_get_message() and rcl_action_goal_handle_get_info().

Goal handles are typically initialized and finalized by action servers. I.e. The allocator should be provided by the action server. Goal handles are created with rcl_action_accept_new_goal() and destroyed with rcl_action_clear_expired_goals() or rcl_action_server_fini().

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • goal_handle[out] preallocated, zero-initialized, goal handle structure to be initialized

  • goal_info[in] information about the goal to be copied to the goal handle

  • allocator[in] a valid allocator used to initialized the goal handle

Returns:

RCL_RET_OK if goal_handle was initialized successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if the allocator is invalid, or

Returns:

RCL_RET_ACTION_GOAL_HANDLE_INVALID if the goal handle is invalid, or

Returns:

RCL_RET_ALREADY_INIT if the goal handle has already been initialized, or

Returns:

RCL_RET_BAD_ALLOC if allocating memory failed