16 #ifndef NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__GOAL_CHECKER_SELECTOR_NODE_HPP_
17 #define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__GOAL_CHECKER_SELECTOR_NODE_HPP_
23 #include "std_msgs/msg/string.hpp"
25 #include "behaviortree_cpp/action_node.h"
27 #include "nav2_ros_common/lifecycle_node.hpp"
29 namespace nav2_behavior_tree
50 const std::string & xml_tag_name,
51 const BT::NodeConfiguration & conf);
60 BT::InputPort<std::string>(
61 "default_goal_checker",
62 "the default goal_checker to use if there is not any external topic message received."),
64 BT::InputPort<std::string>(
66 "goal_checker_selector",
67 "the input topic name to select the goal_checker"),
69 BT::OutputPort<std::string>(
70 "selected_goal_checker",
71 "Selected goal_checker by subscription")
83 void createROSInterfaces();
88 BT::NodeStatus tick()
override;
95 void callbackGoalCheckerSelect(
const std_msgs::msg::String::SharedPtr msg);
97 nav2::Subscription<std_msgs::msg::String>::SharedPtr goal_checker_selector_sub_;
99 std::string last_selected_goal_checker_;
101 nav2::LifecycleNode::SharedPtr node_;
102 rclcpp::CallbackGroup::SharedPtr callback_group_;
103 rclcpp::executors::SingleThreadedExecutor callback_group_executor_;
105 std::string topic_name_;
106 std::chrono::milliseconds bt_loop_duration_;
The GoalCheckerSelector behavior is used to switch the goal checker of the controller server....
static BT::PortsList providedPorts()
Creates list of BT ports.
GoalCheckerSelector(const std::string &xml_tag_name, const BT::NodeConfiguration &conf)
A constructor for nav2_behavior_tree::GoalCheckerSelector.