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

A decorator that filters the log messages produced while ticking its child Behavior. More...

#include <suppress_child_errors.hpp>

Inheritance diagram for moveit_pro::behaviors::SuppressChildErrors:
Collaboration diagram for moveit_pro::behaviors::SuppressChildErrors:

Public Member Functions

 SuppressChildErrors (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< moveit_pro::behaviors::BehaviorContext > &shared_resources)
 
- Public Member Functions inherited from moveit_pro::behaviors::SharedResourcesNode< BT::DecoratorNode >
 SharedResourcesNode (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
 Constructor for SharedResourcesNode. Called by BT::BehaviorTreeFactory when creating a new behavior tree containing this node.
 

Static Public Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from moveit_pro::behaviors::SharedResourcesNode< BT::DecoratorNode >
std::shared_ptr< BehaviorContextshared_resources_
 

Detailed Description

A decorator that filters the log messages produced while ticking its child Behavior.

Objective authors regularly use recovery patterns such as Fallback where the first branch is expected to fail as part of normal decision logic (for example, "try to detect an object; if that fails, move to a default pose"). The failing Behavior correctly logs an ERROR from its own perspective, which surfaces as an alarming red toast in the UI and an ERROR line in the system logs even though the system is behaving exactly as designed.

SuppressChildErrors wraps such a subtree and drops the messages it produces at the configured severities, without changing the child's BT::NodeStatus. Suppressed messages are not downgraded to a different severity — they are removed entirely, so no UI toast, console line, or error-buffer entry is produced for them. It requires no changes to the wrapped Behaviors — they keep logging normally. Compose it with ForceSuccess when the author also wants to swallow the failure status.

While the child is ticking, the decorator installs a filter on the shared logger (see LoggerBase::pushFilter). A message is dropped when the per-severity flag for its level is true (suppress_error/suppress_warn/ suppress_info); otherwise it passes through unchanged. The filter is removed as soon as the child reaches a terminal status or the decorator is halted.

Data Port Name Port Type Object Type Default Description
suppress_error input bool true Drop ERROR messages logged by the child.
suppress_warn input bool false Drop WARN messages logged by the child.
suppress_info input bool false Drop INFO messages logged by the child.
Note
Direct spdlog::error(...) calls from Behaviors bypass LoggerBase and are not filtered. They never reach the UI toast path regardless, so this is a console-only limitation.
When two SuppressChildErrors decorators are nested, only the innermost (top-of-stack) filter is consulted for messages logged while it is installed (see LoggerBase::pushFilter). An inner decorator's flags therefore fully shadow an outer one's for the duration of the inner child's tick — e.g. an outer suppress_error=true does not drop an ERROR that an inner suppress_error=false forwards.

Constructor & Destructor Documentation

◆ SuppressChildErrors()

moveit_pro::behaviors::SuppressChildErrors::SuppressChildErrors ( const std::string &  name,
const BT::NodeConfiguration &  config,
const std::shared_ptr< moveit_pro::behaviors::BehaviorContext > &  shared_resources 
)

Member Function Documentation

◆ metadata()

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

◆ providedPorts()

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

Required implementation of the static providedPorts function.

Returns
The list of input ports used by this Behavior.

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