The SimpleActionNode provides an easy to use ActionNode. The user should simply provide a callback with this signature. More...
#include <action_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. | |
SimpleActionNode (const std::string &name, TickFunctor tick_functor, const NodeParameters ¶ms=NodeParameters()) | |
~SimpleActionNode () override | |
Protected Member Functions | |
virtual NodeStatus | tick () override |
Method to be implemented by the user. | |
Protected Attributes | |
TickFunctor | tick_functor_ |
The SimpleActionNode provides an easy to use ActionNode. 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. SimpleActionNode is executed synchronously and does not support halting. NodeParameters aren't supported.
Definition at line 77 of file action_node.h.
typedef std::function<NodeStatus(TreeNode&)> BT::SimpleActionNode::TickFunctor |
Definition at line 80 of file action_node.h.
BT::SimpleActionNode::SimpleActionNode | ( | const std::string & | name, |
SimpleActionNode::TickFunctor | tick_functor, | ||
const NodeParameters & | params = NodeParameters() |
||
) |
Definition at line 38 of file action_node.cpp.
BT::SimpleActionNode::~SimpleActionNode | ( | ) | [override] |
virtual void BT::SimpleActionNode::halt | ( | ) | [inline, override, virtual] |
The method used to interrupt the execution of a RUNNING node.
Implements BT::TreeNode.
Definition at line 88 of file action_node.h.
NodeStatus BT::SimpleActionNode::tick | ( | ) | [override, protected, virtual] |
Method to be implemented by the user.
Implements BT::TreeNode.
Definition at line 45 of file action_node.cpp.
TickFunctor BT::SimpleActionNode::tick_functor_ [protected] |
Definition at line 96 of file action_node.h.