Flexiv RDK APIs  2.1
Public Member Functions | Friends | List of all members
flexiv::rdk::Robot Class Reference

Main interface to control the robot, containing several function categories and background services. More...

#include <robot.hpp>

Public Member Functions

 Robot (const std::string &robot_sn, bool verbose=true, bool lite=false)
 [Blocking] Instantiate the robot control interface. RDK services will be started and establish connection with the target robot. More...
 
bool lite () const
 [Non-blocking] Whether this rdk::Robot instance is a lite one. More...
 
bool connected () const
 [Non-blocking] Whether the connection with the robot is established. More...
 
RobotInfo info () const
 [Non-blocking] General information about the robot. More...
 
Mode mode () const
 [Non-blocking] Current control mode of the robot. More...
 
std::map< JointGroup, RobotStatesstates () const
 [Non-blocking] Current states data of all existing joint groups of the robot. More...
 
std::map< JointGroup, RobotActionsactions () const
 [Non-blocking] Current actions data of all existing joint groups of the robot. More...
 
std::map< JointGroup, bool > stopped () const
 [Non-blocking] Whether specific joint groups of the robot have come to a complete stop. More...
 
bool all_stopped () const
 [Non-blocking] Whether all joint groups of the robot have come to a complete stop. More...
 
bool operational () const
 [Non-blocking] Whether the robot is ready to be operated, which requires the following conditions to be met: enabled, brakes fully released, in auto mode, no fault, and not in reduced state. More...
 
OperationalStatus operational_status () const
 [Non-blocking] Current operational status of the robot. More...
 
bool busy () const
 [Non-blocking] Whether the robot is busy. This includes any user commanded operations that requires the robot to execute. For example, plans, primitives, Cartesian and joint motions, etc. More...
 
bool fault () const
 [Non-blocking] Whether the robot is in fault state. More...
 
bool reduced () const
 [Non-blocking] Whether the robot is in reduced state. More...
 
bool recovery () const
 [Non-blocking] Whether the robot is in recovery state. More...
 
bool estop_released () const
 [Non-blocking] Whether all connected emergency stops (E-stops) are released. More...
 
bool enabling_device_on () const
 [Non-blocking] Whether the 3-position enabling device (e.g. enabling button on the motion bar) is in the ON position (the middle position). More...
 
bool reached_timeliness_failure_limit () const
 [Non-blocking] Whether the timeliness failure limit has been reached within a 1-second moving window. More...
 
std::vector< RobotEventevent_log () const
 [Non-blocking] Robot events stored since the last successful instantiation of this class. More...
 
void ServoOn ()
 [Blocking] Servo on the robot. If E-stop is released and there's no fault, the robot will release brakes, and becomes operational a few seconds later. More...
 
void Home (const std::vector< JointGroup > &groups={})
 [Blocking] Move the specified joint groups to the home posture using Home primitive. More...
 
void Brake (bool engage)
 [Blocking] Force robot brakes to engage or release during normal operation. Restrictions apply, see warning. More...
 
void SwitchMode (Mode mode)
 [Blocking] Switch the robot to a new control mode and wait for the mode transition to finish. More...
 
void Stop ()
 [Blocking] Stop the robot and transit its control mode to IDLE. More...
 
bool ClearFault (unsigned int timeout_sec=30)
 [Blocking] Try to clear minor or critical fault for the robot without a power cycle. More...
 
void SetGlobalVariables (const std::map< std::string, FlexivDataTypes > &global_vars)
 [Blocking] Set values to global variables that already exist in the robot. More...
 
std::map< std::string, FlexivDataTypesglobal_variables () const
 [Blocking] Existing global variables and their current values. More...
 
void SetTimelinessFailureLimit (double percentage=2.0)
 [Non-blocking] Set the maximum tolerable percentage of real-time commands that arrived the robot too late within a 1-second moving window. This only applies to the real-time control modes and functions marked as "Real-time (RT)" will throw an exception when this limit is reached. More...
 
void ExecutePlan (unsigned int index, bool continue_exec=false, bool block_until_started=true)
 [Blocking] Execute a plan by specifying its index. More...
 
void ExecutePlan (const std::string &name, bool continue_exec=false, bool block_until_started=true)
 [Blocking] Execute a plan by specifying its name. More...
 
void PausePlan (bool toggle)
 [Blocking] Pause or resume the execution of the current plan. More...
 
void StopPlan ()
 [Blocking] Stop the execution of the current plan. More...
 
std::vector< std::string > plan_list () const
 [Blocking] A list of all available plans. More...
 
PlanInfo plan_info () const
 [Blocking] Detailed information about the executing plan. Contains plan name, primitive name, node name, node path, node path time period, etc. More...
 
void SetBreakpointMode (bool is_enabled)
 [Blocking] Enable or disable the breakpoint mode during plan execution. When enabled, the executing plan will pause at the pre-defined breakpoints. Use StepBreakpoint() to continue the execution and pause at the next breakpoint. More...
 
void StepBreakpoint ()
 [Blocking] If breakpoint mode is enabled, step to the next breakpoint. The plan execution will continue and pause at the next breakpoint. More...
 
void SetVelocityScale (unsigned int velocity_scale)
 [Blocking] Set overall velocity scale of robot motions during plan and primitive execution. More...
 
void ExecutePrimitive (const std::map< JointGroup, PrimitiveArgs > &primitive_args, bool block_until_started=true)
 [Blocking] Execute primitive(s) on specified joint group(s). More...
 
std::map< JointGroup, PrimitiveStatesprimitive_states () const
 [Blocking] States data of the primitive(s) that are currently running. More...
 
void StreamJointTorque (const std::map< JointGroup, RtJointTorqueCmd > &cmds)
 [Non-blocking] Continuously stream joint torque commands of the specified joint group(s) to the robot. The commands are tracked by a high-performance joint torque controller. More...
 
void StreamJointPosition (const std::map< JointGroup, RtJointPositionCmd > &cmds)
 [Non-blocking] Continuously stream joint position, velocity, and acceleration commands of the specified joint group(s) to the robot. The commands are tracked by either the joint impedance controller or the joint position controller, depending on the control mode. More...
 
void SendJointPosition (const std::map< JointGroup, NrtJointPositionCmd > &cmds)
 [Non-blocking] Discretely send joint position and velocity commands of the specified joint group(s) to the robot. An internal motion generator will smoothen the discrete commands, which are then tracked by either the joint impedance controller or the joint position controller, depending on the control mode. More...
 
void SetJointImpedance (JointGroup group, const std::vector< double > &K_q, const std::vector< double > &Z_q={})
 [Blocking] Set impedance properties of the robot's joint motion controller used in the joint impedance control modes. More...
 
