Skip to content

Commit

Permalink
change return value of getInputPortOrBlackboard
Browse files Browse the repository at this point in the history
  • Loading branch information
facontidavide committed Feb 5, 2024
1 parent 7e293d6 commit 46abb2c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nav2_behavior_tree/include/nav2_behavior_tree/bt_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,19 @@ T1 deconflictPortAndParamFrame(
* @return <T>
*/
template<typename T> 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<T>(param_name, value)) {
return res;
if (bt_node.getInput<T>(param_name, value)) {
return true;
}
if (auto res = blackboard.get<T>(param_name, value)) {
return {};
if (blackboard.get<T>(param_name, value)) {
return true;
}
return nonstd::make_unexpected(StrCat(param_name, " not found"));
return false;
}

// Macro to remove boiler plate when using getInputPortOrBlackboard
Expand Down

0 comments on commit 46abb2c

Please sign in to comment.