MoveIt Pro Behavior
Core Behaviors for MoveIt Pro
moveit_studio::behaviors::TeleoperateBase< CommandT > Class Template Referenceabstract

This is a special Behavior to enable manual teleoperation using MoveIt Servo through the Objective Server. More...

#include <teleoperate_base.hpp>

Inheritance diagram for moveit_studio::behaviors::TeleoperateBase< CommandT >:
Collaboration diagram for moveit_studio::behaviors::TeleoperateBase< CommandT >:

Public Member Functions

 TeleoperateBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
 Constructor for the TeleoperateBase Behavior. More...
 
- 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(). More...
 
BT::NodeStatus onRunning () override
 Required implementation of BT::StatefulActionNode::onRunning(). More...
 
void onHalted () override
 Required implementation of BT::StatefulActionNode::onHalted(). More...
 
void resetStatus ()
 Resets the internal status of this node. More...
 
- 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. More...
 

Protected Member Functions

tl::expected< bool, std::string > doWork () override
 Validate service clients, start the MoveIt Servo server, and create subscribers for Servo commands. More...
 
tl::expected< void, std::string > doHalt () override
 Stops teleoperation by halting publishing servo commands and pausing the MoveIt Servo server. More...
 
- Protected Member Functions inherited from moveit_studio::behaviors::AsyncBehaviorBase
void notifyCanHalt ()
 Called when runAsync() finishes to notify onHalted() that the async process has finished. More...
 

Additional Inherited Members

- Protected Attributes inherited from moveit_studio::behaviors::SharedResourcesNode< BT::StatefulActionNode >
std::shared_ptr< BehaviorContextshared_resources_
 

Detailed Description

template<typename CommandT>
class moveit_studio::behaviors::TeleoperateBase< CommandT >

This is a special Behavior to enable manual teleoperation using MoveIt Servo through the Objective Server.

When started, this Behavior will run INDEFINITELY until it is halted. This will happen either when the root node of the behavior tree is halted as the Objective is canceled, or when this Behavior's parent control node halts it. When this Behavior first transitions from IDLE to RUNNING, it starts Servo control using the services advertised by the Servo server node. While this Behavior is RUNNING, it subscribes to command messages that originate in the user interface, and republishes these messages to the command topics advertised by the Servo server node. When this Behavior is halted, it pauses Servo control using the server's services.

The template parameter CommandT is the ROS message type used to specialize this class. This can be one of the valid MoveIt Servo command types, including: control_msgs::msg::JointJog - For joint jogging geometry_msgs::msg::TwistStamped - For Cartesian jogging geometry_msgs::msg::PoseStamped - For pose tracking

Data Port Name Port Type Object Type
controller_name Input std::string

Constructor & Destructor Documentation

◆ TeleoperateBase()

template<typename CommandT >
moveit_studio::behaviors::TeleoperateBase< CommandT >::TeleoperateBase ( const std::string &  name,
const BT::NodeConfiguration &  config,
const std::shared_ptr< BehaviorContext > &  shared_resources 
)

Constructor for the TeleoperateBase Behavior.

Parameters
nameName of the Behavior. Used internally by BehaviorTree.CPP.
configBehaviorTree.CPP NodeConfiguration. Used internally by BehaviorTree.CPP.
shared_resourcesShared pointer to the ObjectiveServerNode's BehaviorContext. Passed to the constructor of SharedResourcesNode, where it is used as a member variable.

Member Function Documentation

◆ doHalt()

template<typename CommandT >
tl::expected< void, std::string > moveit_studio::behaviors::TeleoperateBase< CommandT >::doHalt
overrideprotectedvirtual

Stops teleoperation by halting publishing servo commands and pausing the MoveIt Servo server.

Reimplemented from moveit_studio::behaviors::AsyncBehaviorBase.

◆ doWork()

template<typename CommandT >
tl::expected< bool, std::string > moveit_studio::behaviors::TeleoperateBase< CommandT >::doWork
overrideprotectedvirtual

Validate service clients, start the MoveIt Servo server, and create subscribers for Servo commands.

This will run until the behavior is halted, and will not terminate on its own.

Implements moveit_studio::behaviors::AsyncBehaviorBase.


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