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 std::string & entry_point,
38 const NodeManifest & node_manifest)
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 (entry_point.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 entry_point argument.");
61 }
catch (
const std::exception & e) {
62 RCLCPP_WARN(
logger_,
"Cannot determine root tree from entry point: %s", e.what());
65 if (!working_doc_.hasTreeName(entry_point_.root_tree_name)) {
67 logger_,
"The specified entry point root tree '%s' does not exist in the provided tree XML.",
68 entry_point_.root_tree_name.c_str());
71 working_doc_.setRootTreeName(entry_point_.root_tree_name);
86 for (
const auto & [key, value] : entry_point_.inital_blackboard) {
Decoded entry point information for low-level tree building.