void SetMaxContactTorque (JointGroup group, const std::vector< double > &max_torques)
 [Blocking] Set maximum contact torques for the robot's joint motion controller used in the joint impedance control modes. The controller will regulate its output to maintain contact torques with the environment under the set values. More...
 
void SetJointInertiaScale (JointGroup group, const std::vector< double > &inertia_scales)
 [Blocking] Set inertia shaping scales for the robot's joint motion controller used in the joint impedance control modes. More...
 
void StreamCartesianMotionForce (const std::map< JointGroup, RtCartesianCmd > &cmds)
 [Non-blocking] Continuously stream Cartesian motion and/or force commands of the specified joint group(s) to the robot. The commands are tracked by a unified motion-force controller that allows force control in zero or more Cartesian axes and motion control in the other axes. More...
 
void SendCartesianMotionForce (const std::map< JointGroup, NrtCartesianCmd > &cmds)
 [Non-blocking] Discretely send Cartesian motion and/or force commands of the specified joint group(s) to the robot. An internal motion generator will smoothen the discrete commands, which are then tracked by a unified motion-force controller that allows force control in zero or more Cartesian axes and motion control in the other axes. The robot's internal motion generator will smoothen the discrete commands. More...
 
void SendCartesianMotionForceMultiWaypoint (const std::map< JointGroup, NrtCartesianMultiWaypointCmd > &cmds)
 [Non-blocking] Discretely send Cartesian multi-waypoint motion and/or force commands for the robot to track using non-real-time super primitives. More...
 
void SetCartesianImpedance (JointGroup group, const std::array< double, kCartDoF > &K_x, const std::array< double, kCartDoF > &Z_x={0.7, 0.7, 0.7, 0.7, 0.7, 0.7})
 [Blocking] Set impedance properties of the robot's Cartesian motion controller used in the Cartesian motion-force control modes. More...
 
void SetMaxContactWrench (JointGroup group, const std::array< double, kCartDoF > &max_wrench)
 [Blocking] Set maximum contact wrench for the motion control part of the Cartesian motion-force control modes. The controller will regulate its output to maintain contact wrench (force and moment) with the environment under the set values. More...
 
void SetNullSpacePosture (JointGroup group, const std::vector< double > &ref_positions)
 [Blocking] Set reference joint positions for the null-space posture control module used in the Cartesian motion-force control modes. More...
 
void SetNullSpaceObjectives (JointGroup group, double linear_manipulability=0.0, double angular_manipulability=0.0, double ref_positions_tracking=0.5)
 [Blocking] Set weights of the three optimization objectives while computing the robot's null-space posture. Change the weights to optimize robot performance for different use cases. More...
 
void SetForceControlAxis (JointGroup group, const std::array< bool, kCartDoF > &enabled_axes, const std::array< double, kCartDoF/2 > &max_linear_vel={1.0, 1.0, 1.0})
 [Blocking] Set Cartesian axes to enable force control while in the Cartesian motion-force control modes. Axes not enabled for force control will be motion-controlled. More...
 
void SetForceControlFrame (JointGroup group, CoordType root_coord, const std::array< double, kPoseSize > &T_in_root={0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0})
 [Blocking] Set reference frame for force control while in the Cartesian motion-force control modes. The force control frame is defined by specifying its transformation with regard to the root coordinate. More...
 
void SetPassiveForceControl (JointGroup group, bool is_enabled)
 [Blocking] Enable or disable passive force control for the Cartesian motion-force control modes. When enabled, an open-loop force controller will be used to feed forward the target wrench, i.e. passive force control. When disabled, a closed-loop force controller will be used to track the target wrench, i.e. active force control. More...
 
void SetDigitalOutputs (const std::map< unsigned int, bool > &digital_outputs)
 [Blocking] Set one or more digital output ports, including 16 on the control box plus 2 inside each wrist connector. More...
 
std::array< bool, kIOPorts > digital_inputs () const
 [Non-blocking] Current reading from all digital input ports, including 16 on the control box plus 2 in each wrist connector. More...
 
std::array< bool, kIOPorts > digital_outputs () const
 [Non-blocking] Current reading from all digital output ports, including 16 on the control box plus 2 in each wrist connector. More...
 

Friends

class Device
 
class FileIO
 
class Gripper
 
class Maintenance
 
class Model
 
class Safety
 
class Tool
 
class WorkCoord
 

Detailed Description

Main interface to control the robot, containing several function categories and background services.

Definition at line 23 of file robot.hpp.

Constructor & Destructor Documentation

◆ Robot()

flexiv::rdk::Robot::Robot ( const std::string &  robot_sn,
bool  verbose = true,
bool  lite = false 
)

[Blocking] Instantiate the robot control interface. RDK services will be started and establish connection with the target robot.

Parameters
[in]robot_snSerial number of the robot to connect. The accepted formats are: "Enlight-L-123456" and "Enlight L-123456". See ProductModel enum for all supported models.
[in]verboseEnable/disable info and warning prints.
[in]liteWhether to create a lite instance. See details below. A normal instance must have already connected to the robot for lite instances to function properly.
Exceptions
std::invalid_argumentif the format of [robot_sn] is invalid.
std::runtime_errorif the initialization sequence failed.
std::logic_errorif the connected robot does not have a valid RDK license, or is incompatible with this RDK library version, or is an unsupported product model.
Warning
This constructor blocks until the initialization sequence is successfully finished and connection with the robot is established.
Lite Instance
Creating multiple instances of rdk::Robot that connect to the same robot is allowed. However, every additional instance brings extra overhead that can restrict the total number of instances due to limited computation power and network bandwidth. To mitigate the performance impact, it is recommended to create a lite instance of rdk::Robot if it only needs to send one-shot requests, which are functions marked with the [Blocking] tag. A lite instance does not receive robot states or system status, nor send motion commands.

Member Function Documentation

◆ actions()

std::map<JointGroup, RobotActions> flexiv::rdk::Robot::actions ( ) const

[Non-blocking] Current actions data of all existing joint groups of the robot.

Returns
Robot actions data mapped by joint group.
Warning
Cartesian actions of non-single-arm joint groups are not populated.

◆ all_stopped()

bool flexiv::rdk::Robot::all_stopped ( ) const

[Non-blocking] Whether all joint groups of the robot have come to a complete stop.

Returns
True: all stopped; false: not all stopped.

◆ Brake()

void flexiv::rdk::Robot::Brake ( bool  engage)

[Blocking] Force robot brakes to engage or release during normal operation. Restrictions apply, see warning.

