Nav2 Navigation Stack - kilted  kilted
ROS 2 Navigation Stack
Public Member Functions | Static Public Member Functions | List of all members
nav2_behavior_tree::RoundRobinNode Class Reference

Type of sequence node that ticks children in a round-robin fashion. More...

#include <nav2_behavior_tree/include/nav2_behavior_tree/plugins/control/round_robin_node.hpp>

Inheritance diagram for nav2_behavior_tree::RoundRobinNode:
Inheritance graph
[legend]
Collaboration diagram for nav2_behavior_tree::RoundRobinNode:
Collaboration graph
[legend]

Public Member Functions

 RoundRobinNode (const std::string &name)
 A constructor for nav2_behavior_tree::RoundRobinNode. More...
 
 RoundRobinNode (const std::string &name, const BT::NodeConfiguration &config)
 A constructor for nav2_behavior_tree::RoundRobinNode. More...
 
BT::NodeStatus tick () override
 The main override required by a BT action. More...
 
void halt () override
 The other (optional) override required by a BT action to reset node state.
 

Static Public Member Functions

static BT::PortsList providedPorts ()
 Creates list of BT ports. More...
 

Detailed Description

Type of sequence node that ticks children in a round-robin fashion.

Type of Control Node | Child Returns Failure | Child Returns Running

RoundRobin | Tick Next Child | Return Running

If the current child return failure, the next child is ticked and if the last child returns failure, the first child is ticked and the cycle continues until a child returns success

As an example, let's say this node has 3 children: A, B and C. At the start, they are all IDLE.

| A | B | C |

| IDLE | IDLE | IDLE | | RUNNING | IDLE | IDLE | - at first A gets ticked. Assume it returns RUNNING

If all children return FAILURE, RoundRobin will return FAILURE and halt all children, ending the sequence.

Usage in XML: <RoundRobin>

Definition at line 54 of file round_robin_node.hpp.

Constructor & Destructor Documentation

◆ RoundRobinNode() [1/2]

nav2_behavior_tree::RoundRobinNode::RoundRobinNode ( const std::string &  name)
explicit

A constructor for nav2_behavior_tree::RoundRobinNode.

Parameters
nameName for the XML tag for this node

Definition at line 22 of file round_robin_node.cpp.

◆ RoundRobinNode() [2/2]

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

A constructor for nav2_behavior_tree::RoundRobinNode.

Parameters
nameName for the XML tag for this node
configBT node configuration

Definition at line 27 of file round_robin_node.cpp.

Member Function Documentation

◆ providedPorts()

static BT::PortsList nav2_behavior_tree::RoundRobinNode::providedPorts ( )
inlinestatic

Creates list of BT ports.

Returns
BT::PortsList Containing basic ports along with node-specific ports

Definition at line 85 of file round_robin_node.hpp.

◆ tick()

BT::NodeStatus nav2_behavior_tree::RoundRobinNode::tick ( )
override

The main override required by a BT action.

Returns
BT::NodeStatus Status of tick execution

Definition at line 34 of file round_robin_node.cpp.

References halt().

Here is the call graph for this function:

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