Function rcl_action_send_goal_request

Function Documentation

rcl_ret_t rcl_action_send_goal_request(const rcl_action_client_t *action_client, const void *ros_goal_request, int64_t *sequence_number)

Send a ROS goal using a rcl_action_client_t.

This is a non-blocking call.

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.

The ROS goal message given by the ros_goal_request void pointer is always owned by the calling code, but should remain constant during execution of this function. i.e. The message cannot change during the rcl_action_send_goal_request() call. Before calling rcl_action_send_goal_request() the message can change but after calling rcl_action_send_goal_request() it depends on RMW implementation behavior. The same ros_goal_request can be passed to multiple calls of this function simultaneously, even if the action clients differ.

This function is thread safe so long as access to both the rcl_action_client_t and the ros_goal_request are synchronized. That means that calling rcl_action_send_goal_request() from multiple threads is allowed, but calling rcl_action_send_goal_request() at the same time as non-thread safe action client functions is not, e.g. calling rcl_action_send_goal_request() and rcl_action_client_fini() concurrently is not allowed.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

Yes [1]

Uses Atomics

No

Lock-Free

Yes

[1] for unique pairs of clients and goals, see above for more

Parameters:
  • action_client[in] handle to the client that will make the goal request

  • ros_goal_request[in] pointer to the ROS goal message

  • sequence_number[out] pointer to the goal request sequence number

Returns:

RCL_RET_OK if the request was sent successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_ACTION_CLIENT_INVALID if the client is invalid, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.