Parameters
[in]engageTrue: engage brakes; false: release brakes.
Exceptions
std::logic_errorif the connected robot is not a medical model or is moving.
std::runtime_errorif failed to engage/release the brakes.
Note
This function blocks until the brakes are successfully engaged/released.
Warning
This function is accessible only if a) the connected robot is a medical model AND b) the robot is not moving.

◆ busy()

bool flexiv::rdk::Robot::busy ( ) const

[Non-blocking] Whether the robot is busy. This includes any user commanded operations that requires the robot to execute. For example, plans, primitives, Cartesian and joint motions, etc.

Returns
True: busy; false: idle.
Warning
Some exceptions exist for primitives, see ExecutePrimitive() for more details.

◆ ClearFault()

bool flexiv::rdk::Robot::ClearFault ( unsigned int  timeout_sec = 30)

[Blocking] Try to clear minor or critical fault for the robot without a power cycle.

Parameters
[in]timeout_secMaximum time in seconds to wait for the fault to be successfully cleared. Normally, a minor fault should take no more than 3 seconds to clear, and a critical fault should take no more than 30 seconds to clear.
Returns
True: successfully cleared fault; false: failed to clear fault.
Exceptions
std::runtime_errorif failed to deliver the request to the connected robot.
Note
This function blocks until the fault is successfully cleared or [timeout_sec] has elapsed.
Warning
Clearing a critical fault through this function without a power cycle requires a dedicated device, which may not be installed in older robot models.

◆ connected()

bool flexiv::rdk::Robot::connected ( ) const

[Non-blocking] Whether the connection with the robot is established.

Returns
True: connected; false: disconnected.

◆ digital_inputs()

std::array<bool, kIOPorts> flexiv::rdk::Robot::digital_inputs ( ) const

[Non-blocking] Current reading from all digital input ports, including 16 on the control box plus 2 in each wrist connector.

Returns
A boolean array whose index corresponds to that of the digital input ports. True: port high; false: port low.

◆ digital_outputs()

std::array<bool, kIOPorts> flexiv::rdk::Robot::digital_outputs ( ) const

[Non-blocking] Current reading from all digital output ports, including 16 on the control box plus 2 in each wrist connector.

Returns
A boolean array whose index corresponds to that of the digital output ports. True: port high; false: port low.

◆ enabling_device_on()

bool flexiv::rdk::Robot::enabling_device_on ( ) const

[Non-blocking] Whether the 3-position enabling device (e.g. enabling button on the motion bar) is in the ON position (the middle position).

Returns
True: ON; false: OFF.

◆ estop_released()

bool flexiv::rdk::Robot::estop_released ( ) const

[Non-blocking] Whether all connected emergency stops (E-stops) are released.

Returns
True: released; false: pressed.

◆ event_log()

std::vector<RobotEvent> flexiv::rdk::Robot::event_log ( ) const

[Non-blocking] Robot events stored since the last successful instantiation of this class.

Returns
Event log as a vector of RobotEvent, with the first element being the oldest event and the last element being the latest event.
Warning
Events before the last successful instantiation of this class are not stored.

◆ ExecutePlan() [1/2]

void flexiv::rdk::Robot::ExecutePlan ( const std::string &  name,
bool  continue_exec = false,
bool  block_until_started = true 
)

[Blocking] Execute a plan by specifying its name.

Parameters
[in]nameName of the plan to execute, can be obtained via plan_list().
[in]continue_execWhether to continue executing the plan when the RDK program is closed or the connection is lost.
[in]block_until_startedWhether to wait for the commanded plan to finish loading and start execution before the function returns. Depending on the amount of computation needed to get the plan ready, the loading process typically takes no more than 200 ms.
Exceptions
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot or the robot is not operational.
Note
Applicable control modes: NRT_PLAN_EXECUTION.
This function blocks until the request is successfully delivered if [block_until_started] is disabled, or until the plan has started execution if [block_until_started] is enabled.
busy() can be used to check if the plan has finished.

◆ ExecutePlan() [2/2]

void flexiv::rdk::Robot::ExecutePlan ( unsigned int  index,
bool  continue_exec = false,
bool  block_until_started = true 
)

[Blocking] Execute a plan by specifying its index.

Parameters
[in]indexIndex of the plan to execute, can be obtained via plan_list().
[in]continue_execWhether to continue executing the plan when the RDK program is closed or the connection is lost.
[in]block_until_startedWhether to wait for the commanded plan to finish loading and start execution before the function returns. Depending on the amount of computation needed to get the plan ready, the loading process typically takes no more than 200 ms.
Exceptions
std::invalid_argumentif [index] is outside the valid range.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot or the robot is not operational.
Note
Applicable control modes: NRT_PLAN_EXECUTION.
This function blocks until the request is successfully delivered if [block_until_started] is disabled, or until the plan has started execution if [block_until_started] is enabled.
busy() can be used to check if the plan has finished.

◆ ExecutePrimitive()

void flexiv::rdk::Robot::ExecutePrimitive ( const std::map< JointGroup, PrimitiveArgs > &  primitive_args,
bool  block_until_started = true 
)

[Blocking] Execute primitive(s) on specified joint group(s).

Parameters
[in]primitive_argsPrimitive arguments mapped by joint group. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted.
[in]block_until_startedWhether to wait for the commanded primitive to finish loading and start execution before the function returns. Depending on the amount of computation needed to get the primitive ready, the loading process typically takes no more than 200 ms.
Exceptions
std::invalid_argumentif [primitive_args] contains joint groups that are not existing single-arm joint groups in the connected robot.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot or the robot is not operational.
Note
Applicable control modes: NRT_PRIMITIVE_EXECUTION.
This function blocks until the request is successfully delivered if [block_until_started] is disabled, or until the primitive has started execution if [block_until_started] is enabled. After this function returns, the primitive will still be running, thus the users need to implement their own blocking after calling this function. See examples for reference.
Warning
The primitive input parameters may not use SI units, please refer to the Flexiv Primitives documentation for exact unit definition.
Most primitives won't exit by themselves and require users to explicitly trigger transitions based on specific primitive states. In such case, busy() will stay true even if it seems everything is done for that primitive.

◆ fault()

bool flexiv::rdk::Robot::fault ( ) const

[Non-blocking] Whether the robot is in fault state.

Returns
True: robot has fault; false: robot normal.

◆ global_variables()

std::map<std::string, FlexivDataTypes> flexiv::rdk::Robot::global_variables ( ) const

[Blocking] Existing global variables and their current values.

