From c4bc05f80f9892d65308c45b487a52438b82de6f Mon Sep 17 00:00:00 2001 From: turtlewizard73 Date: Mon, 5 Aug 2024 10:26:49 +0200 Subject: [PATCH] add #3306 --- .../include/nav2_behavior_tree/bt_action_server_impl.hpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 92526a7206..54358e305b 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 @@ -214,13 +214,9 @@ bool BtActionServer::loadBehaviorTree(const std::string & bt_xml_filena return false; } - auto xml_string = std::string( - std::istreambuf_iterator(xml_file), - std::istreambuf_iterator()); - // Create the Behavior Tree from the XML input try { - tree_ = bt_->createTreeFromText(xml_string, blackboard_); + tree_ = bt_->createTreeFromFile(filename, blackboard_); for (auto & blackboard : tree_.blackboard_stack) { blackboard->set("node", client_node_); blackboard->set("server_timeout", default_server_timeout_);