![]() |
AutoAPMS
Streamlining behaviors in ROS 2
|
Subtree behavior tree node model. More...
#include <auto_apms_behavior_tree_core/node/node_model_type.hpp>

Public Member Functions | |
| std::string | getRegistrationName () const override final |
| Get the type specific name under which all subtree nodes are registered with the behavior tree factory. | |
| SubTree & | setBlackboardRemapping (const PortValues &remapping) |
| Configure which blackboard entries of the subtree node's parent tree should be also available for the children of the tree this subtree node is pointing to. | |
| SubTree & | set_auto_remap (bool val=false) |
| Set automatic blackboard remapping. | |
| bool | get_auto_remap () const |
| Get automatic blackboard remapping. | |
Public Member Functions inherited from NodeModelType | |
| NodeElement | toNodeElement () |
| Convert to a lower level NodeElement object. | |
Public Member Functions inherited from TreeDocument::NodeElement | |
| NodeElement (const NodeElement &ele)=default | |
| Copy constructor for a node element. | |
| NodeElement & | operator= (const NodeElement &other) |
| Replace this node with another. | |
| bool | operator== (const NodeElement &other) const |
| Determine if two node elements refer to the same node. | |
| NodeElement | insertNode (const std::string &name, const NodeElement *before_this=nullptr) |
| Add a new node to the children of this node. | |
| NodeElement | insertNode (const std::string &name, const NodeRegistrationOptions ®istration_options, const NodeElement *before_this=nullptr) |
| Register a new node and add it to the children of this node. | |
| template<class T> | |
| std::enable_if_t< std::is_base_of_v< NodeModelType, T > &&!std::is_same_v< model::SubTree, T >, T > | insertNode (const NodeElement *before_this=nullptr) |
| Register a new node and add it to the children of this node. | |
| template<class SubTreeT> | |
| std::enable_if_t< std::is_same_v< model::SubTree, SubTreeT >, model::SubTree > | insertNode (const std::string &tree_name, const NodeElement *before_this=nullptr) |
| Add a subtree node for a specific tree element to the children of this node. | |
| template<class SubTreeT> | |
| std::enable_if_t< std::is_same_v< model::SubTree, SubTreeT >, model::SubTree > | insertNode (const TreeElement &tree, const NodeElement *before_this=nullptr) |
| Add a subtree node for a specific tree element to the children of this node. | |
| model::SubTree | insertSubTreeNode (const std::string &tree_name, const NodeElement *before_this=nullptr) |
| Add a subtree node for a specific tree element to the children of this node. | |
| model::SubTree | insertSubTreeNode (const TreeElement &tree, const NodeElement *before_this=nullptr) |
| Add a subtree node for a specific tree element to the children of this node. | |
| NodeElement | insertTree (const TreeElement &tree, const NodeElement *before_this=nullptr) |
| Concatenate a tree and add its first child node to the children of this node. | |
| NodeElement | insertTreeFromDocument (const TreeDocument &doc, const std::string &tree_name, const NodeElement *before_this=nullptr) |
| Concatenate a tree from a document and add its first child node to the children of this node. | |
| NodeElement | insertTreeFromDocument (const TreeDocument &doc, const NodeElement *before_this=nullptr) |
| Concatenate the root tree of a document and add its first child node to the children of this node. | |
| NodeElement | insertTreeFromString (const std::string &tree_str, const std::string &tree_name, const NodeElement *before_this=nullptr) |
| Concatenate a tree from a document created from a string and add its first child node to the children of this node. | |
| NodeElement | insertTreeFromString (const std::string &tree_str, const NodeElement *before_this=nullptr) |
| Concatenate the root tree of a document created from a string and add its first child node to the children of this node. | |
| NodeElement | insertTreeFromFile (const std::string &path, const std::string &tree_name, const NodeElement *before_this=nullptr) |
| Concatenate a tree from a document created from a file and add its first child node to the children of this node. | |
| NodeElement | insertTreeFromFile (const std::string &path, const NodeElement *before_this=nullptr) |
| Concatenate the root tree of a document created from a file and add its first child node to the children of this node. | |
| NodeElement | insertTreeFromResource (const TreeResource &resource, const std::string &tree_name, const NodeElement *before_this=nullptr) |
| Concatenate a tree from one of the installed package's behavior tree resources and add its first child node to the children of this node. | |
| NodeElement | insertTreeFromResource (const TreeResource &resource, const NodeElement *before_this=nullptr) |
| Concatenate the root tree of one of the installed package's behavior tree resources and add its first child node to the children of this node. | |
| bool | hasChildren () const |
| Determine whether any children have been given to this node. | |
| NodeElement | getFirstNode (const std::string ®istration_name="", const std::string &instance_name="") const |
| Recursively visit this node's children in execution order and get the first node with a particular registration and instance name. | |
| template<class T> | |
| std::enable_if_t< std::is_base_of_v< NodeModelType, T >, T > | getFirstNode (const std::string &instance_name="") const |
| Recursively visit this node's children in execution order and get the first node with a particular instance name. | |
| NodeElement & | removeFirstChild (const std::string ®istration_name="", const std::string &instance_name="") |
| Recursively visit this node's children in execution order and remove the first node with a particular registration and instance name. | |
| template<class T> | |
| std::enable_if_t< std::is_base_of_v< NodeModelType, T >, NodeElement & > | removeFirstChild (const std::string &instance_name="") |
| Recursively visit this node's children in execution order and remove the first node with a particular instance name. | |
| NodeElement & | removeChildren () |
| Recursively remove all children of this node element. | |
| const std::vector< std::string > & | getPortNames () const |
| Get the names of the data ports implemented by the node represented by this element. | |
| PortValues | getPorts () const |
| Assemble the values given to each data port implemented by this node. | |
| NodeElement & | setPorts (const PortValues &port_values) |
| Populate the the node's data ports. | |
| NodeElement & | resetPorts () |
| Delete all currently specified port values and reset with the defaults. | |
| NodeElement & | setConditionalScript (BT::PreCond type, const Script &script) |
| Specify a script that is evaluated before this node is ticked. | |
| NodeElement & | setConditionalScript (BT::PostCond type, const Script &script) |
| Specify a script that is evaluated after the tree is done executing this node. | |
| virtual NodeElement & | setName (const std::string &instance_name) |
| Assign a name for this specific node instance. | |
| virtual std::string | getName () const |
| Get the name of this node given to this specific instance by the developer. | |
| std::string | getFullyQualifiedName () const |
| Create a string that uniquely identifies this node considering its registration and its instance name. | |
| const TreeDocument & | getParentDocument () const |
| Get a const view of this node's parent tree document. | |
| const std::vector< NodeElement > | deepApplyConst (ConstDeepApplyCallback apply_callback) const |
| Recursively apply a callback to this node's children. | |
| std::vector< NodeElement > | deepApply (DeepApplyCallback apply_callback) |
| Recursively apply a callback to this node's children. | |
Static Public Member Functions | |
| static std::string | name () |
| Static method that provides the hard coded registration name of subtree nodes. | |
| static BT::NodeType | type () |
| Type of the behavior tree node. | |
Additional Inherited Members | |
Public Types inherited from TreeDocument::NodeElement | |
| using | PortValues = std::map<std::string, std::string> |
| Mapping of port names and its respective value encoded as string. | |
| using | DeepApplyCallback = std::function<bool(NodeElement &)> |
| Callback invoked for every node found under another node. It may modify the current node. | |
| using | ConstDeepApplyCallback = std::function<bool(const NodeElement &)> |
| Callback invoked for every node found under another node. It cannot modify the current node. | |
Protected Member Functions inherited from TreeDocument::NodeElement | |
| NodeElement (TreeDocument *doc_ptr, XMLElement *ele_ptr) | |
| Protected constructor intended for internal use only. | |
Protected Attributes inherited from TreeDocument::NodeElement | |
| TreeDocument * | doc_ptr_ |
| Pointer to the tree document that created the tree this node belongs to. | |
| tinyxml2::XMLElement * | ele_ptr_ |
Pointer to the corresponding XMLElement of the base document. | |
Subtree behavior tree node model.
This model implements extra methods specific to the subtree concept.
Definition at line 161 of file node_model_type.hpp.
|
static |
Static method that provides the hard coded registration name of subtree nodes.
Definition at line 35 of file node_model_type.cpp.
|
static |
Type of the behavior tree node.
Definition at line 33 of file node_model_type.cpp.
|
finaloverridevirtual |
Get the type specific name under which all subtree nodes are registered with the behavior tree factory.
Implements NodeModelType.
Definition at line 37 of file node_model_type.cpp.
| SubTree & setBlackboardRemapping | ( | const PortValues & | remapping | ) |
Configure which blackboard entries of the subtree node's parent tree should be also available for the children of the tree this subtree node is pointing to.
| remapping | Mapping of blackboard entry names in the format {subtree_entry_name: original_tree_entry_name} |
Definition at line 39 of file node_model_type.cpp.
| SubTree & set_auto_remap | ( | bool | val = false | ) |
Set automatic blackboard remapping.
| val | true to enable and false to disable. |
Definition at line 53 of file node_model_type.cpp.
| bool get_auto_remap | ( | ) | const |
Get automatic blackboard remapping.
Definition at line 55 of file node_model_type.cpp.