diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/bt_utils.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_utils.hpp index 29da24fb0d2..7e8ea23ec73 100644 --- a/nav2_behavior_tree/include/nav2_behavior_tree/bt_utils.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_utils.hpp @@ -181,19 +181,19 @@ T1 deconflictPortAndParamFrame( * @return */ template inline -BT::Result getInputPortOrBlackboard( +bool getInputPortOrBlackboard( const BT::TreeNode & bt_node, const BT::Blackboard & blackboard, const std::string & param_name, T & value) { - if (auto res = bt_node.getInput(param_name, value)) { - return res; + if (bt_node.getInput(param_name, value)) { + return true; } - if (auto res = blackboard.get(param_name, value)) { - return {}; + if (blackboard.get(param_name, value)) { + return true; } - return nonstd::make_unexpected(StrCat(param_name, " not found")); + return false; } // Macro to remove boiler plate when using getInputPortOrBlackboard