6 #ifndef FLEXIV_RDK_ROBOT_HPP_
7 #define FLEXIV_RDK_ROBOT_HPP_
16 namespace flexiv::rdk {
48 Robot(
const std::string& robot_sn,
bool verbose =
true,
bool lite =
false);
81 std::map<JointGroup, RobotStates>
states()
const;
88 std::map<JointGroup, RobotActions>
actions()
const;
96 std::map<JointGroup, bool>
stopped()
const;
210 void Home(
const std::vector<JointGroup>& groups = {});
314 unsigned int index,
bool continue_exec =
false,
bool block_until_started =
true);
334 const std::string& name,
bool continue_exec =
false,
bool block_until_started =
true);
439 const std::map<JointGroup, PrimitiveArgs>& primitive_args,
bool block_until_started =
true);
527 JointGroup group,
const std::vector<double>& K_q,
const std::vector<double>& Z_q = {});
652 const std::map<JointGroup, NrtCartesianMultiWaypointCmd>& cmds);
679 const std::array<double, kCartDoF>& Z_x = {0.7, 0.7, 0.7, 0.7, 0.7, 0.7});
758 double angular_manipulability = 0.0,
double ref_positions_tracking = 0.5);
784 const std::array<double, kCartDoF / 2>& max_linear_vel = {1.0, 1.0, 1.0});
822 const std::array<double, kPoseSize>& T_in_root = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0});
882 std::unique_ptr<Impl> pimpl_;
Interface to control the peripheral device(s) connected to the robot.
Interface to exchange files with the robot. Only certain types of file can be transferred.
Interface to control the gripper installed on the robot. Because gripper is also a type of robot devi...
Interface to run maintenance operations on the robot.
Interface to obtain certain model data of the robot, including kinematics and dynamics.
Main interface to control the robot, containing several function categories and background services.
void ExecutePlan(unsigned int index, bool continue_exec=false, bool block_until_started=true)
[Blocking] Execute a plan by specifying its index.
RobotInfo info() const
[Non-blocking] General information about the robot.
bool enabling_device_on() const
[Non-blocking] Whether the 3-position enabling device (e.g. enabling button on the motion bar) is in ...
void Home(const std::vector< JointGroup > &groups={})
[Blocking] Move the specified joint groups to the home posture using Home primitive.
void SetPassiveForceControl(JointGroup group, bool is_enabled)
[Blocking] Enable or disable passive force control for the Cartesian motion-force control modes....
void StreamJointPosition(const std::map< JointGroup, RtJointPositionCmd > &cmds)
[Non-blocking] Continuously stream joint position, velocity, and acceleration commands of the specifi...
bool recovery() const
[Non-blocking] Whether the robot is in recovery state.
void Brake(bool engage)
[Blocking] Force robot brakes to engage or release during normal operation. Restrictions apply,...
OperationalStatus operational_status() const
[Non-blocking] Current operational status of the robot.
void StepBreakpoint()
[Blocking] If breakpoint mode is enabled, step to the next breakpoint. The plan execution will contin...
void StreamCartesianMotionForce(const std::map< JointGroup, RtCartesianCmd > &cmds)
[Non-blocking] Continuously stream Cartesian motion and/or force commands of the specified joint grou...
void SetGlobalVariables(const std::map< std::string, FlexivDataTypes > &global_vars)
[Blocking] Set values to global variables that already exist in the robot.
Mode mode() const
[Non-blocking] Current control mode of the robot.
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 mod...
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 Cartes...
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 w...
void SetVelocityScale(unsigned int velocity_scale)
[Blocking] Set overall velocity scale of robot motions during plan and primitive execution.
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 impedanc...
std::vector< RobotEvent > event_log() const
[Non-blocking] Robot events stored since the last successful instantiation of this class.
void Stop()
[Blocking] Stop the robot and transit its control mode to IDLE.
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....
std::map< JointGroup, bool > stopped() const
[Non-blocking] Whether specific joint groups of the robot have come to a complete stop.
void ExecutePrimitive(const std::map< JointGroup, PrimitiveArgs > &primitive_args, bool block_until_started=true)
[Blocking] Execute primitive(s) on specified joint group(s).
void SwitchMode(Mode mode)
[Blocking] Switch the robot to a new control mode and wait for the mode transition to finish.
std::map< std::string, FlexivDataTypes > global_variables() const
[Blocking] Existing global variables and their current values.
void PausePlan(bool toggle)
[Blocking] Pause or resume the execution of the current plan.
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 ...
std::map< JointGroup, PrimitiveStates > primitive_states() const
[Blocking] States data of the primitive(s) that are currently running.
bool reached_timeliness_failure_limit() const
[Non-blocking] Whether the timeliness failure limit has been reached within a 1-second moving window.
std::map< JointGroup, RobotStates > states() const
[Non-blocking] Current states data of all existing joint groups of the robot.
bool reduced() const
[Non-blocking] Whether the robot is in reduced state.
void StopPlan()
[Blocking] Stop the execution of the current plan.
bool connected() const
[Non-blocking] Whether the connection with the robot is established.
std::map< JointGroup, RobotActions > actions() const
[Non-blocking] Current actions data of all existing joint groups of the robot.
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 impe...
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 contr...
void SetTimelinessFailureLimit(double percentage=2.0)
[Non-blocking] Set the maximum tolerable percentage of real-time commands that arrived the robot too ...
std::vector< std::string > plan_list() const
[Blocking] A list of all available plans.
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 connec...
bool operational() const
[Non-blocking] Whether the robot is ready to be operated, which requires the following conditions to ...
void SetBreakpointMode(bool is_enabled)
[Blocking] Enable or disable the breakpoint mode during plan execution. When enabled,...
void SendCartesianMotionForce(const std::map< JointGroup, NrtCartesianCmd > &cmds)
[Non-blocking] Discretely send Cartesian motion and/or force commands of the specified joint group(s)...
void ExecutePlan(const std::string &name, bool continue_exec=false, bool block_until_started=true)
[Blocking] Execute a plan by specifying its name.
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 imped...
std::array< bool, kIOPorts > digital_outputs() const
[Non-blocking] Current reading from all digital output ports, including 16 on the control box plus 2 ...
void StreamJointTorque(const std::map< JointGroup, RtJointTorqueCmd > &cmds)
[Non-blocking] Continuously stream joint torque commands of the specified joint group(s) to the robot...
void SendJointPosition(const std::map< JointGroup, NrtJointPositionCmd > &cmds)
[Non-blocking] Discretely send joint position and velocity commands of the specified joint group(s) t...
bool all_stopped() const
[Non-blocking] Whether all joint groups of the robot have come to a complete stop.
void ServoOn()
[Blocking] Servo on the robot. If E-stop is released and there's no fault, the robot will release bra...
PlanInfo plan_info() const
[Blocking] Detailed information about the executing plan. Contains plan name, primitive name,...
void SendCartesianMotionForceMultiWaypoint(const std::map< JointGroup, NrtCartesianMultiWaypointCmd > &cmds)
[Non-blocking] Discretely send Cartesian multi-waypoint motion and/or force commands for the robot to...
bool lite() const
[Non-blocking] Whether this rdk::Robot instance is a lite one.
bool fault() const
[Non-blocking] Whether the robot is in fault state.
bool ClearFault(unsigned int timeout_sec=30)
[Blocking] Try to clear minor or critical fault for the robot without a power cycle.
bool estop_released() const
[Non-blocking] Whether all connected emergency stops (E-stops) are released.
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 po...
bool busy() const
[Non-blocking] Whether the robot is busy. This includes any user commanded operations that requires t...
std::array< bool, kIOPorts > digital_inputs() const
[Non-blocking] Current reading from all digital input ports, including 16 on the control box plus 2 i...
Interface to manage safety settings of the robot. A password is required to authenticate this interfa...
Interface to manage work coordinates of the robot. All updates take effect immediately without a powe...
Header file containing various constant expressions, data structures, and enums.
CoordType
Type of commonly-used reference coordinates.
JointGroup
All possible joint groups of the robot.
OperationalStatus
All possible operational statuses of the robot. Except for the first two, the other enumerators indic...
Mode
Robot control modes. The robot needs to be switched into the correct control mode before the correspo...
Information of the on-going primitive/plan.
General information about the connected robot.