MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
moveit_studio::behaviors::DiffusionPolicy Class Reference

Behavior for executing a pretrained diffusion policy in MoveIt Pro. More...

#include <diffusion_policy.hpp>

Inheritance diagram for moveit_studio::behaviors::DiffusionPolicy:
Collaboration diagram for moveit_studio::behaviors::DiffusionPolicy:

Public Types

using DiffusionPolicyObservationRecorderInterface = moveit_pro_ml_ros::DiffusionPolicyObservationRecorderInterface
 
using JTACClientInterface = jtac_client::JTACClientInterface
 

Public Member Functions

 DiffusionPolicy (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< DiffusionPolicyInterface > diffusion_policy_interface=std::make_unique< DiffusionPolicyInterface >(), std::unique_ptr< DiffusionPolicyObservationRecorderInterface > observation_recorder=nullptr, std::unique_ptr< JTACClientInterface > jtac_client=nullptr)
 Constructor for the DiffusionPolicy 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 DiffusionPolicy 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.
 

Additional Inherited Members

- Protected Member Functions inherited from moveit_studio::behaviors::AsyncBehaviorBase
void notifyCanHalt ()
 Called when runAsync() finishes to notify onHalted() that the async process has finished.
 
- Protected Attributes inherited from moveit_studio::behaviors::SharedResourcesNode< BT::StatefulActionNode >
std::shared_ptr< BehaviorContextshared_resources_
 

Detailed Description

Behavior for executing a pretrained diffusion policy in MoveIt Pro.

Member Typedef Documentation

◆ DiffusionPolicyObservationRecorderInterface

using moveit_studio::behaviors::DiffusionPolicy::DiffusionPolicyObservationRecorderInterface = moveit_pro_ml_ros::DiffusionPolicyObservationRecorderInterface

◆ JTACClientInterface

Constructor & Destructor Documentation

◆ DiffusionPolicy()

moveit_studio::behaviors::DiffusionPolicy::DiffusionPolicy ( const std::string &  name,
const BT::NodeConfiguration &  config,
const std::shared_ptr< BehaviorContext > &  shared_resources,
std::unique_ptr< DiffusionPolicyInterface diffusion_policy_interface = std::make_unique<DiffusionPolicyInterface>(),
std::unique_ptr< DiffusionPolicyObservationRecorderInterface observation_recorder = nullptr,
std::unique_ptr< JTACClientInterface jtac_client = nullptr 
)

Constructor for the DiffusionPolicy 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_studio::behaviors::SharedResourcesNode.
diffusion_policy_interfaceAn implementation of the DiffusionPolicyInterface. The default argument uses a default-constructed DiffusionPolicyInterface.
observation_recorderAn implementation of the DiffusionPolicyObservationRecorderInterface. If nullptr, the behavior will create a default instance of DiffusionPolicyObservationRecorder.
jtac_clientThe JTAC action client for sending the trajectories. If nullptr, the behavior will create a default instance of JTACClient.

Member Function Documentation

◆ metadata()

BT::KeyValueVector moveit_studio::behaviors::DiffusionPolicy::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_studio::behaviors::DiffusionPolicy::providedPorts ( )
static

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

Returns
Input ports to configure the diffusion policy execution.

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