15 #ifndef NAV2_BEHAVIOR_TREE__PLUGINS__DECORATOR__PATH_LONGER_ON_APPROACH_HPP_
16 #define NAV2_BEHAVIOR_TREE__PLUGINS__DECORATOR__PATH_LONGER_ON_APPROACH_HPP_
22 #include "behaviortree_cpp/decorator_node.h"
23 #include "behaviortree_cpp/json_export.h"
24 #include "geometry_msgs/msg/pose_stamped.hpp"
25 #include "nav_msgs/msg/path.hpp"
26 #include "nav2_behavior_tree/bt_utils.hpp"
27 #include "nav2_behavior_tree/json_utils.hpp"
29 namespace nav2_behavior_tree
52 const std::string & name,
53 const BT::NodeConfiguration & conf);
62 BT::RegisterJsonDefinition<nav_msgs::msg::Path>();
65 BT::InputPort<nav_msgs::msg::Path>(
"path",
"Planned Path"),
66 BT::InputPort<double>(
68 "Proximity length (m) for the path to be longer on approach"),
69 BT::InputPort<double>(
71 "Length multiplication factor to check if the path is significantly longer"),
79 BT::NodeStatus
tick()
override;
88 bool isRobotInGoalProximity(
89 nav_msgs::msg::Path & old_path,
100 nav_msgs::msg::Path & new_path,
101 nav_msgs::msg::Path & old_path,
102 double & length_factor);
105 nav_msgs::msg::Path new_path_;
106 nav_msgs::msg::Path old_path_;
107 double prox_len_ = std::numeric_limits<double>::max();
108 double length_factor_ = std::numeric_limits<double>::max();
109 nav2::LifecycleNode::SharedPtr node_;
110 bool first_time_ =
true;
A BT::DecoratorNode that ticks its child every time when the length of the new path is smaller than t...
static BT::PortsList providedPorts()
Creates list of BT ports.
PathLongerOnApproach(const std::string &name, const BT::NodeConfiguration &conf)
A constructor for nav2_behavior_tree::PathLongerOnApproach.
BT::NodeStatus tick() override
The main override required by a BT action.