diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/are_error_codes_present_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/are_error_codes_present_condition.hpp index 209958c38d4..67833a383b3 100644 --- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/are_error_codes_present_condition.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/are_error_codes_present_condition.hpp @@ -34,7 +34,12 @@ class AreErrorCodesPresent : public BT::ConditionNode const BT::NodeConfiguration & conf) : BT::ConditionNode(condition_name, conf) { - getInput>("error_codes_to_check", error_codes_to_check_); //NOLINT + std::vector error_codes_to_check_vector; + getInput("error_codes_to_check", error_codes_to_check_vector); //NOLINT + + error_codes_to_check_ = std::set( + error_codes_to_check_vector.begin(), + error_codes_to_check_vector.end()); } AreErrorCodesPresent() = delete; @@ -55,7 +60,7 @@ class AreErrorCodesPresent : public BT::ConditionNode return { BT::InputPort("error_code", "The active error codes"), //NOLINT - BT::InputPort>("error_codes_to_check", "Error codes to check")//NOLINT + BT::InputPort>("error_codes_to_check", "Error codes to check")//NOLINT }; } diff --git a/nav2_behavior_tree/test/plugins/condition/test_are_error_codes_present.cpp b/nav2_behavior_tree/test/plugins/condition/test_are_error_codes_present.cpp index 111cda7d005..aa0372f49b3 100644 --- a/nav2_behavior_tree/test/plugins/condition/test_are_error_codes_present.cpp +++ b/nav2_behavior_tree/test/plugins/condition/test_are_error_codes_present.cpp @@ -28,7 +28,7 @@ class AreErrorCodesPresentFixture : public nav2_behavior_tree::BehaviorTreeTestF void SetUp() { uint16_t error_code = ActionResult::NONE; - std::set error_codes_to_check = {ActionResult::UNKNOWN}; //NOLINT + std::vector error_codes_to_check = {ActionResult::UNKNOWN}; //NOLINT config_->blackboard->set("error_code", error_code); config_->blackboard->set("error_codes_to_check", error_codes_to_check);