17 #include "nav2_behavior_tree/plugins/condition/goal_updated_condition.hpp"
19 namespace nav2_behavior_tree
22 GoalUpdatedCondition::GoalUpdatedCondition(
23 const std::string & condition_name,
24 const BT::NodeConfiguration & conf)
25 : BT::ConditionNode(condition_name, conf)
30 if (!BT::isStatusActive(status())) {
31 BT::getInputOrBlackboard(
"goals", goals_);
32 BT::getInputOrBlackboard(
"goal", goal_);
33 return BT::NodeStatus::FAILURE;
36 nav_msgs::msg::Goals current_goals;
37 geometry_msgs::msg::PoseStamped current_goal;
38 BT::getInputOrBlackboard(
"goals", current_goals);
39 BT::getInputOrBlackboard(
"goal", current_goal);
41 if (goal_ != current_goal || goals_ != current_goals) {
43 goals_ = current_goals;
44 return BT::NodeStatus::SUCCESS;
47 return BT::NodeStatus::FAILURE;
52 #include "behaviortree_cpp/bt_factory.h"
53 BT_REGISTER_NODES(factory)
A BT::ConditionNode that returns SUCCESS when goal is updated on the blackboard and FAILURE otherwise...
BT::NodeStatus tick() override
The main override required by a BT action.