Skip to main content

DoTeleoperateAction Class

Starts teleoperation by sending a goal to the teleoperation action server in the web UI. More...

Declaration

class moveit_pro::behaviors::DoTeleoperateAction { ... }

Included Headers

#include <do_teleoperate_action.hpp>

Base class

classActionClientBehaviorBase<ActionT>

A base class for behaviors which need to send a goal to a ROS action client and wait for a result. If the behavior is halted before the action result is received, the action goal will be canceled. More...

Public Constructors Index

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

Constructor for DoTeleoperateAction behavior. More...

DoTeleoperateAction (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< ClientInterfaceBase > client_interface)

Overload for constructor which allows providing an alternate action client interface. Useful for unit testing, but not a requirement. More...

Private Member Functions Index

tl::expected< std::string, std::string >getActionName () override

Gets the teleoperate action name, which is fixed for this Behavior. More...

tl::expected< std::chrono::duration< double >, std::string >getResultTimeout () override

Sets the maximum duration to wait for the teleoperate action goal to succeed before failing. More...

tl::expected< DoTeleoperate::Goal, std::string >createGoal () override

Creates the action goal from the input port values specified by the user. More...

voidprocessFeedback (const std::shared_ptr< const DoTeleoperate::Feedback > feedback) override

Sets the latest teleoperation status to an output port. More...

tl::expected< bool, std::string >processResult (const std::shared_ptr< DoTeleoperate::Result > result) override

Gets the success status of the teleoperate action and converts it to SUCCESS/FAILURE for the Behavior. More...

std::stringgetServerUnavailableMessage (const std::string &action_name) const override

Returns a descriptive error message explaining that the /do_teleoperate action server is provided by the MoveIt Pro web UI, and guiding the user to open or refresh the browser. More...

std::shared_future< tl::expected< bool, std::string > > &getFuture () override

Classes derived from ActionClientBehaviorBase must implement getFuture() so that it returns a shared_future class member. More...

Private Member Attributes Index

std::shared_future< tl::expected< bool, std::string > >future_

Classes derived from ActionClientBehaviorBase must have this shared_future as a class member. More...

Public Static Functions Index

static BT::PortsListprovidedPorts ()

Custom tree nodes that have input and/or output ports must define them in this static function. More...

static BT::KeyValueVectormetadata ()

Description

Starts teleoperation by sending a goal to the teleoperation action server in the web UI.

This goal contains configuration options for enabling user interactions and prompts, as well as setting the initial teleoperation mode for the UI to appear in. While the initial and current teleoperation modes are specified as integer values, these values correspond to the enumerations in the moveit_studio_sdk_msgs::msg::TeleoperationMode ROS message.

The UI will send feedback messages containing the current teleoperation mode selected in the UI, as well as the selected planning groups that should be teleoperated, with the controllers associated with each group and their tip links.

Data Port NamePort TypeObject Type
enable_user_interactioninputbool
user_interaction_promptinputstd::string
initial_teleop_modeinputint
current_teleop_modeoutputint
planning_groupsoutputstd::vector<std::string>
controllersoutputstd::vector<std::string>
tip_linksoutputstd::vector<std::string>
skip_collision_checksoutputbool
velocity_scale_factoroutputdouble
require_user_approvaloutputbool

require_user_approval: if true, downstream Objectives (e.g. Move to Cartesian Pose) require an explicit Apply click before executing. Derived as the inverse of the FEEDBACK channel's skip_user_approval field, so it defaults to approval-required when a client omits it.

Definition at line 47 of file do_teleoperate_action.hpp.

Public Constructors

DoTeleoperateAction()

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

Constructor for DoTeleoperateAction behavior.

Parameters
name

Name of the node. Must match the name used for this node in the behavior tree definition file (the .xml file).

config

Node configuration. Only used here because the BehaviorTree.CPP expects constructor signature with name and config first before custom constructor parameters.

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_pro::behaviors::SharedResourcesNode.

Declaration at line 59 of file do_teleoperate_action.hpp, definition at line 35 of file do_teleoperate_action.cpp.

DoTeleoperateAction()

