Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
append_goal_pose_to_goals_action.hpp
1 // Copyright (c) 2025 Open Navigation LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__APPEND_GOAL_POSE_TO_GOALS_ACTION_HPP_
16 #define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__APPEND_GOAL_POSE_TO_GOALS_ACTION_HPP_
17 
18 #include <vector>
19 #include <memory>
20 #include <string>
21 
22 #include "nav_msgs/msg/goals.hpp"
23 #include "nav2_msgs/msg/route.hpp"
24 #include "geometry_msgs/msg/pose_stamped.hpp"
25 #include "nav2_util/geometry_utils.hpp"
26 #include "nav2_util/robot_utils.hpp"
27 #include "behaviortree_cpp/action_node.h"
28 #include "nav2_ros_common/lifecycle_node.hpp"
29 
30 namespace nav2_behavior_tree
31 {
32 
33 class AppendGoalPoseToGoals : public BT::ActionNodeBase
34 {
35 public:
37  const std::string & xml_tag_name,
38  const BT::NodeConfiguration & conf);
39 
40 
41  static BT::PortsList providedPorts()
42  {
43  return {
44  BT::InputPort<geometry_msgs::msg::PoseStamped>("goal_pose", "Goal pose to append"),
45  BT::InputPort<nav_msgs::msg::Goals>("input_goals", "Input goals to append to"),
46  BT::OutputPort<nav_msgs::msg::Goals>("output_goals", "Output goals after appending")
47  };
48  }
49 
50 private:
51  void halt() override {}
52  BT::NodeStatus tick() override;
53 };
54 
55 } // namespace nav2_behavior_tree
56 
57 #endif // NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__APPEND_GOAL_POSE_TO_GOALS_ACTION_HPP_