15#include "auto_apms_behavior_tree/build_handler/build_handler.hpp"
17#include "auto_apms_behavior_tree/exceptions.hpp"
23 const std::string & name, rclcpp::Node::SharedPtr ros_node_ptr, NodeLoader::SharedPtr tree_node_loader_ptr)
24:
logger_(ros_node_ptr->get_logger().get_child(name)),
25 ros_node_wptr_(ros_node_ptr),
26 tree_node_loader_ptr(tree_node_loader_ptr)
36 const std::string & ,
const NodeManifest & ,
const std::string & )
43 if (ros_node_wptr_.expired()) {
44 throw std::runtime_error(
"TreeBuildHandler: Weak pointer to rclcpp::Node expired.");
46 return ros_node_wptr_.lock();
NodeLoader::SharedPtr getNodeLoaderPtr() const
Get a shared pointer to the class loader instance used for loading the required behavior tree nodes.
TreeBuildHandler(const std::string &name, rclcpp::Node::SharedPtr ros_node_ptr, NodeLoader::SharedPtr tree_node_loader_ptr)
Constructor allowing to give the build handler a specific name.
virtual bool setBuildRequest(const std::string &build_request, const NodeManifest &node_manifest, const std::string &root_tree_name)
Specify the behavior tree build request encoded in a string.
const rclcpp::Logger logger_
ROS 2 logger initialized with the name of the build handler.
rclcpp::Node::SharedPtr getRosNodePtr() const
Get a shared pointer to the parent rclcpp::Node of this build handler.
Useful tooling for incorporating behavior trees for task development.