Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
concatenate_paths_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__CONCATENATE_PATHS_ACTION_HPP_
16 #define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__CONCATENATE_PATHS_ACTION_HPP_
17 
18 #include <memory>
19 #include <vector>
20 #include <string>
21 
22 #include "nav_msgs/msg/path.hpp"
23 
24 #include "behaviortree_cpp/action_node.h"
25 #include "nav2_ros_common/lifecycle_node.hpp"
26 
27 namespace nav2_behavior_tree
28 {
29 
33 class ConcatenatePaths : public BT::ActionNodeBase
34 {
35 public:
42  const std::string & xml_tag_name,
43  const BT::NodeConfiguration & conf);
44 
49  static BT::PortsList providedPorts()
50  {
51  return {
52  BT::InputPort<nav_msgs::msg::Path>("input_path1", "Input Path 1 to cancatenate"),
53  BT::InputPort<nav_msgs::msg::Path>("input_path2", "Input Path 2 to cancatenate"),
54  BT::OutputPort<nav_msgs::msg::Path>("output_path", "Paths concatenated"),
55  };
56  }
57 
58 private:
62  void halt() override {}
63 
68  BT::NodeStatus tick() override;
69 };
70 
71 } // namespace nav2_behavior_tree
72 
73 #endif // NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__CONCATENATE_PATHS_ACTION_HPP_
A BT::ActionNodeBase to shorten path by some distance.
static BT::PortsList providedPorts()
Creates list of BT ports.
ConcatenatePaths(const std::string &xml_tag_name, const BT::NodeConfiguration &conf)
A nav2_behavior_tree::ConcatenatePaths constructor.