|
MoveIt Pro API
Core Behaviors for MoveIt Pro
|
Segment an image using SAM2 automasking with grid-based point generation. More...
#include <sam2_automasking.hpp>


Classes | |
| struct | InferenceHandle |
| Interface for SAM2 automasking inference. More... | |
| struct | SAM2AutomaskHandle |
| Default implementation using SAM2Automasking. More... | |
Public Member Functions | |
| GetMasks2DAutomask (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< moveit_studio::behaviors::BehaviorContext > &shared_resources, std::unique_ptr< InferenceHandle > inference_handle=std::make_unique< SAM2AutomaskHandle >()) | |
| Constructor for SAM2 automasking behavior. | |
| ~GetMasks2DAutomask () override | |
Public Member Functions inherited from moveit_studio::behaviors::AsyncBehaviorBase | |
| AsyncBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources) | |
| virtual | ~AsyncBehaviorBase ()=default |
| BT::NodeStatus | onStart () override |
| Required implementation of BT::StatefulActionNode::onStart(). | |
| BT::NodeStatus | onRunning () override |
| Required implementation of BT::StatefulActionNode::onRunning(). | |
| void | onHalted () override |
| Required implementation of BT::StatefulActionNode::onHalted(). | |
| void | resetStatus () |
| Resets the internal status of this node. | |
Public Member Functions inherited from moveit_studio::behaviors::SharedResourcesNode< BT::StatefulActionNode > | |
| 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 () |
| Provides port definitions for BehaviorTree. | |
| static BT::KeyValueVector | metadata () |
| Provides behavior metadata for UI. | |
Protected Member Functions | |
| tl::expected< bool, std::string > | doWork () override |
| Execute automasking. | |
Protected Member Functions inherited from moveit_studio::behaviors::AsyncBehaviorBase | |
| virtual tl::expected< void, std::string > | doHalt () |
| Optionally implement additional work needed to cleanly interrupt the async process. | |
| void | notifyCanHalt () |
| Called when runAsync() finishes to notify onHalted() that the async process has finished. | |
Additional Inherited Members | |
Protected Attributes inherited from moveit_studio::behaviors::SharedResourcesNode< BT::StatefulActionNode > | |
| std::shared_ptr< BehaviorContext > | shared_resources_ |
Segment an image using SAM2 automasking with grid-based point generation.
This behavior automatically segments an image by generating a uniform grid of points and running SAM2 inference on each point. Applies NMS to remove overlapping masks and splits disconnected components.
| Data Port Name | Port Type | Object Type |
|---|---|---|
| image | input | sensor_msgs::msg::Image |
| grid_size | input | int |
| score_threshold | input | float |
| nms_threshold | input | float |
| min_component_area | input | int |
| encoder_model_path | input | std::string |
| prompt_encoder_model_path | input | std::string |
| decoder_model_path | input | std::string |
| model_package | input | std::string |
| masks2d | output | std::vector<moveit_studio_vision_msgs::msg::Mask2D> |
| mask_count | output | int |
| moveit_studio::behaviors::GetMasks2DAutomask::GetMasks2DAutomask | ( | const std::string & | name, |
| const BT::NodeConfiguration & | config, | ||
| const std::shared_ptr< moveit_studio::behaviors::BehaviorContext > & | shared_resources, | ||
| std::unique_ptr< InferenceHandle > | inference_handle = std::make_unique<SAM2AutomaskHandle>() |
||
| ) |
Constructor for SAM2 automasking behavior.
| name | Behavior instance name |
| config | Behavior configuration |
| shared_resources | Shared behavior resources |
| inference_handle | Custom inference implementation (default uses SAM2AutomaskHandle) |
|
overridedefault |
|
overrideprotectedvirtual |
Execute automasking.
Implements moveit_studio::behaviors::AsyncBehaviorBase.
|
static |
Provides behavior metadata for UI.
|
static |
Provides port definitions for BehaviorTree.