|
| Client (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base, rclcpp::node_interfaces::NodeGraphInterface::SharedPtr node_graph, rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr node_logging, const std::string &action_name, const rcl_action_client_options_t client_options=rcl_action_client_get_default_options()) |
| Construct an action client. More...
|
|
std::shared_future< typename GoalHandle::SharedPtr > | async_send_goal (const Goal &goal, const SendGoalOptions &options=SendGoalOptions()) |
| Send an action goal and asynchronously get the result. More...
|
|
std::shared_future< WrappedResult > | async_get_result (typename GoalHandle::SharedPtr goal_handle, ResultCallback result_callback=nullptr) |
| Asynchronously get the result for an active goal. More...
|
|
std::shared_future< typename CancelResponse::SharedPtr > | async_cancel_goal (typename GoalHandle::SharedPtr goal_handle, CancelCallback cancel_callback=nullptr) |
| Asynchronously request a goal be canceled. More...
|
|
std::shared_future< typename CancelResponse::SharedPtr > | async_cancel_all_goals (CancelCallback cancel_callback=nullptr) |
| Asynchronously request for all goals to be canceled. More...
|
|
std::shared_future< typename CancelResponse::SharedPtr > | async_cancel_goals_before (const rclcpp::Time &stamp, CancelCallback cancel_callback=nullptr) |
| Asynchronously request all goals at or before a specified time be canceled. More...
|
|
virtual | ~Client () |
|
virtual RCLCPP_ACTION_PUBLIC | ~ClientBase () |
|
RCLCPP_ACTION_PUBLIC bool | action_server_is_ready () const |
| Return true if there is an action server that is ready to take goal requests. More...
|
|
template<typename RepT = int64_t, typename RatioT = std::milli> |
bool | wait_for_action_server (std::chrono::duration< RepT, RatioT > timeout=std::chrono::duration< RepT, RatioT >(-1)) |
| Wait for action_server_is_ready() to become true, or until the given timeout is reached. More...
|
|
RCLCPP_ACTION_PUBLIC size_t | get_number_of_ready_subscriptions () override |
|
RCLCPP_ACTION_PUBLIC size_t | get_number_of_ready_timers () override |
|
RCLCPP_ACTION_PUBLIC size_t | get_number_of_ready_clients () override |
|
RCLCPP_ACTION_PUBLIC size_t | get_number_of_ready_services () override |
|
RCLCPP_ACTION_PUBLIC size_t | get_number_of_ready_guard_conditions () override |
|
RCLCPP_ACTION_PUBLIC bool | add_to_wait_set (rcl_wait_set_t *wait_set) override |
|
RCLCPP_ACTION_PUBLIC bool | is_ready (rcl_wait_set_t *wait_set) override |
|
RCLCPP_ACTION_PUBLIC void | execute () override |
|
virtual | ~Waitable ()=default |
|
virtual size_t | get_number_of_ready_events () |
|
bool | exchange_in_use_by_wait_set_state (bool in_use_state) |
|
|
using | ResponseCallback = std::function< void(std::shared_ptr< void > response)> |
|
RCLCPP_ACTION_PUBLIC | ClientBase (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base, rclcpp::node_interfaces::NodeGraphInterface::SharedPtr node_graph, rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr node_logging, const std::string &action_name, const rosidl_action_type_support_t *type_support, const rcl_action_client_options_t &options) |
|
RCLCPP_ACTION_PUBLIC bool | wait_for_action_server_nanoseconds (std::chrono::nanoseconds timeout) |
| Wait for action_server_is_ready() to become true, or until the given timeout is reached. More...
|
|
RCLCPP_ACTION_PUBLIC rclcpp::Logger | get_logger () |
|
virtual RCLCPP_ACTION_PUBLIC GoalUUID | generate_goal_id () |
|
virtual RCLCPP_ACTION_PUBLIC void | send_goal_request (std::shared_ptr< void > request, ResponseCallback callback) |
|
virtual RCLCPP_ACTION_PUBLIC void | send_result_request (std::shared_ptr< void > request, ResponseCallback callback) |
|
virtual RCLCPP_ACTION_PUBLIC void | send_cancel_request (std::shared_ptr< void > request, ResponseCallback callback) |
|
virtual RCLCPP_ACTION_PUBLIC void | handle_goal_response (const rmw_request_id_t &response_header, std::shared_ptr< void > goal_response) |
|
virtual RCLCPP_ACTION_PUBLIC void | handle_result_response (const rmw_request_id_t &response_header, std::shared_ptr< void > result_response) |
|
virtual RCLCPP_ACTION_PUBLIC void | handle_cancel_response (const rmw_request_id_t &response_header, std::shared_ptr< void > cancel_response) |
|
template<typename ActionT>
class rclcpp_action::Client< ActionT >
Action Client.
This class creates an action client.
To create an instance of an action client use rclcpp_action::create_client()
.
Internally, this class is responsible for:
template<typename ActionT >
Send an action goal and asynchronously get the result.
If the goal is accepted by an action server, the returned future is set to a ClientGoalHandle
. If the goal is rejected by an action server, then the future is set to a nullptr
.
The returned goal handle is used to monitor the status of the goal and get the final result. It is valid as long as you hold a reference to the shared pointer or until the rclcpp_action::Client is destroyed at which point the goal status will become UNKNOWN.
- Parameters
-
[in] | goal | The goal request. |
[in] | options | Options for sending the goal request. Contains references to callbacks for the goal response (accepted/rejected), feedback, and the final result. |
- Returns
- A future that completes when the goal has been accepted or rejected. If the goal is rejected, then the result will be a
nullptr
.