MoveIt Pro Behavior
Core Behaviors for MoveIt Pro
|
Segment an image using the ClipSeg model. More...
#include <clipseg_segmentation.hpp>
Public Member Functions | |
GetMasks2DFromTextQuery (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< moveit_studio::behaviors::BehaviorContext > &shared_resources, std::unique_ptr< GetMasks2DFromTextQueryInterface > clipseg_interface=std::make_unique< GetMasks2DFromTextQueryInterface >()) | |
Constructor for the clipseg_segmentation behavior. | |
![]() | |
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. | |
![]() | |
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 sam2_segmentation 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. | |
void | calculate_logits (const std::vector< std::string > &prompts, const std::vector< std::string > &negative_prompts, moveit_pro_ml::ONNXImage &logits) const |
std::shared_future< tl::expected< bool, std::string > > & | getFuture () override |
Classes derived from AsyncBehaviorBase must implement getFuture() so that it returns a shared_future class member. | |
![]() | |
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::shared_ptr< GetMasks2DFromTextQueryInterface > | clipseg_interface_ |
moveit_pro_ml::ONNXImage | onnx_image_ |
sensor_msgs::msg::Image | image_ |
std::shared_future< tl::expected< bool, std::string > > | future_ |
Classes derived from AsyncBehaviorBase must have this shared_future as a class member. | |
![]() | |
std::shared_ptr< BehaviorContext > | shared_resources_ |
Segment an image using the ClipSeg model.
moveit_studio::behaviors::GetMasks2DFromTextQuery::GetMasks2DFromTextQuery | ( | const std::string & | name, |
const BT::NodeConfiguration & | config, | ||
const std::shared_ptr< moveit_studio::behaviors::BehaviorContext > & | shared_resources, | ||
std::unique_ptr< GetMasks2DFromTextQueryInterface > | clipseg_interface = std::make_unique<GetMasks2DFromTextQueryInterface>() |
||
) |
Constructor for the clipseg_segmentation 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. |
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.
|
protected |
|
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.
|
inlineoverrideprotectedvirtual |
Classes derived from AsyncBehaviorBase must implement getFuture() so that it returns a shared_future class member.
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 sam2_segmentation 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 |
|
protected |
Classes derived from AsyncBehaviorBase must have this shared_future as a class member.
|
protected |
|
protected |