15 #ifndef NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__REMOVE_PASSED_GOALS_ACTION_HPP_
16 #define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__REMOVE_PASSED_GOALS_ACTION_HPP_
22 #include "behaviortree_cpp/action_node.h"
23 #include "behaviortree_cpp/json_export.h"
24 #include "nav_msgs/msg/goals.hpp"
25 #include "nav2_behavior_tree/bt_utils.hpp"
26 #include "nav2_behavior_tree/json_utils.hpp"
27 #include "nav2_msgs/msg/waypoint_status.hpp"
28 #include "nav2_util/geometry_utils.hpp"
29 #include "nav2_util/robot_utils.hpp"
30 #include "nav2_ros_common/lifecycle_node.hpp"
31 #include "nav2_ros_common/tf2_factories.hpp"
33 namespace nav2_behavior_tree
51 const std::string & xml_tag_name,
52 const BT::NodeConfiguration & conf);
59 static BT::PortsList providedPorts()
62 BT::RegisterJsonDefinition<nav_msgs::msg::Goals>();
63 BT::RegisterJsonDefinition<nav2_msgs::msg::WaypointStatus>();
64 BT::RegisterJsonDefinition<std::vector<nav2_msgs::msg::WaypointStatus>>();
67 BT::InputPort<nav_msgs::msg::Goals>(
69 "Original goals to remove viapoints from"),
70 BT::OutputPort<nav_msgs::msg::Goals>(
72 "Goals with passed viapoints removed"),
73 BT::InputPort<double>(
"radius", 0.5,
"radius to goal for it to be considered for removal"),
74 BT::InputPort<std::string>(
"robot_base_frame",
"Robot base frame"),
75 BT::InputPort<std::vector<nav2_msgs::msg::WaypointStatus>>(
76 "input_waypoint_statuses",
77 "Original waypoint_statuses to mark waypoint status from"),
78 BT::OutputPort<std::vector<nav2_msgs::msg::WaypointStatus>>(
79 "output_waypoint_statuses",
80 "Waypoint_statuses with passed waypoints marked")
85 void halt()
override {}
86 BT::NodeStatus tick()
override;
88 double viapoint_achieved_radius_;
89 double transform_tolerance_;
90 nav2::LifecycleNode::SharedPtr node_;
91 nav2::TransformBuffer::SharedPtr tf_;
92 std::string robot_base_frame_;
A BT::ActionNodeBase that removes goals that the robot passed near to.
void initialize()
Function to read parameters and initialize class variables.