Public Member Functions | Public Attributes | Private Attributes | List of all members
BT::Tree Class Reference

Struct used to store a tree. If this object goes out of scope, the tree is destroyed. More...

#include <bt_factory.h>

Public Member Functions

void haltTree ()
 
void initialize ()
 
Treeoperator= (const Tree &)=delete
 
Treeoperator= (Tree &&other)
 
Blackboard::Ptr rootBlackboard ()
 
TreeNoderootNode () const
 
void sleep (std::chrono::system_clock::duration timeout)
 
NodeStatus tickRoot ()
 tickRoot send the tick signal to the root node. It will propagate through the entire tree. More...
 
NodeStatus tickRootWhileRunning (std::chrono::milliseconds sleep_time=std::chrono::milliseconds(10))
 tickRootWhileRunning imply execute tickRoot in a loop as long as the status is RUNNING. More...
 
 Tree ()
 
 Tree (const Tree &)=delete
 
 Tree (Tree &&other)
 
 ~Tree ()
 

Public Attributes

std::vector< Blackboard::Ptrblackboard_stack
 
std::unordered_map< std::string, TreeNodeManifestmanifests
 
std::vector< TreeNode::Ptrnodes
 

Private Attributes

std::shared_ptr< WakeUpSignalwake_up_
 

Detailed Description

Struct used to store a tree. If this object goes out of scope, the tree is destroyed.

To tick the tree, simply call:

NodeStatus status = my_tree.tickRoot();

Definition at line 125 of file bt_factory.h.

Constructor & Destructor Documentation

◆ Tree() [1/3]

BT::Tree::Tree ( )
inline

Definition at line 132 of file bt_factory.h.

◆ Tree() [2/3]

BT::Tree::Tree ( const Tree )
delete

◆ Tree() [3/3]

BT::Tree::Tree ( Tree &&  other)
inline

Definition at line 139 of file bt_factory.h.

◆ ~Tree()

BT::Tree::~Tree ( )

Definition at line 337 of file bt_factory.cpp.

Member Function Documentation

◆ haltTree()

void BT::Tree::haltTree ( )
inline

Definition at line 162 of file bt_factory.h.

◆ initialize()

void BT::Tree::initialize ( )
inline

Definition at line 153 of file bt_factory.h.

◆ operator=() [1/2]

Tree& BT::Tree::operator= ( const Tree )
delete

◆ operator=() [2/2]

Tree& BT::Tree::operator= ( Tree &&  other)
inline

Definition at line 144 of file bt_factory.h.

◆ rootBlackboard()

Blackboard::Ptr BT::Tree::rootBlackboard ( )

Definition at line 342 of file bt_factory.cpp.

◆ rootNode()

TreeNode* BT::Tree::rootNode ( ) const
inline

Definition at line 181 of file bt_factory.h.

◆ sleep()

void BT::Tree::sleep ( std::chrono::system_clock::duration  timeout)

Sleep for a certain amount of time. This sleep could be interrupted by the method TreeNode::emitStateChanged()

Definition at line 332 of file bt_factory.cpp.

◆ tickRoot()

NodeStatus BT::Tree::tickRoot ( )
inline

tickRoot send the tick signal to the root node. It will propagate through the entire tree.

Definition at line 210 of file bt_factory.h.

◆ tickRootWhileRunning()

NodeStatus BT::Tree::tickRootWhileRunning ( std::chrono::milliseconds  sleep_time = std::chrono::milliseconds(10))
inline

tickRootWhileRunning imply execute tickRoot in a loop as long as the status is RUNNING.

Parameters
sleep_timemaximum sleep time between consecutive loops.
Returns
should return only SUCCESS or FAILURE.

Definition at line 194 of file bt_factory.h.

Member Data Documentation

◆ blackboard_stack

std::vector<Blackboard::Ptr> BT::Tree::blackboard_stack

Definition at line 129 of file bt_factory.h.

◆ manifests

std::unordered_map<std::string, TreeNodeManifest> BT::Tree::manifests

Definition at line 130 of file bt_factory.h.

◆ nodes

std::vector<TreeNode::Ptr> BT::Tree::nodes

Definition at line 128 of file bt_factory.h.

◆ wake_up_

std::shared_ptr<WakeUpSignal> BT::Tree::wake_up_
private

Definition at line 239 of file bt_factory.h.


The documentation for this class was generated from the following files:


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