15 #ifndef NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__PATH_HANDLER_SELECTOR_NODE_HPP_
16 #define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__PATH_HANDLER_SELECTOR_NODE_HPP_
22 #include "std_msgs/msg/string.hpp"
24 #include "behaviortree_cpp/action_node.h"
26 #include "nav2_ros_common/lifecycle_node.hpp"
28 namespace nav2_behavior_tree
55 const std::string & xml_tag_name,
56 const BT::NodeConfiguration & conf);
65 BT::InputPort<std::string>(
66 "default_path_handler",
67 "the default path_handler to use if there is not any external topic message received."),
69 BT::InputPort<std::string>(
71 "path_handler_selector",
72 "the input topic name to select the path_handler"),
74 BT::OutputPort<std::string>(
75 "selected_path_handler",
76 "Selected path_handler by subscription")
88 void createROSInterfaces();
93 BT::NodeStatus tick()
override;
100 void callbackPathHandlerSelect(
const std_msgs::msg::String::ConstSharedPtr & msg);
102 nav2::Subscription<std_msgs::msg::String>::SharedPtr path_handler_selector_sub_;
104 std::string last_selected_path_handler_;
106 nav2::LifecycleNode::SharedPtr node_;
107 rclcpp::CallbackGroup::SharedPtr callback_group_;
108 rclcpp::executors::SingleThreadedExecutor callback_group_executor_;
110 std::string topic_name_;
111 std::chrono::milliseconds bt_loop_duration_;
The PathHandlerSelector behavior is used to switch the path handler of the controller server....
PathHandlerSelector(const std::string &xml_tag_name, const BT::NodeConfiguration &conf)
A constructor for nav2_behavior_tree::PathHandlerSelector.
static BT::PortsList providedPorts()
Creates list of BT ports.