Returns
A map of {global_var_name, global_var_value(s)}. Booleans are represented by int 1 and 0. For example, {{"camera_offset", {0.1, -0.2, 0.3}}, {"start_plan", 1}}.
Exceptions
std::runtime_errorif failed to get a reply from the connected robot.
Note
This function blocks until a reply is received.
See also
SetGlobalVariables().

◆ Home()

void flexiv::rdk::Robot::Home ( const std::vector< JointGroup > &  groups = {})

[Blocking] Move the specified joint groups to the home posture using Home primitive.

Parameters
[in]groupsJoint group(s) to home. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted. If left empty, home all applicable joint groups.
Exceptions
std::invalid_argumentif [groups] contains joint groups that are not existing single-arm joint groups in the connected robot.
std::runtime_errorif failed to execute the Home primitive.
Note
The robot's control mode will be temporarily switched to NRT_PRIMITIVE_EXECUTION and restored to the previous mode before returning.
This function blocks until all specified joint groups have reached the home posture.

◆ info()

RobotInfo flexiv::rdk::Robot::info ( ) const

[Non-blocking] General information about the robot.

Returns
Value copy of RobotInfo struct.

◆ lite()

bool flexiv::rdk::Robot::lite ( ) const

[Non-blocking] Whether this rdk::Robot instance is a lite one.

Returns
True: is a lite instance; false: not a lite instance.

◆ mode()

Mode flexiv::rdk::Robot::mode ( ) const

[Non-blocking] Current control mode of the robot.

Returns
Mode enum.

◆ operational()

bool flexiv::rdk::Robot::operational ( ) const

[Non-blocking] Whether the robot is ready to be operated, which requires the following conditions to be met: enabled, brakes fully released, in auto mode, no fault, and not in reduced state.

Returns
True: operational (operational_status() == READY); false: not operational.
Warning
The robot won't execute any user command until it's ready to be operated.

◆ operational_status()

OperationalStatus flexiv::rdk::Robot::operational_status ( ) const

[Non-blocking] Current operational status of the robot.

Returns
OperationalStatus enum.

◆ PausePlan()

void flexiv::rdk::Robot::PausePlan ( bool  toggle)

[Blocking] Pause or resume the execution of the current plan.

Parameters
[in]toggleTrue: pause plan; false: resume plan.
Exceptions
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: NRT_PLAN_EXECUTION.
This function blocks until the request is successfully delivered.
Warning
Internal plans (not created by user) cannot be resumed due to safety concerns.

◆ plan_info()

PlanInfo flexiv::rdk::Robot::plan_info ( ) const

[Blocking] Detailed information about the executing plan. Contains plan name, primitive name, node name, node path, node path time period, etc.

Returns
PlanInfo value copy.
Exceptions
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to get a reply from the connected robot.
Note
Applicable control modes: NRT_PLAN_EXECUTION.
This function blocks until a reply is received.

◆ plan_list()

std::vector<std::string> flexiv::rdk::Robot::plan_list ( ) const

[Blocking] A list of all available plans.

Returns
Available plans as a string list.
Exceptions
std::runtime_errorif failed to get a reply from the connected robot.
Note
This function blocks until a reply is received.

◆ primitive_states()

std::map<JointGroup, PrimitiveStates> flexiv::rdk::Robot::primitive_states ( ) const

[Blocking] States data of the primitive(s) that are currently running.

Returns
Primitive states data mapped by joint group. Only joint groups that are currently running primitives will be included.
Exceptions
std::runtime_errorif failed to get a reply from the connected robot.
Note
This function blocks until a reply is received.

◆ reached_timeliness_failure_limit()

bool flexiv::rdk::Robot::reached_timeliness_failure_limit ( ) const

[Non-blocking] Whether the timeliness failure limit has been reached within a 1-second moving window.

Returns
True: reached limit; false: not reached limit.
See also
SetTimelinessFailureLimit().

◆ recovery()

bool flexiv::rdk::Robot::recovery ( ) const

[Non-blocking] Whether the robot is in recovery state.

Returns
True: in recovery state; false: not in recovery state.
Note
Please use Flexiv Elements to get the robot out of recovery state.
Recovery state
The robot will enter recovery state if it needs to recover from joint position limit violation (a critical system fault that requires a recovery operation, during which the joints that moved outside the allowed position range will need to move very slowly back into the allowed range). Please refer to the robot user manual for more details about system recovery state.

◆ reduced()

bool flexiv::rdk::Robot::reduced ( ) const

[Non-blocking] Whether the robot is in reduced state.

Returns
True: in reduced state; false: not in reduced state.
Reduced state
The robot will enter reduced state if a) the safety input for reduced state goes low or b) robot TCP passes through any safety plane. The safety limits are lowered in reduced state compared to normal state. Specific values for the safety limits can be configured in Flexiv Elements under Settings -> Safety Configuration. Please refer to the robot user manual for more details about system reduced state.

◆ SendCartesianMotionForce()

void flexiv::rdk::Robot::SendCartesianMotionForce ( const std::map< JointGroup, NrtCartesianCmd > &  cmds)

[Non-blocking] Discretely send Cartesian motion and/or force commands of the specified joint group(s) to the robot. An internal motion generator will smoothen the discrete commands, which are then tracked by a unified motion-force controller that allows force control in zero or more Cartesian axes and motion control in the other axes. The robot's internal motion generator will smoothen the discrete commands.

Parameters
[in]cmdsNon-real-time Cartesian motion/force commands mapped by joint group. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted.
Exceptions
std::invalid_argumentif [cmds] contains a joint group that is not an existing single-arm joint group in the connected robot, or if any of the last 4 input parameters is not positive.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif the robot is not operational.
Note
Applicable control modes: NRT_CARTESIAN_MOTION_FORCE, NRT_SUPER_PRIMITIVE.
Warning
Same as Flexiv Elements, the target wrench is expressed as wrench sensed at TCP instead of wrench exerted by TCP. E.g. commanding f_z = +5 N will make the end-effector move towards -Z direction, so that upon contact, the sensed force will be +5 N.
How to achieve pure motion control?
Use SetForceControlAxis() to disable force control for all Cartesian axes to achieve pure motion control. This function does pure motion control by default.
How to achieve pure force control?
Use SetForceControlAxis() to enable force control for all Cartesian axes to achieve pure force control, active or passive.
How to achieve unified motion-force control?
Use SetForceControlAxis() to enable force control for one or more Cartesian axes and leave the rest axes motion-controlled, then provide target pose for the motion-controlled axes and target wrench for the force-controlled axes.
See also
SetCartesianImpedance(), SetMaxContactWrench(), SetNullSpacePosture(), SetForceControlAxis(), SetForceControlFrame(), SetPassiveForceControl().

