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

Block (return RUNNING) until a blackboard entry evaluates as true, then return SUCCESS. More...

#include <block_until_parameter_is_true.hpp>

Inheritance diagram for moveit_pro::behaviors::BlockUntilParameterIsTrue:
Collaboration diagram for moveit_pro::behaviors::BlockUntilParameterIsTrue:

Public Member Functions

 BlockUntilParameterIsTrue (const std::string &name, const BT::NodeConfiguration &config)
 
BT::NodeStatus onStart () override
 
BT::NodeStatus onRunning () override
 
void onHalted () override
 

Static Public Member Functions

static BT::PortsList providedPorts ()
 
static BT::KeyValueVector metadata ()
 

Detailed Description

Block (return RUNNING) until a blackboard entry evaluates as true, then return SUCCESS.

Reads the blackboard entry named in the parameter_name input port on every tick. The behavior succeeds the first tick the entry reads as true; until then it returns RUNNING. The parameter is referenced by literal name (e.g. parameter_name="my_flag"), not as a {blackboard pointer}, because the entry is resolved dynamically by name.

Use under a Parallel control to gate one branch on a flag set by another branch — typically a coarse "phase complete" handshake between cooperating subtrees.

Cycle time is bounded by the BT executor's tick period, which is generally indistinguishable from event-driven for orchestration purposes.

Data Port Name Port Type Object Type
parameter_name input std::string

Outcomes:

  • Entry missing or registered but not yet written → RUNNING. The writer may legitimately not have run yet; the behavior keeps polling.
  • Entry present and reads as true → SUCCESS. Accepted forms:
    • Native bool true (setOutput<bool>(...) from a C++ behavior).
    • Native int non-zero (setOutput<int>(...); e.g. 1).
    • String "true" or "1" as written by XML <SetBlackboard value="true"/> (XML attribute values are always strings, even when they look numeric).
  • Entry present and reads as false → RUNNING. The corresponding false forms: native bool false, native int 0, string "false" or "0".
  • Entry present but cannot be interpreted as bool → FAILURE + error log. Examples: a string like "yes" that is not parseable by BT.CPP's bool converter, or an entry whose stored type is neither bool, int, nor string. Surfacing these as FAILURE makes configuration mistakes (typos, wrong-type writers) immediately diagnosable rather than silently parking the gate forever.

Constructor & Destructor Documentation

◆ BlockUntilParameterIsTrue()

moveit_pro::behaviors::BlockUntilParameterIsTrue::BlockUntilParameterIsTrue ( const std::string &  name,
const BT::NodeConfiguration &  config 
)
Parameters
nameThe name assigned to this node in the behavior tree.
configNode configuration supplied by the BehaviorTreeFactory.

Member Function Documentation

◆ metadata()

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

◆ onHalted()

void moveit_pro::behaviors::BlockUntilParameterIsTrue::onHalted ( )
override

◆ onRunning()

BT::NodeStatus moveit_pro::behaviors::BlockUntilParameterIsTrue::onRunning ( )
override

◆ onStart()

BT::NodeStatus moveit_pro::behaviors::BlockUntilParameterIsTrue::onStart ( )
override

◆ providedPorts()

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

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