Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
BT::RetryNode Class Reference

The RetryNode is used to execute a child several times if it fails. More...

#include <retry_node.h>

Inheritance diagram for BT::RetryNode:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void halt () override
 The method used to interrupt the execution of this node.
 RetryNode (const std::string &name, int NTries)
 RetryNode (const std::string &name, const NodeConfiguration &config)
virtual ~RetryNode () override

Static Public Member Functions

static PortsList providedPorts ()

Private Member Functions

virtual BT::NodeStatus tick () override
 Method to be implemented by the user.

Private Attributes

int max_attempts_
bool read_parameter_from_ports_
int try_index_

Static Private Attributes

static constexpr const char * NUM_ATTEMPTS = "num_attempts"

Detailed Description

The RetryNode is used to execute a child several times if it fails.

If the child returns SUCCESS, the loop is stopped and this node returns SUCCESS.

If the child returns FAILURE, this node will try again up to N times (N is read from port "num_attempts").

Example:

<RetryUntilSuccesful num_attempts="3"> <OpenDoor> </RetryUntilSuccesful>

Definition at line 36 of file retry_node.h.


Constructor & Destructor Documentation

BT::RetryNode::RetryNode ( const std::string &  name,
int  NTries 
)

Definition at line 20 of file retry_node.cpp.

BT::RetryNode::RetryNode ( const std::string &  name,
const NodeConfiguration config 
)

Definition at line 29 of file retry_node.cpp.

virtual BT::RetryNode::~RetryNode ( ) [override, virtual]

Member Function Documentation

void BT::RetryNode::halt ( ) [override, virtual]

The method used to interrupt the execution of this node.

Reimplemented from BT::DecoratorNode.

Definition at line 37 of file retry_node.cpp.

static PortsList BT::RetryNode::providedPorts ( ) [inline, static]

Definition at line 46 of file retry_node.h.

NodeStatus BT::RetryNode::tick ( ) [override, private, virtual]

Method to be implemented by the user.

Implements BT::TreeNode.

Definition at line 43 of file retry_node.cpp.


Member Data Documentation

Definition at line 56 of file retry_node.h.

constexpr const char * BT::RetryNode::NUM_ATTEMPTS = "num_attempts" [static, private]

Definition at line 60 of file retry_node.h.

Definition at line 59 of file retry_node.h.

Definition at line 57 of file retry_node.h.


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


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Jun 8 2019 20:17:15