Function rcl_action_send_goal_response
Defined in File action_server.h
Function Documentation
-
rcl_ret_t rcl_action_send_goal_response(const rcl_action_server_t *action_server, rmw_request_id_t *response_header, void *ros_goal_response)
Send a response for a goal request to an action client using an action server.
This is a non-blocking call.
The caller is responsible for ensuring that the type of
ros_goal_response
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.If the caller intends to send an ‘accepted’ response, before calling this function the caller should use rcl_action_accept_new_goal() to get a rcl_action_goal_handle_t for future interaction with the goal (e.g. publishing feedback and canceling the goal).
This function is thread safe so long as access to both the action server and the
ros_goal_response
are synchronized. That means that calling rcl_action_send_goal_response() from multiple threads is allowed, but calling rcl_action_send_goal_response() at the same time as non-thread safe action server functions is not, e.g. calling rcl_action_send_goal_response() and rcl_action_server_fini() concurrently is not allowed. Before calling rcl_action_send_goal_response() theros_goal_request
can change and after calling rcl_action_send_goal_response() theros_goal_request
can change, but it cannot be changed during the rcl_action_send_goal_response() call.Attribute
Adherence
Allocates Memory
No
Thread-Safe
Yes [1]
Uses Atomics
No
Lock-Free
Yes
- Parameters:
action_server – [in] handle to the action server that will make the goal response
response_header – [in] pointer to the goal response header
ros_goal_response – [in] a ROS goal response message to send
- Returns:
RCL_RET_OK
if the response was sent successfully, 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_TIMEOUT
if a goal response reader is not ready yet, or- Returns:
RCL_RET_ERROR
if an unspecified error occurs.