39 #include <moveit_msgs/action/hybrid_planner.hpp>
40 #include <rclcpp/executors.hpp>
41 #include <rclcpp/logging.hpp>
42 #include <rclcpp/node.hpp>
43 #include <rclcpp/node_options.hpp>
44 #include <rclcpp/utilities.hpp>
45 #include <rclcpp_action/client.hpp>
46 #include <rclcpp_action/create_client.hpp>
50 using HPAction = moveit_msgs::action::HybridPlanner;
53 int main(
int argc,
char** argv)
55 rclcpp::init(argc, argv);
56 rclcpp::NodeOptions node_options;
57 auto node = rclcpp::Node::make_shared(
"action_server_cancellation",
"", node_options);
59 rclcpp_action::Client<HPAction>::SharedPtr client_ptr =
60 rclcpp_action::create_client<HPAction>(node,
"/test/hybrid_planning/run_hybrid_planning");
61 if (!client_ptr->wait_for_action_server(std::chrono::seconds(5)))
63 RCLCPP_ERROR(node->get_logger(),
"Action server not available after waiting");
66 client_ptr->async_cancel_all_goals();
67 RCLCPP_ERROR(node->get_logger(),
"Cancellation was requested.");
int main(int argc, char **argv)