Skip to main content

BlockUntilParameterIsTrue Class

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

Declaration

class moveit_pro::behaviors::BlockUntilParameterIsTrue { ... }

Included Headers

#include <block_until_parameter_is_true.hpp>

Base class

classBT::StatefulActionNode

Public Constructors Index

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

Public Member Functions Index

BT::NodeStatusonStart () override
BT::NodeStatusonRunning () override
voidonHalted () override

Private Member Functions Index

BT::NodeStatusevaluateGate () const

Private Member Attributes Index

std::stringparameter_name_

Public Static Functions Index

static BT::PortsListprovidedPorts ()
static BT::KeyValueVectormetadata ()

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 NamePort TypeObject Type
parameter_nameinputstd::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.

Definition at line 52 of file block_until_parameter_is_true.hpp.

Public Constructors

BlockUntilParameterIsTrue()

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

The name assigned to this node in the behavior tree.

config

Node configuration supplied by the BehaviorTreeFactory.

Declaration at line 59 of file block_until_parameter_is_true.hpp, definition at line 40 of file block_until_parameter_is_true.cpp.

Public Member Functions

onHalted()

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

Declaration at line 67 of file block_until_parameter_is_true.hpp, definition at line 84 of file block_until_parameter_is_true.cpp.

onRunning()

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

Declaration at line 66 of file block_until_parameter_is_true.hpp, definition at line 79 of file block_until_parameter_is_true.cpp.

onStart()

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

Declaration at line 65 of file block_until_parameter_is_true.hpp, definition at line 59 of file block_until_parameter_is_true.cpp.

Private Member Functions

evaluateGate()

BT::NodeStatus moveit_pro::behaviors::BlockUntilParameterIsTrue::evaluateGate ()

Evaluate the watched blackboard entry. SUCCESS if it reads as true; RUNNING if it reads as false, is absent, or has been registered but not yet written; FAILURE if it exists but cannot be interpreted as bool.

Declaration at line 73 of file block_until_parameter_is_true.hpp, definition at line 89 of file block_until_parameter_is_true.cpp.

Private Member Attributes

parameter_name_

std::string moveit_pro::behaviors::BlockUntilParameterIsTrue::parameter_name_

Definition at line 75 of file block_until_parameter_is_true.hpp.

Public Static Functions

metadata()

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

Declaration at line 63 of file block_until_parameter_is_true.hpp, definition at line 54 of file block_until_parameter_is_true.cpp.

providedPorts()

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

Declaration at line 61 of file block_until_parameter_is_true.hpp, definition at line 45 of file block_until_parameter_is_true.cpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.