◆ SendCartesianMotionForceMultiWaypoint()

void flexiv::rdk::Robot::SendCartesianMotionForceMultiWaypoint ( const std::map< JointGroup, NrtCartesianMultiWaypointCmd > &  cmds)

[Non-blocking] Discretely send Cartesian multi-waypoint motion and/or force commands for the robot to track using non-real-time super primitives.

Parameters
[in]cmdsNon-real-time Cartesian multi-waypoint commands mapped by joint group. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted.
Exceptions
std::invalid_argumentif [cmds] contains a joint group that is not an existing single-arm joint group in the connected robot, or if any waypoint list is empty or any waypoint's last 4 input parameters is not positive.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif the robot is not operational.
Note
Applicable control modes: NRT_SUPER_PRIMITIVE.
Warning
Same as Flexiv Elements, the target wrench is expressed as wrench sensed at TCP instead of wrench exerted by TCP. E.g. commanding f_z = +5 N will make the end-effector move towards -Z direction, so that upon contact, the sensed force will be +5 N.
See also
SetCartesianImpedance(), SetMaxContactWrench(), SetNullSpacePosture(), SetForceControlAxis(), SetForceControlFrame(), SetPassiveForceControl().

◆ SendJointPosition()

void flexiv::rdk::Robot::SendJointPosition ( const std::map< JointGroup, NrtJointPositionCmd > &  cmds)

[Non-blocking] Discretely send joint position and velocity commands of the specified joint group(s) to the robot. An internal motion generator will smoothen the discrete commands, which are then tracked by either the joint impedance controller or the joint position controller, depending on the control mode.

Parameters
[in]cmdsNon-real-time joint position-velocity-acceleration commands mapped by joint group. Only existing single-arm joint groups and external axis joint groups are accepted.
Exceptions
std::invalid_argumentif [cmds] contains a joint group that is not an existing single-arm or external axis joint group in the connected robot, if size of any input vector does not match robot DoF, or [dq_max] or [ddq_max] contains any non-positive value.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif the robot is not operational.
Note
Applicable control modes: NRT_JOINT_IMPEDANCE, NRT_JOINT_POSITION.
Warning
Calling this function a second time while the motion from the previous call is still ongoing will trigger an online re-planning of the joint trajectory, such that the previous command is aborted and the new command starts to execute.
See also
SetJointImpedance().

◆ ServoOn()

void flexiv::rdk::Robot::ServoOn ( )

[Blocking] Servo on the robot. If E-stop is released and there's no fault, the robot will release brakes, and becomes operational a few seconds later.

Exceptions
std::logic_errorif the robot is not connected or E-stop is not released.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
This function blocks until the request is successfully delivered.

◆ SetBreakpointMode()

void flexiv::rdk::Robot::SetBreakpointMode ( bool  is_enabled)

[Blocking] Enable or disable the breakpoint mode during plan execution. When enabled, the executing plan will pause at the pre-defined breakpoints. Use StepBreakpoint() to continue the execution and pause at the next breakpoint.

Parameters
[in]is_enabledTrue: enable; false: disable. By default, breakpoint mode is disabled.
Exceptions
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: NRT_PLAN_EXECUTION.
This function blocks until the request is successfully delivered.

◆ SetCartesianImpedance()

void flexiv::rdk::Robot::SetCartesianImpedance ( JointGroup  group,
const std::array< double, kCartDoF > &  K_x,
const std::array< double, kCartDoF > &  Z_x = {0.7, 0.7, 0.7, 0.7, 0.7, 0.7} 
)

[Blocking] Set impedance properties of the robot's Cartesian motion controller used in the Cartesian motion-force control modes.

Parameters
[in]groupThe joint group to set Cartesian impedance for. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted.
[in]K_xCartesian motion stiffness: \( K_x \in \mathbb{R}^{6 \times 1} \). Setting motion stiffness of a motion-controlled Cartesian axis to 0 will make this axis free-floating. Consists of \( \mathbb{R}^{3 \times 1} \) linear stiffness and \( \mathbb{R}^{3 \times 1} \) angular stiffness: \( [k_x, k_y, k_z, k_{Rx}, k_{Ry}, k_{Rz}]^T \). Valid range: [0, RobotInfo::K_x_nom]. Unit: \( [N/m]:[Nm/rad] \).
[in]Z_xCartesian motion damping ratio: \( Z_x \in \mathbb{R}^{6 \times 1} \). Consists of \( \mathbb{R}^{3 \times 1} \) linear damping ratio and \( \mathbb{R}^{3 \times 1} \) angular damping ratio: \( [\zeta_x, \zeta_y, \zeta_z, \zeta_{Rx}, \zeta_{Ry}, \zeta_{Rz}]^T \). Valid range: [0.3, 0.8]. The nominal (safe) value is provided as default.
Exceptions
std::invalid_argumentif [group] is not an existing single-arm joint group in the connected robot, or if [K_x] or [Z_x] contains any value outside the valid range.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: RT_CARTESIAN_MOTION_FORCE, NRT_CARTESIAN_MOTION_FORCE, NRT_SUPER_PRIMITIVE.
This function blocks until the request is successfully delivered.
Warning
Changing damping ratio [Z_x] to a non-nominal value may lead to performance and stability issues, please use with caution.

◆ SetDigitalOutputs()

void flexiv::rdk::Robot::SetDigitalOutputs ( const std::map< unsigned int, bool > &  digital_outputs)

[Blocking] Set one or more digital output ports, including 16 on the control box plus 2 inside each wrist connector.

Parameters
[in]digital_outputsA map of {port_index, port_value}. For [port_index], the valid range is [0, 17]. For [port_value], true: set port high, false: set port low. For example, {{1, true}, {3, false}, {10, true}}.
Exceptions
std::invalid_argumentif any provided port index is outside the valid range.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
This function blocks until the request is successfully delivered.

◆ SetForceControlAxis()

void flexiv::rdk::Robot::SetForceControlAxis ( JointGroup  group,
const std::array< bool, kCartDoF > &  enabled_axes,
const std::array< double, kCartDoF/2 > &  max_linear_vel = {1.0, 1.0, 1.0} 
)

[Blocking] Set Cartesian axes to enable force control while in the Cartesian motion-force control modes. Axes not enabled for force control will be motion-controlled.

