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( \
27 const std::string & registration_name = "", const std::string & instance_name = "", bool deep_search = false) \
29 NodeElement::removeFirstChild(registration_name, instance_name, deep_search); \
33 typename std::enable_if_t<std::is_base_of_v<NodeModelType, T>, ClassType &> removeFirstChild( \
34 const std::string & instance_name = "", bool deep_search = false) \
36 NodeElement::removeFirstChild<T>(instance_name, deep_search); \
39 ClassType & removeChildren() \
41 NodeElement::removeChildren(); \
45#define AUTO_APMS_BEHAVIOR_TREE_CORE_DEFINE_LEAF_THISREF_METHODS(ClassType) \
46 ClassType & setPorts(const auto_apms_behavior_tree::core::TreeDocument::NodeElement::PortValues & port_values) \
48 NodeElement::setPorts(port_values); \
51 ClassType & resetPorts() \
53 NodeElement::resetPorts(); \
56 ClassType & setConditionalScript(BT::PreCond type, const auto_apms_behavior_tree::core::Script & script) \
58 NodeElement::setConditionalScript(type, script); \
61 ClassType & setConditionalScript(BT::PostCond type, const auto_apms_behavior_tree::core::Script & script) \
63 NodeElement::setConditionalScript(type, script); \
66 ClassType & setName(const std::string & instance_name) \
68 NodeElement::setName(instance_name); \
88 using NodeElement::NodeElement;
92 using PortInfos = std::map<std::string, BT::PortInfo>;
94 virtual std::string getRegistrationName()
const override = 0;
110 using NodeModelType::NodeModelType;
124 bool hasChildren()
const =
delete;
128 std::vector<NodeElement> deepApplyConst() =
delete;
129 std::vector<NodeElement> deepApply() =
delete;
173 using LeafNodeModelType::LeafNodeModelType;
177 static std::string
name();
180 static BT::NodeType
type();
188 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.
Forward iterator for traversing the first-level children of a node.
Handle for a single node of a TreeDocument.
NodeElement(TreeDocument *doc_ptr, XMLElement *ele_ptr)
Protected constructor intended for internal use only.
Subtree behavior tree node model.
static BT::NodeType type()
Type of the behavior tree node.
bool get_auto_remap() const
Get automatic blackboard remapping.
SubTree & setBlackboardRemapping(const std::map< std::string, std::string > &remapping)
Configure which blackboard entries of the subtree node's parent tree should be also available for the...
std::string getRegistrationName() const override final
Get the type specific name under which all subtree nodes are registered with the behavior tree factor...
std::map< std::string, std::string > getBlackboardRemapping() const
Get the currently configured blackboard remapping.
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.
Powerful tooling for incorporating behavior trees for task development.
Parameters for loading and registering a behavior tree node class from a shared library using e....