Nav2 Navigation Stack - humble  humble
ROS 2 Navigation Stack
globally_updated_goal_condition.hpp
1 // Copyright (c) 2021 Joshua Wallace
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__CONDITION__GLOBALLY_UPDATED_GOAL_CONDITION_HPP_
16 #define NAV2_BEHAVIOR_TREE__PLUGINS__CONDITION__GLOBALLY_UPDATED_GOAL_CONDITION_HPP_
17 
18 #include <string>
19 #include <vector>
20 
21 #include "rclcpp/rclcpp.hpp"
22 
23 #include "behaviortree_cpp_v3/condition_node.h"
24 #include "geometry_msgs/msg/pose_stamped.hpp"
25 
26 
27 namespace nav2_behavior_tree
28 {
33 class GloballyUpdatedGoalCondition : public BT::ConditionNode
34 {
35 public:
42  const std::string & condition_name,
43  const BT::NodeConfiguration & conf);
44 
46 
51  BT::NodeStatus tick() override;
52 
53 
58  static BT::PortsList providedPorts()
59  {
60  return {};
61  }
62 
63 private:
64  bool first_time;
65  rclcpp::Node::SharedPtr node_;
66  geometry_msgs::msg::PoseStamped goal_;
67  std::vector<geometry_msgs::msg::PoseStamped> goals_;
68 };
69 
70 } // namespace nav2_behavior_tree
71 
72 
73 #endif // NAV2_BEHAVIOR_TREE__PLUGINS__CONDITION__GLOBALLY_UPDATED_GOAL_CONDITION_HPP_
A BT::ConditionNode that returns SUCCESS when goal is updated on the blackboard and FAILURE otherwise...
static BT::PortsList providedPorts()
Creates list of BT ports.
BT::NodeStatus tick() override
The main override required by a BT action.