Parameters
[in]groupThe joint group to set force control axes for. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted.
[in]enabled_axesFlags to enable/disable force control for certain Cartesian axes in the force control reference frame (configured by SetForceControlFrame()). The axis order is \( [X, Y, Z, Rx, Ry, Rz] \).
[in]max_linear_velFor linear Cartesian axes that are enabled for force control, limit the moving velocity to these values as a protection mechanism in case of contact loss. The axis order is \( [X, Y, Z] \). Valid range: [0.005, 2.0]. Unit: \( [m/s] \).
Exceptions
std::invalid_argumentif [group] is not an existing single-arm joint group in the connected robot, or if [max_linear_vel] contains any value outside the valid range.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: RT_CARTESIAN_MOTION_FORCE, NRT_CARTESIAN_MOTION_FORCE, NRT_SUPER_PRIMITIVE.
This function blocks until the request is successfully delivered.
If not set, force control is disabled for all Cartesian axes by default.
Warning
The maximum linear velocity protection for force control axes is only effective under active force control (i.e. passive force control disabled), see SetPassiveForceControl().

◆ SetForceControlFrame()

void flexiv::rdk::Robot::SetForceControlFrame ( JointGroup  group,
CoordType  root_coord,
const std::array< double, kPoseSize > &  T_in_root = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0} 
)

[Blocking] Set reference frame for force control while in the Cartesian motion-force control modes. The force control frame is defined by specifying its transformation with regard to the root coordinate.

Parameters
[in]groupThe joint group to set force control frame for. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted.
[in]root_coordReference coordinate of [T_in_root].
[in]T_in_rootTransformation from [root_coord] to the user-defined force control frame: \( ^{root}T_{force} \in \mathbb{R}^{7 \times 1} \). Consists of \( \mathbb{R}^{3 \times 1} \) position and \( \mathbb{R}^{4 \times 1} \) quaternion: \( [x, y, z, q_w, q_x, q_y, q_z]^T \). Unit: \( [m]:[] \). If root coordinate is a fixed one (e.g. WORLD), then the force control frame will also be fixed; if root coordinate is a moving one (e.g. TCP), then the force control frame will also be moving with the root coordinate. An identity transformation is provided as default.
Exceptions
std::invalid_argumentif [group] is not an existing single-arm joint group in the connected robot, or if [root_coord] is invalid.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: RT_CARTESIAN_MOTION_FORCE, NRT_CARTESIAN_MOTION_FORCE, NRT_SUPER_PRIMITIVE.
This function blocks until the request is successfully delivered.
If not set, the robot will use WORLD origin as the force control frame by default.
Force control frame
In Cartesian motion-force control modes, the reference frame of motion control is always the world frame, but the reference frame of force control can be an arbitrary one. While the world frame is the commonly used global coordinate, the current TCP frame is a dynamic local coordinate whose transformation with regard to the world frame changes as the robot TCP moves. When using world frame with no transformation as the force control frame, the force-controlled axes and motion-controlled axes are guaranteed to be orthogonal. Otherwise, the force-controlled axes and motion-controlled axes are NOT guaranteed to be orthogonal because different reference frames are used. In this case, it's recommended but not required to set the target pose such that the actual robot motion direction(s) are orthogonal to force direction(s). If they are not orthogonal, the motion control's vector component(s) in the force direction(s) will be eliminated.

◆ SetGlobalVariables()

void flexiv::rdk::Robot::SetGlobalVariables ( const std::map< std::string, FlexivDataTypes > &  global_vars)

[Blocking] Set values to global variables that already exist in the robot.

Parameters
[in]global_varsA map of {global_var_name, global_var_value(s)}. Use int 1 and 0 to represent booleans. For example, {{"camera_offset", {0.1, -0.2, 0.3}}, {"start_plan", 1}}.
Exceptions
std::length_errorif [global_vars] is empty.
std::invalid_argumentif any of the specified global variables does not exist.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
This function blocks until the global variables are successfully set.
Warning
The specified global variables need to be created first using Flexiv Elements.
See also
global_variables().

◆ SetJointImpedance()

void flexiv::rdk::Robot::SetJointImpedance ( JointGroup  group,
const std::vector< double > &  K_q,
const std::vector< double > &  Z_q = {} 
)

[Blocking] Set impedance properties of the robot's joint motion controller used in the joint impedance control modes.

Parameters
[in]groupThe joint group to set impedance properties for. Only existing single-arm joint groups and external axis joint groups are accepted.
[in]K_qJoint motion stiffness: \( K_q \in \mathbb{R}^{n \times 1} \). Setting motion stiffness of a joint axis to 0 will make this axis free-floating. Valid range: [0, RobotInfo::K_q_nom]. Unit: \( [Nm/rad] \).
[in]Z_qJoint motion damping ratio: \( Z_q \in \mathbb{R}^{n \times 1} \). Valid range: [0.3, 0.8]. The default value 0.7 will be used if left empty.
Exceptions
std::invalid_argumentif [group] is not an existing single-arm or external axis joint group in the connected robot, if [K_q] or [Z_q] contains any value outside the valid range, or if size of any input vector does not match robot DoF.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: RT_JOINT_IMPEDANCE, NRT_JOINT_IMPEDANCE.
This function blocks until the request is successfully delivered.
Warning
Changing damping ratio [Z_q] to a non-nominal value may lead to performance and stability issues, please use with caution.

◆ SetJointInertiaScale()

void flexiv::rdk::Robot::SetJointInertiaScale ( JointGroup  group,
const std::vector< double > &  inertia_scales 
)

[Blocking] Set inertia shaping scales for the robot's joint motion controller used in the joint impedance control modes.

Parameters
[in]groupThe joint group to set inertia shaping scales for. Only existing single-arm joint groups and external axis joint groups are accepted.
[in]inertia_scalesInertia shaping scales: \( \sigma_q \in \mathbb{R}^{n \times 1} \). Valid range: [0.75, 1.0]. The nominal (safe) value is 1.0, which means no shaping.
Exceptions
std::invalid_argumentif [group] is not an existing single-arm or external axis joint group in the connected robot, if [inertia_scales] contains any value outside the valid range, or if its size does not match robot DoF.
std::logic_errorif the robot is not in an applicable control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: RT_JOINT_IMPEDANCE, NRT_JOINT_IMPEDANCE.
This function blocks until the request is successfully delivered.
Joint inertia shaping
In joint impedance control modes, it is possible to shape down the natural inertia of the joints to make them behave as if they are lighter. The parameter [inertia_scales] sets the scale of shaped/natural inertia for each joint. Smaller scale corresponds to lighter inertia.

◆ SetMaxContactTorque()

void flexiv::rdk::Robot::SetMaxContactTorque ( JointGroup  group,
const std::vector< double > &  max_torques 
)

[Blocking] Set maximum contact torques for the robot's joint motion controller used in the joint impedance control modes. The controller will regulate its output to maintain contact torques with the environment under the set values.

