MoveIt Pro Behavior
Core Behaviors for MoveIt Pro
|
Segment an image using the SAM 2 model and point prompts. More...
#include <sam2_segmentation.hpp>
Public Member Functions | |
GetMasks2DFromPointQuery (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< moveit_studio::behaviors::BehaviorContext > &shared_resources, std::unique_ptr< GetMasks2DFromPointQueryInterface > sam2_interface=std::make_unique< GetMasks2DFromPointQueryInterface >()) | |
Constructor for the GetMasks2DFromPointQuery behavior. | |
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 () |
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. | |
Protected Member Functions | |
tl::expected< bool, std::string > | doWork () override |
User-implemented function which handles executing the potentially-long-running process. | |
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. | |
Protected Attributes | |
std::unique_ptr< GetMasks2DFromPointQueryInterface > | sam2_interface_ |
Protected Attributes inherited from moveit_studio::behaviors::SharedResourcesNode< BT::StatefulActionNode > | |
std::shared_ptr< BehaviorContext > | shared_resources_ |
Segment an image using the SAM 2 model and point prompts.
moveit_studio::behaviors::GetMasks2DFromPointQuery::GetMasks2DFromPointQuery | ( | const std::string & | name, |
const BT::NodeConfiguration & | config, | ||
const std::shared_ptr< moveit_studio::behaviors::BehaviorContext > & | shared_resources, | ||
std::unique_ptr< GetMasks2DFromPointQueryInterface > | sam2_interface = std::make_unique<GetMasks2DFromPointQueryInterface>() |
||
) |
Constructor for the GetMasks2DFromPointQuery behavior.
name | The 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. |
config | This 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_resources | Provides access to common resources such as the node handle and failure logger that are shared between all the behaviors that inherit from moveit_studio::behaviors::SharedResourcesNode. |
sam2_interface | An implementation of the GetMasks2DFromPointQueryInterface. The default argument uses SAM 2 for segmentation. |
An important limitation is that the members of the base Behavior class are not instantiated until after the initialize() function is called, so these classes should not be used within the constructor.
|
overrideprotectedvirtual |
User-implemented function which handles executing the potentially-long-running process.
This function is called within an async process in a separate thread.
Implements moveit_studio::behaviors::AsyncBehaviorBase.
|
static |
Implementation of the metadata() function for displaying metadata, such as Behavior description and subcategory, in the MoveIt Studio Developer Tool.
|
static |
Implementation of the required providedPorts() function for the Behavior.
The BehaviorTree.CPP library requires that Behaviors must implement a static function named providedPorts() which defines their input and output ports. If the Behavior does not use any ports, this function must return an empty BT::PortsList. This function returns a list of ports with their names and port info, which is used internally by the behavior tree.
|
protected |