Skip to content

Commit

Permalink
Fixing subtree issues with blackboard shared resources (3640) (backport
Browse files Browse the repository at this point in the history
ros-navigation#3911) (ros-navigation#3916)

* Fixing subtree issues with blackboard shared resources (3640) (ros-navigation#3911)

* fixing subtree issues

* Update bt_action_server_impl.hpp

(cherry picked from commit 4b4465d)

# Conflicts:
#	nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp

* Update bt_action_server_impl.hpp

---------

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
  • Loading branch information
2 people authored and RBT22 committed Nov 16, 2023
1 parent 7c832e6 commit d84b8f8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ bool BtActionServer<ActionT>::loadBehaviorTree(const std::string & bt_xml_filena
// Create the Behavior Tree from the XML input
try {
tree_ = bt_->createTreeFromText(xml_string, blackboard_);
for (auto & blackboard : tree_.blackboard_stack) {
blackboard->set<rclcpp::Node::SharedPtr>("node", client_node_);
blackboard->set<std::chrono::milliseconds>("server_timeout", default_server_timeout_);
blackboard->set<std::chrono::milliseconds>("bt_loop_duration", bt_loop_duration_);
}
} catch (const std::exception & e) {
RCLCPP_ERROR(logger_, "Exception when loading BT: %s", e.what());
return false;
Expand Down

0 comments on commit d84b8f8

Please sign in to comment.