Parameters
[in]groupThe joint group to set maximum contact torques for. Only existing single-arm joint groups and external axis joint groups are accepted.
[in]max_torquesMaximum contact torques: \( tau_q \in \mathbb{R}^{n \times 1} \). Valid range: [0, RobotInfo::tau_max]. Unit: \( [Nm] \).
Exceptions
std::invalid_argumentif [group] is not an existing single-arm or external axis joint group in the connected robot, if [max_torques] contains any value outside the valid range, or if its size does not match robot DoF.
std::logic_errorif the robot is not in an applicable control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: RT_JOINT_IMPEDANCE, NRT_JOINT_IMPEDANCE.
This function blocks until the request is successfully delivered.

◆ SetMaxContactWrench()

void flexiv::rdk::Robot::SetMaxContactWrench ( JointGroup  group,
const std::array< double, kCartDoF > &  max_wrench 
)

[Blocking] Set maximum contact wrench for the motion control part of the Cartesian motion-force control modes. The controller will regulate its output to maintain contact wrench (force and moment) with the environment under the set values.

Parameters
[in]groupThe joint group to set maximum contact wrench for. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted.
[in]max_wrenchMaximum contact wrench (force and moment): \( F_{max} \in \mathbb{R}^{6 \times 1} \). Consists of \( \mathbb{R}^{3 \times 1} \) maximum force and \( \mathbb{R}^{3 \times 1} \) maximum moment: \( [f_x, f_y, f_z, m_x, m_y, m_z]^T \). Unit: \( [N]:[Nm] \).
Exceptions
std::invalid_argumentif [group] is not an existing single-arm joint group in the connected robot, or if [max_wrench] contains any negative value.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
The maximum contact wrench regulation only applies to the motion control part.
Applicable control modes: RT_CARTESIAN_MOTION_FORCE, NRT_CARTESIAN_MOTION_FORCE, NRT_SUPER_PRIMITIVE.
This function blocks until the request is successfully delivered.
Warning
The maximum contact wrench regulation cannot be enabled if any of the rotational Cartesian axes is enabled for moment control.

◆ SetNullSpaceObjectives()

void flexiv::rdk::Robot::SetNullSpaceObjectives ( JointGroup  group,
double  linear_manipulability = 0.0,
double  angular_manipulability = 0.0,
double  ref_positions_tracking = 0.5 
)

[Blocking] Set weights of the three optimization objectives while computing the robot's null-space posture. Change the weights to optimize robot performance for different use cases.

Parameters
[in]groupThe joint group to set null-space objectives for. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted.
[in]linear_manipulabilityIncrease this weight to improve the robot's capability to translate freely in Cartesian space, i.e. a broader range of potential translation movements. Valid range: [0.0, 1.0].
[in]angular_manipulabilityIncrease this weight to improve the robot's capability to rotate freely in Cartesian space, i.e. a broader range of potential rotation movements. Valid range: [0.0, 1.0].
[in]ref_positions_trackingIncrease this weight to make the robot track closer to the reference joint positions specified using SetNullSpacePosture(). Valid range: [0.1, 1.0].
Exceptions
std::invalid_argumentif [group] is not an existing single-arm joint group in the connected robot, or if any of the input parameters is outside its valid range.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
The default value is provided for each parameter.
Applicable control modes: RT_CARTESIAN_MOTION_FORCE, NRT_CARTESIAN_MOTION_FORCE, NRT_SUPER_PRIMITIVE.
This function blocks until the request is successfully delivered.
Warning
The optimization weights will be automatically reset to the provided default values upon re-entering the applicable control modes.

◆ SetNullSpacePosture()

void flexiv::rdk::Robot::SetNullSpacePosture ( JointGroup  group,
const std::vector< double > &  ref_positions 
)

[Blocking] Set reference joint positions for the null-space posture control module used in the Cartesian motion-force control modes.

Parameters
[in]groupThe joint group to set null-space posture for. Only existing single-arm joint groups and external axis joint groups are accepted.
[in]ref_positionsReference joint positions for the null-space posture control: \( q_{ns} \in \mathbb{R}^{n \times 1} \). Valid range: [RobotInfo::q_min, RobotInfo::q_max]. Unit: \( [rad] \).
Exceptions
std::invalid_argumentif [group] is not an existing single-arm or external axis joint group in the connected robot, if [ref_positions] contains any value outside the valid range, or if its size does not match robot DoF.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: RT_CARTESIAN_MOTION_FORCE, NRT_CARTESIAN_MOTION_FORCE, NRT_SUPER_PRIMITIVE.
This function blocks until the request is successfully delivered.
Warning
The reference joint positions will be automatically reset to the robot's current joint positions upon re-entering the applicable control modes.
Null-space posture control
Similar to human arm, a robotic arm with redundant joint-space degree(s) of freedom (DoF > 6) can change its overall posture without affecting the ongoing primary task. This is achieved through a technique called "null-space control". After the reference joint positions of a desired robot posture are set using this function, the robot's null-space control module will try to pull the arm as close to this posture as possible without affecting the primary Cartesian motion-force control task.

◆ SetPassiveForceControl()

void flexiv::rdk::Robot::SetPassiveForceControl ( JointGroup  group,
bool  is_enabled 
)

[Blocking] Enable or disable passive force control for the Cartesian motion-force control modes. When enabled, an open-loop force controller will be used to feed forward the target wrench, i.e. passive force control. When disabled, a closed-loop force controller will be used to track the target wrench, i.e. active force control.

Parameters
[in]groupThe joint group to toggle passive force control for. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted.
[in]is_enabledTrue: enable; false: disable. By default, passive force control is disabled and active force control is used.
Exceptions
std::invalid_argumentif [group] is not an existing single-arm joint group in the connected robot.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: IDLE.
This function blocks until the request is successfully delivered.
If not set, the passive force control is disabled by default.
Difference between active and passive force control
Active force control uses a feedback loop to reduce the error between target wrench and measured wrench. This method results in better force tracking performance, but at the cost of additional Cartesian damping which could potentially decrease motion tracking performance. On the other hand, passive force control simply feeds forward the target wrench. This methods results in worse force tracking performance, but is more robust and does not introduce additional Cartesian damping. The choice of active or passive force control depends on the actual application.

◆ SetTimelinessFailureLimit()

void flexiv::rdk::Robot::SetTimelinessFailureLimit ( double  percentage = 2.0)

[Non-blocking] Set the maximum tolerable percentage of real-time commands that arrived the robot too late within a 1-second moving window. This only applies to the real-time control modes and functions marked as "Real-time (RT)" will throw an exception when this limit is reached.

