From 46abb2c20308e0cf956614a53e7742269bbd3b48 Mon Sep 17 00:00:00 2001 From: Davide Faconti Date: Mon, 5 Feb 2024 08:37:59 +0100 Subject: [PATCH] change return value of getInputPortOrBlackboard --- .../include/nav2_behavior_tree/bt_utils.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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