15#include "auto_apms_behavior_tree_core/node/node_model_type.hpp"
17#include "auto_apms_behavior_tree_core/builder.hpp"
18#include "auto_apms_behavior_tree_core/exceptions.hpp"
19#include "behaviortree_cpp/tree_node.h"
35std::string
SubTree::name() {
return core::TreeDocument::SUBTREE_ELEMENT_NAME; }
41 for (
const auto & [key, val] : remapping) {
42 if (!BT::TreeNode::isBlackboardPointer(val)) {
43 throw exceptions::TreeDocumentError(
44 "When setting the blackboard remapping for a subtree, you must refer to the parent blackboard's entry to remap "
45 "to using curly brackets (Got: '" +
48 ele_ptr_->SetAttribute(key.c_str(), val.c_str());
NodeElement toNodeElement()
Convert to a lower level NodeElement object.
Handle for a single node of a TreeDocument.
NodeElement & setPorts(const PortValues &port_values)
Populate the the node's data ports.
NodeElement(TreeDocument *doc_ptr, XMLElement *ele_ptr)
Protected constructor intended for internal use only.
std::map< std::string, std::string > PortValues
Mapping of port names and its respective value encoded as string.
PortValues getPorts() const
Assemble the values given to each data port implemented by this node.
tinyxml2::XMLElement * ele_ptr_
Pointer to the corresponding XMLElement of the base document.
Subtree behavior tree node model.
SubTree & setBlackboardRemapping(const PortValues &remapping)
Configure which blackboard entries of the subtree node's parent tree should be also available for the...
static BT::NodeType type()
Type of the behavior tree node.
bool get_auto_remap() const
Get automatic blackboard remapping.
std::string getRegistrationName() const override final
Get the type specific name under which all subtree nodes are registered with the behavior tree factor...
SubTree & set_auto_remap(bool val=false)
Set automatic blackboard remapping.
static std::string name()
Static method that provides the hard coded registration name of subtree nodes.
Core API for AutoAPMS's behavior tree implementation.
Models for all available behavior tree nodes.
Useful tooling for incorporating behavior trees for task development.