|
BehaviorTree
Core Library to create and execute Behavior Trees
|
Struct used to store a tree. If this object goes out of scope, the tree is destroyed. More...
#include <bt_factory.h>

Classes | |
| struct | Subtree |
Public Member Functions | |
| Tree (const Tree &)=delete | |
| Tree & | operator= (const Tree &)=delete |
| Tree (Tree &&other)=default | |
| Tree & | operator= (Tree &&other)=default |
| void | initialize () |
| void | haltTree () |
| TreeNode * | rootNode () const |
| bool | sleep (std::chrono::system_clock::duration timeout) |
| Sleep for a certain amount of time. This sleep could be interrupted by the methods TreeNode::emitWakeUpSignal() or Tree::emitWakeUpSignal() | |
| void | emitWakeUpSignal () |
| Wake up the tree. This will interrupt the sleep() method. | |
| NodeStatus | tickExactlyOnce () |
| NodeStatus | tickOnce () |
| by default, tickOnce() sends a single tick, BUT as long as there is at least one node of the tree invoking TreeNode::emitWakeUpSignal(), it will be ticked again. | |
| NodeStatus | tickWhileRunning (std::chrono::milliseconds sleep_time=std::chrono::milliseconds(10)) |
| Blackboard::Ptr | rootBlackboard () |
| void | applyVisitor (const std::function< void(const TreeNode *)> &visitor) const |
| void | applyVisitor (const std::function< void(TreeNode *)> &visitor) |
| uint16_t | getUID () |
| template<typename NodeType = BT::TreeNode> | |
| std::vector< const TreeNode * > | getNodesByPath (StringView wildcard_filter) const |
Public Attributes | |
| std::vector< Subtree::Ptr > | subtrees |
| std::unordered_map< std::string, TreeNodeManifest > | manifests |
Friends | |
| class | BehaviorTreeFactory |
Struct used to store a tree. If this object goes out of scope, the tree is destroyed.
|
inline |
Get a list of nodes which fullPath() match a wildcard filter and a given path. Example:
move_nodes = tree.getNodesByPath<MoveBaseNode>("move_*");
| bool BT::Tree::sleep | ( | std::chrono::system_clock::duration | timeout | ) |
Sleep for a certain amount of time. This sleep could be interrupted by the methods TreeNode::emitWakeUpSignal() or Tree::emitWakeUpSignal()
| timeout | duration of the sleep |
| NodeStatus BT::Tree::tickExactlyOnce | ( | ) |
Tick the root of the tree once, even if a node invoked emitWakeUpSignal()
| NodeStatus BT::Tree::tickWhileRunning | ( | std::chrono::milliseconds | sleep_time = std::chrono::milliseconds(10) | ) |
Call tickOnce until the status is different from RUNNING. Note that between one tick and the following one, a Tree::sleep() is used