MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
moveit_pro::behaviors::SetMujocoState Class Referencefinal

Sets MuJoCo simulation state to specified joint positions. More...

#include <set_mujoco_state.hpp>

Inheritance diagram for moveit_pro::behaviors::SetMujocoState:
Collaboration diagram for moveit_pro::behaviors::SetMujocoState:

Public Member Functions

 SetMujocoState (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
 Constructor for SetMujocoState behavior.
 
 SetMujocoState (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase< moveit_studio_internal_msgs::srv::SetMujocoJointStates > > client_interface)
 
- Public Member Functions inherited from moveit_pro::behaviors::ServiceClientBehaviorBase< moveit_studio_internal_msgs::srv::SetMujocoJointStates >
 ServiceClientBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
 Constructs ServiceClientBehaviorBase using the RclcppClientInterface.
 
 ServiceClientBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase< moveit_studio_internal_msgs::srv::SetMujocoJointStates > > client_interface)
 Constructs ServiceClientBehaviorBase using a user-provided implementation of ClientInterfaceBase.
 
 ~ServiceClientBehaviorBase () override=default
 
- 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.
 
- 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 > &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 ()
 Defines the input/output ports for this behavior.
 
static BT::KeyValueVector metadata ()
 Provides metadata about the behavior for the behavior tree editor.
 

Additional Inherited Members

- Static Public Attributes inherited from moveit_pro::behaviors::ServiceClientBehaviorBase< moveit_studio_internal_msgs::srv::SetMujocoJointStates >
static constexpr std::chrono::seconds kTimeoutWaitForServiceServer
 
- Protected Member Functions inherited from moveit_pro::behaviors::ServiceClientBehaviorBase< moveit_studio_internal_msgs::srv::SetMujocoJointStates >
virtual tl::expected< std::chrono::duration< double >, std::string > getResponseTimeout ()
 Optional user-provided function to set the timeout used when waiting for the service response.
 
virtual tl::expected< std::chrono::duration< double >, std::string > getWaitForServerAvailableTimeout ()
 Optional user-provided function to set the timeout used when waiting for the service server to be available.
 
virtual tl::expected< bool, std::string > processResponse (const typename ServiceT::Response &)
 Optional user-provided function to process the service response after the service has finished.
 
tl::expected< void, std::string > doHalt () override
 Handles halting logic which is specific to the service client behavior implementation.
 
- Protected Member Functions inherited from moveit_pro::behaviors::AsyncBehaviorBase
void notifyCanHalt ()
 Called when runAsync() finishes to notify onHalted() that the async process has finished.
 
- Protected Attributes inherited from moveit_pro::behaviors::SharedResourcesNode< BT::StatefulActionNode >
std::shared_ptr< BehaviorContextshared_resources_
 

Detailed Description

Sets MuJoCo simulation state to specified joint positions.

This behavior reads a RobotJointState from an input port and calls /mujoco_system/set_joint_states to apply those positions in the simulation. Note: Does NOT handle controller management - use ListControllers and SwitchController to save/restore controller states if needed.

Data Port Name Port Type Object Type
service_name Input std::string
joint_state Input moveit_studio_agent_msgs::msg::RobotJointState

Constructor & Destructor Documentation

◆ SetMujocoState() [1/2]

moveit_pro::behaviors::SetMujocoState::SetMujocoState ( const std::string &  name,
const BT::NodeConfiguration &  config,
const std::shared_ptr< BehaviorContext > &  shared_resources 
)

Constructor for SetMujocoState behavior.

Parameters
nameName of the behavior node.
configBehaviorTree node configuration.
shared_resourcesShared resources for the behavior (ROS node, planning scene, etc.).

◆ SetMujocoState() [2/2]

moveit_pro::behaviors::SetMujocoState::SetMujocoState ( const std::string &  name,
const BT::NodeConfiguration &  config,
const std::shared_ptr< BehaviorContext > &  shared_resources,
std::unique_ptr< ClientInterfaceBase< moveit_studio_internal_msgs::srv::SetMujocoJointStates > >  client_interface 
)

Member Function Documentation

◆ metadata()

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

Provides metadata about the behavior for the behavior tree editor.

Returns
Key-value pairs describing subcategory and description.

◆ providedPorts()

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

Defines the input/output ports for this behavior.

Returns
List of ports with their types and descriptions.

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