30 TreeFromStringBuildHandler(rclcpp::Node::SharedPtr ros_node_ptr, NodeLoader::SharedPtr tree_node_loader_ptr)
32 working_doc_(TreeDocument::BTCPP_FORMAT_DEFAULT_VERSION, tree_node_loader_ptr)
37 const std::string & build_request,
const NodeManifest & node_manifest,
38 const std::string & root_tree_name)
override final
41 working_doc_.reset().mergeString(build_request,
true);
42 working_doc_.registerNodes(node_manifest,
false);
44 if (
const BT::Result res = working_doc_.verify(); !res) {
45 RCLCPP_WARN(
logger_,
"Tree verification failed: %s", res.error().c_str());
50 if (root_tree_name.empty()) {
51 if (!working_doc_.hasRootTreeName()) {
54 "Cannot determine root tree: You must either encode the root tree within the tree XML or provide a non-empty "
55 "name using the root_tree_name argument.");
60 working_doc_.setRootTreeName(root_tree_name);
61 }
catch (
const exceptions::TreeDocumentError & e) {
62 RCLCPP_WARN(
logger_,
"Cannot determine root tree: %s", e.what());