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

Filter 2D masks based on mask area only. More...

#include <filter_masks2d_by_area.hpp>

Inheritance diagram for moveit_pro::behaviors::FilterMasks2DByArea:
Collaboration diagram for moveit_pro::behaviors::FilterMasks2DByArea:

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

Filter 2D masks based on mask area only.

This behavior filters a vector of Mask2D messages by computing the area of each mask and checking if it falls within the specified range. Only masks that satisfy the area constraint are included in the output.

For each Mask2D in the input vector:

  • Compute area by counting all non-zero pixels
  • Check if min_area <= area <= max_area
  • If condition passes, add to output vector
Data Port Name Port Type Object Type
masks Input std::vector<moveit_studio_vision_msgs::msg::Mask2D>
min_area Input int
max_area Input int
filtered_masks Output std::vector<moveit_studio_vision_msgs::msg::Mask2D>

Constructor & Destructor Documentation

◆ FilterMasks2DByArea()

moveit_pro::behaviors::FilterMasks2DByArea::FilterMasks2DByArea ( 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::FilterMasks2DByArea::metadata ( )
static

◆ providedPorts()

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

◆ tick()

BT::NodeStatus moveit_pro::behaviors::FilterMasks2DByArea::tick ( )
override

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