The SimpleConditionNode provides an easy to use ConditionNode. The user should simply provide a callback with this signature. More...
#include <condition_node.h>
Public Types | |
typedef std::function < NodeStatus(TreeNode &)> | TickFunctor |
Public Member Functions | |
virtual void | halt () override |
The method used to interrupt the execution of a RUNNING node. | |
SimpleConditionNode (const std::string &name, TickFunctor tick_functor, const NodeParameters ¶ms=NodeParameters()) | |
~SimpleConditionNode () override | |
Protected Member Functions | |
virtual NodeStatus | tick () override |
Method to be implemented by the user. | |
Protected Attributes | |
TickFunctor | tick_functor_ |
The SimpleConditionNode provides an easy to use ConditionNode. The user should simply provide a callback with this signature.
BT::NodeStatus functionName(void)
This avoids the hassle of inheriting from a ActionNode.
Using lambdas or std::bind it is easy to pass a pointer to a method. SimpleConditionNode does not support halting, NodeParameters, nor Blackboards.
Definition at line 48 of file condition_node.h.
typedef std::function<NodeStatus(TreeNode&)> BT::SimpleConditionNode::TickFunctor |
Definition at line 51 of file condition_node.h.
BT::SimpleConditionNode::SimpleConditionNode | ( | const std::string & | name, |
TickFunctor | tick_functor, | ||
const NodeParameters & | params = NodeParameters() |
||
) |
Definition at line 27 of file condition_node.cpp.
BT::SimpleConditionNode::~SimpleConditionNode | ( | ) | [override] |
virtual void BT::SimpleConditionNode::halt | ( | ) | [inline, override, virtual] |
The method used to interrupt the execution of a RUNNING node.
Reimplemented from BT::ConditionNode.
Definition at line 59 of file condition_node.h.
NodeStatus BT::SimpleConditionNode::tick | ( | ) | [override, protected, virtual] |
Method to be implemented by the user.
Implements BT::TreeNode.
Definition at line 33 of file condition_node.cpp.
TickFunctor BT::SimpleConditionNode::tick_functor_ [protected] |
Definition at line 67 of file condition_node.h.