From 75c9cfca0c839255e7899ed3bd7a3c1be2444c86 Mon Sep 17 00:00:00 2001 From: Alan Xue Date: Sun, 25 Aug 2024 14:01:45 +0000 Subject: [PATCH] fix(bt_nodes): Correct default `server_timeout` behavior by using `getInputPortOrBlackboard()` Signed-off-by: Alan Xue --- .../include/nav2_behavior_tree/bt_action_node.hpp | 4 +--- .../include/nav2_behavior_tree/bt_cancel_action_node.hpp | 4 +--- .../include/nav2_behavior_tree/bt_service_node.hpp | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp index 7276ef79ad..4e723f1ac5 100644 --- a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp @@ -58,9 +58,7 @@ class BtActionNode : public BT::ActionNodeBase // Get the required items from the blackboard auto bt_loop_duration = config().blackboard->template get("bt_loop_duration"); - server_timeout_ = - config().blackboard->template get("server_timeout"); - getInput("server_timeout", server_timeout_); + getInputOrBlackboard("server_timeout", server_timeout_); wait_for_service_timeout_ = config().blackboard->template get("wait_for_service_timeout"); diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/bt_cancel_action_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_cancel_action_node.hpp index b6458d881a..d63dc1e104 100644 --- a/nav2_behavior_tree/include/nav2_behavior_tree/bt_cancel_action_node.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_cancel_action_node.hpp @@ -56,9 +56,7 @@ class BtCancelActionNode : public BT::ActionNodeBase callback_group_executor_.add_callback_group(callback_group_, node_->get_node_base_interface()); // Get the required items from the blackboard - server_timeout_ = - config().blackboard->template get("server_timeout"); - getInput("server_timeout", server_timeout_); + getInputOrBlackboard("server_timeout", server_timeout_); wait_for_service_timeout_ = config().blackboard->template get("wait_for_service_timeout"); diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/bt_service_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_service_node.hpp index 6608eee67a..746ef61049 100644 --- a/nav2_behavior_tree/include/nav2_behavior_tree/bt_service_node.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_service_node.hpp @@ -59,9 +59,7 @@ class BtServiceNode : public BT::ActionNodeBase // Get the required items from the blackboard auto bt_loop_duration = config().blackboard->template get("bt_loop_duration"); - server_timeout_ = - config().blackboard->template get("server_timeout"); - getInput("server_timeout", server_timeout_); + getInputOrBlackboard("server_timeout", server_timeout_); wait_for_service_timeout_ = config().blackboard->template get("wait_for_service_timeout");