From dc7b98efcfa043e94cac29f55f502788df2bf80e Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:40:34 -0700 Subject: [PATCH] Fixing subtree issues with blackboard shared resources (3640) (#3911) (#3915) * fixing subtree issues * Update bt_action_server_impl.hpp (cherry picked from commit 4b4465dfc9427b95e98aef70620bedd933cfbe56) Co-authored-by: Steve Macenski --- .../include/nav2_behavior_tree/bt_action_server_impl.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp index 3e2ee0aee8e..026fdb4cbc8 100644 --- a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp @@ -231,6 +231,11 @@ bool BtActionServer::loadBehaviorTree(const std::string & bt_xml_filena // Create the Behavior Tree from the XML input try { tree_ = bt_->createTreeFromFile(filename, blackboard_); + for (auto & blackboard : tree_.blackboard_stack) { + blackboard->set("node", client_node_); + blackboard->set("server_timeout", default_server_timeout_); + blackboard->set("bt_loop_duration", bt_loop_duration_); + } } catch (const std::exception & e) { RCLCPP_ERROR(logger_, "Exception when loading BT: %s", e.what()); return false;