MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
moveit_pro::behaviors::GetMasks2DFromPointQuery Struct Referencefinal

Segment an image using the SAM2 model and point prompts. More...

#include <sam2_segmentation.hpp>

Inheritance diagram for moveit_pro::behaviors::GetMasks2DFromPointQuery:
Collaboration diagram for moveit_pro::behaviors::GetMasks2DFromPointQuery:

Classes

struct  InferenceHandle
 Interface for SAM2 point-prompted segmentation inference. More...
 
struct  SAM2SegmentHandle
 Default implementation using SAM2Segment over the shared model pool. More...
 

Public Member Functions

 GetMasks2DFromPointQuery (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< moveit_pro::behaviors::BehaviorContext > &shared_resources, std::unique_ptr< InferenceHandle > inference_handle=std::make_unique< SAM2SegmentHandle >())
 Constructor for the GetMasks2DFromPointQuery behavior.
 
 ~GetMasks2DFromPointQuery () override
 
- Public Member Functions inherited from moveit_pro::behaviors::AsyncBehaviorBase
 AsyncBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
 
 ~AsyncBehaviorBase () override=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.
 
void notifyCanHalt ()
 Called when runAsync() finishes to notify onHalted() that the async process has finished.
 
- Public Member Functions inherited from moveit_pro::behaviors::SharedResourcesNode< BT::StatefulActionNode >
 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 ()
 Implementation of the required providedPorts() function for the Behavior.
 
static BT::KeyValueVector metadata ()
 Implementation of the metadata() function for displaying metadata, such as Behavior description and subcategory, in the MoveIt Studio Developer Tool.
 

Detailed Description

Segment an image using the SAM2 model and point prompts.

Data Port Name Port Type Object Type
image input sensor_msgs::msg::Image
pixel_coords input std::vector<geometry_msgs::msg::PointStamped>
model_bundle_manifest input std::string
runtime_id input std::string
model_package input std::string
masks2d output std::vector<moveit_studio_vision_msgs::msg::Mask2D>

Constructor & Destructor Documentation

◆ GetMasks2DFromPointQuery()

moveit_pro::behaviors::GetMasks2DFromPointQuery::GetMasks2DFromPointQuery ( const std::string &  name,
const BT::NodeConfiguration &  config,
const std::shared_ptr< moveit_pro::behaviors::BehaviorContext > &  shared_resources,
std::unique_ptr< InferenceHandle inference_handle = std::make_unique<SAM2SegmentHandle>() 
)

Constructor for the GetMasks2DFromPointQuery behavior.

Parameters
nameThe name of a particular instance of this Behavior. This will be set by the behavior tree factory when this Behavior is created within a new behavior tree.
configThis contains runtime configuration info for this Behavior, such as the mapping between the Behavior's data ports on the behavior tree's blackboard. This will be set by the behavior tree factory when this Behavior is created within a new behavior tree.
shared_resourcesProvides access to common resources such as the node handle and failure logger that are shared between all the behaviors that inherit from moveit_pro::behaviors::SharedResourcesNode.
inference_handleCustom inference implementation (default uses SAM2SegmentHandle).

◆ ~GetMasks2DFromPointQuery()

moveit_pro::behaviors::GetMasks2DFromPointQuery::~GetMasks2DFromPointQuery ( )
overridedefault

Member Function Documentation

◆ metadata()

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

Implementation of the metadata() function for displaying metadata, such as Behavior description and subcategory, in the MoveIt Studio Developer Tool.

Returns
A BT::KeyValueVector containing the Behavior metadata.

◆ providedPorts()

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

Implementation of the required providedPorts() function for the Behavior.

Returns
List of ports for the behavior.

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