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_);