moveit_pro::behaviors::DoTeleoperateAction::DoTeleoperateAction (const std::string & name, const BT::NodeConfiguration & config, const std::shared_ptr< BehaviorContext > & shared_resources, std::unique_ptr< ClientInterfaceBase > client_interface)
explicit

Overload for constructor which allows providing an alternate action client interface. Useful for unit testing, but not a requirement.

Declaration at line 66 of file do_teleoperate_action.hpp, definition at line 41 of file do_teleoperate_action.cpp.

Private Member Functions

createGoal()

tl::expected< DoTeleoperate::Goal, std::string > moveit_pro::behaviors::DoTeleoperateAction::createGoal ()
virtual

Creates the action goal from the input port values specified by the user.

Returns

Returns the action goal message if successful.

Declaration at line 98 of file do_teleoperate_action.hpp, definition at line 104 of file do_teleoperate_action.cpp.

getActionName()

tl::expected< std::string, std::string > moveit_pro::behaviors::DoTeleoperateAction::getActionName ()
virtual

Gets the teleoperate action name, which is fixed for this Behavior.

Returns

The name of the action for the DoTeleoperate action client.

Declaration at line 84 of file do_teleoperate_action.hpp, definition at line 94 of file do_teleoperate_action.cpp.

getFuture()

std::shared_future< tl::expected< bool, std::string > > & moveit_pro::behaviors::DoTeleoperateAction::getFuture ()
inline virtual

Classes derived from ActionClientBehaviorBase must implement getFuture() so that it returns a shared_future class member.

Definition at line 117 of file do_teleoperate_action.hpp.

getResultTimeout()

tl::expected< std::chrono::duration< double >, std::string > moveit_pro::behaviors::DoTeleoperateAction::getResultTimeout ()
virtual

Sets the maximum duration to wait for the teleoperate action goal to succeed before failing.

This returns a constant duration which isn't configurable by the end user. The main purpose of this timeout is to make sure Objective execution does not get stuck forever if the teleoperate action server becomes unresponsive.

Returns

The timeout duration.

Declaration at line 92 of file do_teleoperate_action.hpp, definition at line 99 of file do_teleoperate_action.cpp.

getServerUnavailableMessage()

std::string moveit_pro::behaviors::DoTeleoperateAction::getServerUnavailableMessage (const std::string & action_name)
virtual

Returns a descriptive error message explaining that the /do_teleoperate action server is provided by the MoveIt Pro web UI, and guiding the user to open or refresh the browser.

Declaration at line 114 of file do_teleoperate_action.hpp, definition at line 143 of file do_teleoperate_action.cpp.

processFeedback()

void moveit_pro::behaviors::DoTeleoperateAction::processFeedback (const std::shared_ptr< const DoTeleoperate::Feedback > feedback)

Sets the latest teleoperation status to an output port.

Declaration at line 103 of file do_teleoperate_action.hpp, definition at line 125 of file do_teleoperate_action.cpp.

processResult()

tl::expected< bool, std::string > moveit_pro::behaviors::DoTeleoperateAction::processResult (const std::shared_ptr< DoTeleoperate::Result > result)

Gets the success status of the teleoperate action and converts it to SUCCESS/FAILURE for the Behavior.

Declaration at line 108 of file do_teleoperate_action.hpp, definition at line 138 of file do_teleoperate_action.cpp.

Private Member Attributes

future_

std::shared_future<tl::expected<bool, std::string> > moveit_pro::behaviors::DoTeleoperateAction::future_

Classes derived from ActionClientBehaviorBase must have this shared_future as a class member.

Definition at line 123 of file do_teleoperate_action.hpp.

Public Static Functions

metadata()

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

Declaration at line 77 of file do_teleoperate_action.hpp, definition at line 86 of file do_teleoperate_action.cpp.

providedPorts()

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

Custom tree nodes that have input and/or output ports must define them in this static function.

This function must be static. It is a requirement set by the BehaviorTree.CPP library.

Returns

List of ports with the names and port info. The return value is for the internal use of the behavior tree.

Declaration at line 75 of file do_teleoperate_action.hpp, definition at line 48 of file do_teleoperate_action.cpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.