16 #ifndef NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__PLANNER_SELECTOR_NODE_HPP_
17 #define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__PLANNER_SELECTOR_NODE_HPP_
22 #include "std_msgs/msg/string.hpp"
24 #include "behaviortree_cpp/action_node.h"
26 #include "rclcpp/rclcpp.hpp"
28 namespace nav2_behavior_tree
54 const std::string & xml_tag_name,
55 const BT::NodeConfiguration & conf);
64 BT::InputPort<std::string>(
66 "the default planner to use if there is not any external topic message received."),
68 BT::InputPort<std::string>(
71 "the input topic name to select the planner"),
73 BT::OutputPort<std::string>(
75 "Selected planner by subscription")
83 BT::NodeStatus tick()
override;
90 void callbackPlannerSelect(
const std_msgs::msg::String::SharedPtr msg);
93 rclcpp::Subscription<std_msgs::msg::String>::SharedPtr planner_selector_sub_;
95 std::string last_selected_planner_;
97 rclcpp::Node::SharedPtr node_;
98 rclcpp::CallbackGroup::SharedPtr callback_group_;
99 rclcpp::executors::SingleThreadedExecutor callback_group_executor_;
101 std::string topic_name_;
The PlannerSelector behavior is used to switch the planner that will be used by the planner server....
PlannerSelector(const std::string &xml_tag_name, const BT::NodeConfiguration &conf)
A constructor for nav2_behavior_tree::PlannerSelector.
static BT::PortsList providedPorts()
Creates list of BT ports.