19#include "auto_apms_behavior_tree_core/node/node_registration_options.hpp"
20#include "auto_apms_behavior_tree_core/tree/tree_document.hpp"
21#include "behaviortree_cpp/basic_types.h"
25#define AUTO_APMS_BEHAVIOR_TREE_CORE_DEFINE_NON_LEAF_THISREF_METHODS(ClassType) \
26 ClassType & removeFirstChild(const std::string & registration_name = "", const std::string & instance_name = "") \
28 NodeElement::removeFirstChild(registration_name, instance_name); \
32 typename std::enable_if_t<std::is_base_of_v<NodeModelType, T>, ClassType &> removeFirstChild( \
33 const std::string & instance_name = "") \
35 NodeElement::removeFirstChild<T>(instance_name); \
38 ClassType & removeChildren() \
40 NodeElement::removeChildren(); \
44#define AUTO_APMS_BEHAVIOR_TREE_CORE_DEFINE_LEAF_THISREF_METHODS(ClassType) \
45 ClassType & setPorts(const auto_apms_behavior_tree::core::TreeDocument::NodeElement::PortValues & port_values) \
47 NodeElement::setPorts(port_values); \
50 ClassType & resetPorts() \
52 NodeElement::resetPorts(); \
55 ClassType & setConditionalScript(BT::PreCond type, const auto_apms_behavior_tree::core::Script & script) \
57 NodeElement::setConditionalScript(type, script); \
60 ClassType & setConditionalScript(BT::PostCond type, const auto_apms_behavior_tree::core::Script & script) \
62 NodeElement::setConditionalScript(type, script); \
65 ClassType & setName(const std::string & instance_name) \
67 NodeElement::setName(instance_name); \
87 using NodeElement::NodeElement;
91 using PortInfos = std::map<std::string, BT::PortInfo>;
93 virtual std::string getRegistrationName()
const override = 0;
109 using NodeModelType::NodeModelType;
166 using LeafNodeModelType::LeafNodeModelType;
170 static std::string
name();
173 static BT::NodeType
type();
181 AUTO_APMS_BEHAVIOR_TREE_CORE_DEFINE_LEAF_THISREF_METHODS(
SubTree)
Abstract base for automatically generated model classes of behavior tree nodes that are not allowed t...
Abstract base for all automatically generated behavior tree node model classes to be used in interact...
NodeElement toNodeElement()
Convert to a lower level NodeElement object.
Class for configuring and instantiating behavior trees.
Handle for a single node of a TreeDocument.
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.
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.
Parameters for loading and registering a behavior tree node class from a shared library using e....