Parameters
[in]percentagePercentage limit, default to 2%. Valid range: [0, 100].
Exceptions
std::invalid_argumentif [percentage] is outside the valid range.
See also
reached_timeliness_failure_limit().

◆ SetVelocityScale()

void flexiv::rdk::Robot::SetVelocityScale ( unsigned int  velocity_scale)

[Blocking] Set overall velocity scale of robot motions during plan and primitive execution.

Parameters
[in]velocity_scalePercentage scale to adjust the overall velocity of robot motions. Valid range: [0, 100]. Setting to 100 means to move with 100% of specified motion velocity, and 0 means not moving at all.
Exceptions
std::invalid_argumentif [velocity_scale] is outside the valid range.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: NRT_PLAN_EXECUTION, NRT_PRIMITIVE_EXECUTION.
This function blocks until the request is successfully delivered.

◆ states()

std::map<JointGroup, RobotStates> flexiv::rdk::Robot::states ( ) const

[Non-blocking] Current states data of all existing joint groups of the robot.

Returns
Robot states data mapped by joint group.
Warning
Cartesian states of non-single-arm joint groups are not populated.

◆ StepBreakpoint()

void flexiv::rdk::Robot::StepBreakpoint ( )

[Blocking] If breakpoint mode is enabled, step to the next breakpoint. The plan execution will continue and pause at the next breakpoint.

Exceptions
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: NRT_PLAN_EXECUTION.
This function blocks until the request is successfully delivered.
Use PlanInfo::waiting_for_step to check if the plan is waiting for user signal to step the breakpoint.

◆ Stop()

void flexiv::rdk::Robot::Stop ( )

[Blocking] Stop the robot and transit its control mode to IDLE.

Exceptions
std::runtime_errorif failed to stop the robot.
Note
This function blocks until the robot comes to a complete stop.

◆ stopped()

std::map<JointGroup, bool> flexiv::rdk::Robot::stopped ( ) const

[Non-blocking] Whether specific joint groups of the robot have come to a complete stop.

Returns
Stopped flag mapped by joint group. True: this joint group has stopped; false: this joint group is still moving.

◆ StopPlan()

void flexiv::rdk::Robot::StopPlan ( )

[Blocking] Stop the execution of the current plan.

Exceptions
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: NRT_PLAN_EXECUTION.
This function blocks until the request is successfully delivered.

◆ StreamCartesianMotionForce()

void flexiv::rdk::Robot::StreamCartesianMotionForce ( const std::map< JointGroup, RtCartesianCmd > &  cmds)

[Non-blocking] Continuously stream Cartesian motion and/or force commands of the specified joint group(s) to the robot. The commands are tracked by a unified motion-force controller that allows force control in zero or more Cartesian axes and motion control in the other axes.

Parameters
[in]cmdsReal-time Cartesian motion/force commands mapped by joint group. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted.
Exceptions
std::invalid_argumentif [cmds] contains a joint group that is not an existing single-arm joint group in the connected robot.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif the robot is not operational.
Note
Applicable control modes: RT_CARTESIAN_MOTION_FORCE.
Real-time (RT).
Warning
Always stream smooth and continuous motion commands to avoid sudden movements. The force commands don't need to be continuous.
Same as Flexiv Elements, the target wrench is expressed as wrench sensed at TCP instead of wrench exerted by TCP. E.g. commanding f_z = +5 N will make the end-effector move towards -Z direction, so that upon contact, the sensed force will be +5 N.
How to achieve pure motion control?
Use SetForceControlAxis() to disable force control for all Cartesian axes to achieve pure motion control. This function does pure motion control by default.
How to achieve pure force control?
Use SetForceControlAxis() to enable force control for all Cartesian axes to achieve pure force control, active or passive.
How to achieve unified motion-force control?
Use SetForceControlAxis() to enable force control for one or more Cartesian axes and leave the rest axes motion-controlled, then provide target pose for the motion-controlled axes and target wrench for the force-controlled axes.
See also
SetCartesianImpedance(), SetMaxContactWrench(), SetNullSpacePosture(), SetForceControlAxis(), SetForceControlFrame(), SetPassiveForceControl().

◆ StreamJointPosition()

void flexiv::rdk::Robot::StreamJointPosition ( const std::map< JointGroup, RtJointPositionCmd > &  cmds)

[Non-blocking] Continuously stream joint position, velocity, and acceleration commands of the specified joint group(s) to the robot. The commands are tracked by either the joint impedance controller or the joint position controller, depending on the control mode.

Parameters
[in]cmdsReal-time joint position-velocity-acceleration commands mapped by joint group. Only existing single-arm joint groups and external axis joint groups are accepted.
Exceptions
std::invalid_argumentif [cmds] contains a joint group that is not an existing single-arm or external axis joint group in the connected robot, or if size of any input vector does not match robot DoF.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif the robot is not operational.
Note
Applicable control modes: RT_JOINT_IMPEDANCE, RT_JOINT_POSITION.
Real-time (RT).
Warning
Always stream smooth and continuous commands to avoid sudden movements.
See also
SetJointImpedance().

◆ StreamJointTorque()

void flexiv::rdk::Robot::StreamJointTorque ( const std::map< JointGroup, RtJointTorqueCmd > &  cmds)

[Non-blocking] Continuously stream joint torque commands of the specified joint group(s) to the robot. The commands are tracked by a high-performance joint torque controller.

Parameters
[in]cmdsReal-time joint torque commands mapped by joint group. Only existing single-arm joint groups and external axis joint groups are accepted.
Exceptions
std::invalid_argumentif [cmds] contains a joint group that is not an existing single-arm or external axis joint group in the connected robot, if size of any input vector does not match robot DoF, or [friction_comp_scale] is outside the valid range.
std::logic_errorif the robot is not in the correct control mode.
std::runtime_errorif the robot is not operational.
Note
Applicable control modes: RT_JOINT_TORQUE.
Real-time (RT).
Warning
Always stream smooth and continuous commands to avoid sudden movements.

◆ SwitchMode()

void flexiv::rdk::Robot::SwitchMode ( Mode  mode)

[Blocking] Switch the robot to a new control mode and wait for the mode transition to finish.

Parameters
[in]modeControl mode to switch to.
Exceptions
std::invalid_argumentif the requested mode is invalid or unlicensed.
std::logic_errorif robot is in an unknown control mode or is not operational.
std::runtime_errorif failed to transit the robot into the specified control mode after several attempts.
Note
This function blocks until the robot has successfully transited into the specified control mode.
Warning
If the robot is still moving when this function is called, it will automatically stop before making the mode transition.

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