16 #ifndef NAV2_BEHAVIOR_TREE__PLUGINS__DECORATOR__GOAL_UPDATER_NODE_HPP_
17 #define NAV2_BEHAVIOR_TREE__PLUGINS__DECORATOR__GOAL_UPDATER_NODE_HPP_
22 #include "geometry_msgs/msg/pose_stamped.hpp"
24 #include "behaviortree_cpp/decorator_node.h"
26 #include "behaviortree_cpp/json_export.h"
27 #include "nav2_behavior_tree/json_utils.hpp"
28 #include "rclcpp/rclcpp.hpp"
30 namespace nav2_behavior_tree
53 const std::string & xml_tag_name,
54 const BT::NodeConfiguration & conf);
63 BT::RegisterJsonDefinition<geometry_msgs::msg::PoseStamped>();
66 BT::InputPort<geometry_msgs::msg::PoseStamped>(
"input_goal",
"Original Goal"),
67 BT::OutputPort<geometry_msgs::msg::PoseStamped>(
69 "Received Goal by subscription"),
78 BT::NodeStatus tick()
override;
84 void callback_updated_goal(
const geometry_msgs::msg::PoseStamped::SharedPtr msg);
86 rclcpp::Subscription<geometry_msgs::msg::PoseStamped>::SharedPtr goal_sub_;
88 geometry_msgs::msg::PoseStamped last_goal_received_;
90 rclcpp::Node::SharedPtr node_;
91 rclcpp::CallbackGroup::SharedPtr callback_group_;
92 rclcpp::executors::SingleThreadedExecutor callback_group_executor_;
A BT::DecoratorNode that subscribes to a goal topic and updates the current goal on the blackboard.
GoalUpdater(const std::string &xml_tag_name, const BT::NodeConfiguration &conf)
A constructor for nav2_behavior_tree::GoalUpdater.
static BT::PortsList providedPorts()
Creates list of BT ports.