subtree_node.h
Go to the documentation of this file.
1 #ifndef DECORATOR_SUBTREE_NODE_H
2 #define DECORATOR_SUBTREE_NODE_H
3 
5 
6 namespace BT
7 {
14 class SubtreeNode : public DecoratorNode
15 {
16 public:
17  SubtreeNode(const std::string& name);
18 
19  virtual ~SubtreeNode() override = default;
20 
21 private:
22  virtual BT::NodeStatus tick() override;
23 
25  {
26  return {InputPort<bool>("__shared_blackboard", false,
27  "If false (default) the subtree has its own blackboard and "
28  "you"
29  "need to do port remapping to connect it to the parent")};
30  }
31 
32  virtual NodeType type() const override final
33  {
34  return NodeType::SUBTREE;
35  }
36 };
37 
79 {
80 public:
81  SubtreePlusNode(const std::string& name);
82 
83  virtual ~SubtreePlusNode() override = default;
84 
85 private:
86  virtual BT::NodeStatus tick() override;
87 
89  {
90  return {InputPort<bool>("__autoremap", false,
91  "If true, all the ports with the same name will be "
92  "remapped")};
93  }
94 
95  virtual NodeType type() const override final
96  {
97  return NodeType::SUBTREE;
98  }
99 };
100 
101 } // namespace BT
102 
103 #endif // DECORATOR_SUBTREE_NODE_H
virtual BT::NodeStatus tick() override
Method to be implemented by the user.
Definition: subtree_node.cpp:8
static PortsList providedPorts()
Definition: subtree_node.h:24
static PortsList providedPorts()
Definition: subtree_node.h:88
virtual NodeType type() const override final
Definition: subtree_node.h:95
const std::string & name() const
Name of the instance, not the type.
Definition: tree_node.cpp:101
virtual NodeType type() const override final
Definition: subtree_node.h:32
The SubtreeNode is a way to wrap an entire Subtree, creating a separated BlackBoard. If you want to have data flow through ports, you need to explicitly remap the ports.
Definition: subtree_node.h:14
SubtreeNode(const std::string &name)
Definition: subtree_node.cpp:3
std::unordered_map< std::string, PortInfo > PortsList
Definition: basic_types.h:333
NodeStatus
Definition: basic_types.h:35
NodeType
Enumerates the possible types of nodes.
Definition: basic_types.h:22
The SubtreePlus is a new kind of subtree that gives you much more control over remapping: ...
Definition: subtree_node.h:78
virtual ~SubtreeNode() override=default


behaviortree_cpp_v3
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Mon Jul 3 2023 02:50:14