15 #ifndef NAV2_BEHAVIOR_TREE__PLUGINS__CONDITION__ARE_ERROR_CODES_PRESENT_CONDITION_HPP_
16 #define NAV2_BEHAVIOR_TREE__PLUGINS__CONDITION__ARE_ERROR_CODES_PRESENT_CONDITION_HPP_
23 #include "nav2_ros_common/lifecycle_node.hpp"
24 #include "behaviortree_cpp/condition_node.h"
26 namespace nav2_behavior_tree
43 const std::string & condition_name,
44 const BT::NodeConfiguration & conf)
45 : BT::ConditionNode(condition_name, conf)
47 std::vector<int> error_codes_to_check_vector;
48 getInput(
"error_codes_to_check", error_codes_to_check_vector);
50 error_codes_to_check_ = std::set<uint16_t>(
51 error_codes_to_check_vector.begin(),
52 error_codes_to_check_vector.end());
59 getInput<uint16_t>(
"error_code", error_code_);
61 if (error_codes_to_check_.find(error_code_) != error_codes_to_check_.end()) {
62 return BT::NodeStatus::SUCCESS;
65 return BT::NodeStatus::FAILURE;
68 static BT::PortsList providedPorts()
72 BT::InputPort<uint16_t>(
"error_code",
"The active error codes"),
73 BT::InputPort<std::vector<int>>(
"error_codes_to_check",
"Error codes to check")
79 std::set<uint16_t> error_codes_to_check_;