Function rcl_action_take_goal_request

Function Documentation

rcl_ret_t rcl_action_take_goal_request(const rcl_action_server_t *action_server, rmw_request_id_t *request_header, void *ros_goal_request)

Take a pending ROS goal using an action server.

Todo:

TODO(jacobperron) blocking of take?

Todo:

TODO(jacobperron) pre-, during-, and post-conditions for message ownership?

Todo:

TODO(jacobperron) is this thread-safe?

The caller is responsible for ensuring that the type of ros_goal_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.

ros_goal_request should point to a preallocated, zero-initialized, ROS goal message. If a goal request is taken successfully, it will be copied into ros_goal_request.

If allocation is required when taking the request, e.g. if space needs to be allocated for a dynamically sized array in the target message, then the allocator given in the action server options is used.

Attribute

Adherence

Allocates Memory

Maybe [1]

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

[1] only if required when filling the request, avoided for fixed sizes

Parameters:
  • action_server[in] handle to the action server that will take the request

  • request_header[out] pointer to the goal request header

  • ros_goal_request[out] a preallocated, zero-initialized, ROS goal request message where the request is copied

Returns:

RCL_RET_OK if the request was taken, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_ACTION_SERVER_INVALID if the action server is invalid, or

Returns:

RCL_RET_BAD_ALLOC if allocating memory failed, or

Returns:

RCL_RET_ACTION_SERVER_TAKE_FAILED if take failed but no error occurred in the middleware, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.