MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
moveit_pro::behaviors::RepeatUnlessFailureEachTick Class Referencefinal

Decorator that ticks its child up to num_cycles times, advancing one iteration per parent tick. More...

#include <repeat_unless_failure_each_tick.hpp>

Inheritance diagram for moveit_pro::behaviors::RepeatUnlessFailureEachTick:
Collaboration diagram for moveit_pro::behaviors::RepeatUnlessFailureEachTick:

Public Member Functions

 RepeatUnlessFailureEachTick (const std::string &name, const BT::NodeConfiguration &config)
 
 ~RepeatUnlessFailureEachTick () override=default
 

Static Public Member Functions

static BT::PortsList providedPorts ()
 Required implementation of the static providedPorts function.
 
static BT::KeyValueVector metadata ()
 

Detailed Description

Decorator that ticks its child up to num_cycles times, advancing one iteration per parent tick.

A safe replacement for the stock BehaviorTree.CPP Repeat and KeepRunningUntilFailure decorators that respects the BT tick paradigm:

  • At most one child iteration runs per parent tick. When the child returns SUCCESS, this decorator returns RUNNING so the parent re-ticks on the next pass instead of looping inside one tick.
  • When the child returns FAILURE, this decorator returns FAILURE.
  • When the cumulative successful iteration count reaches num_cycles, this decorator returns SUCCESS.
  • When num_cycles is -1 (the default), the loop runs forever — equivalent to the legacy KeepRunningUntilFailure semantics, but without the tick-paradigm violation present in Repeat.

Because each iteration yields a tick back to the parent, an infinite loop with a synchronous always-SUCCESS child cannot deadlock the tree the way Repeat num_cycles="-1" does.

Data Port Name Port Type Object Type
num_cycles input int

Constructor & Destructor Documentation

◆ RepeatUnlessFailureEachTick()

moveit_pro::behaviors::RepeatUnlessFailureEachTick::RepeatUnlessFailureEachTick ( const std::string &  name,
const BT::NodeConfiguration &  config 
)

◆ ~RepeatUnlessFailureEachTick()

moveit_pro::behaviors::RepeatUnlessFailureEachTick::~RepeatUnlessFailureEachTick ( )
overridedefault

Member Function Documentation

◆ metadata()

BT::KeyValueVector moveit_pro::behaviors::RepeatUnlessFailureEachTick::metadata ( )
static

◆ providedPorts()

BT::PortsList moveit_pro::behaviors::RepeatUnlessFailureEachTick::providedPorts ( )
static

Required implementation of the static providedPorts function.

Returns
The list of input and output ports used by this behavior.

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