Flexiv TDK APIs 2.1
Loading...
Searching...
No Matches
transparent_cartesian_teleop_lan.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include "data.hpp"
8#include <string>
9#include <memory>
10
11#include <flexiv/rdk/robot.hpp>
12namespace flexiv {
13namespace tdk {
14
15using namespace rdk;
16
26{
27public:
47 const std::vector<std::pair<std::string, std::string>>& robot_pairs_sn);
49
50 //========================================= ACCESSORS ==========================================
51
61 const std::pair<std::array<bool, kIOPorts>, std::array<bool, kIOPorts>> digital_inputs(
62 unsigned int idx) const;
63
72 const std::pair<bool, bool> fault(unsigned int idx) const;
73
78 bool any_fault(void) const;
79
92 bool stopped(unsigned int idx) const;
93
94 //==================================== TELEOP LIFECYCLE ====================================
107 void Init(bool limit_wrist_singular = true, ZeroFTSensor zero_ft_sensor = ZeroFTSensor::Enable);
108
115 void Start();
116
127 void Stop();
128
146 void InitWithIdx(unsigned int idx, bool limit_wrist_singular = true,
147 ZeroFTSensor zero_ft_sensor = ZeroFTSensor::Enable);
148
158 void StartWithIdx(unsigned int idx);
159
174 void StopWithIdx(unsigned int idx);
175
176 //==================================== TELEOP CONTROL ====================================
192 void Engage(unsigned int idx, JointGroup group, bool engaged);
193
214 void SetRepulsiveForce(unsigned int idx, JointGroup group,
215 const std::array<double, 3>& repulsive_force, bool in_world = true);
216
236 void SetWrenchFeedbackScalingFactor(unsigned int idx, JointGroup group, double factor = 1.0);
237
247 void SetAxisLockCmd(unsigned int idx, JointGroup group, const AxisLock& cmd);
248
257 void GetAxisLockState(unsigned int idx, JointGroup group, AxisLock& data);
258
269 AxisLock GetAxisLockState(unsigned int idx, JointGroup group);
270
296 unsigned int idx, JointGroup group, const std::vector<double>& ref_joint_positions);
297
323 unsigned int idx, JointGroup group, const std::vector<double>& ref_joint_positions);
324
341 unsigned int idx, JointGroup group, const std::array<double, kCartDoF>& max_wrench);
342
359 unsigned int idx, JointGroup group, const std::array<double, kCartDoF>& max_wrench);
360
379 void SetFollowerCartStiff(unsigned int idx, JointGroup group, double stiff_scale);
380
399 unsigned int idx, JointGroup group, const std::array<double, kCartDoF>& K_x);
400
401 //======================================= SYSTEM CONTROL =======================================
417 std::vector<std::pair<bool, bool>> ClearFault(unsigned int timeout_sec = 30);
418
426 std::pair<std::shared_ptr<Robot>, std::shared_ptr<Robot>> instances(unsigned int idx) const;
427
428private:
429 class Impl;
430 std::unique_ptr<Impl> pimpl_;
431};
432
433} // namespace tdk
434} // namespace flexiv
std::pair< std::shared_ptr< Robot >, std::shared_ptr< Robot > > instances(unsigned int idx) const
[Non-blocking] Pointers to the underlying rdk::Robot instances of the robot pair.
TransparentCartesianTeleopLAN(const std::vector< std::pair< std::string, std::string > > &robot_pairs_sn)
[Blocking] Create an instance of the control interface. More than one pair of teleoperated robots can...
bool any_fault(void) const
[Non-blocking] Whether any of the connected robots is in fault state.
std::vector< std::pair< bool, bool > > ClearFault(unsigned int timeout_sec=30)
[Blocking] Try to clear minor or critical fault of the robot without a power cycle.
void GetAxisLockState(unsigned int idx, JointGroup group, AxisLock &data)
[Non-blocking] Get the leader robot axis locking status
void Stop()
[Blocking] Stop the teleoperation control loop and make all robots hold their pose.
void Init(bool limit_wrist_singular=true, ZeroFTSensor zero_ft_sensor=ZeroFTSensor::Enable)
[Blocking] Get all robots ready for teleoperation. The following actions will happen in sequence: a) ...
void StartWithIdx(unsigned int idx)
[Non-Blocking] Start the teleoperation control loop for the specified robot pair.
AxisLock GetAxisLockState(unsigned int idx, JointGroup group)
[Non-blocking] Get the leader robot axis locking status
void Engage(unsigned int idx, JointGroup group, bool engaged)
[Non-blocking] Engage/disengage the leader and follower robot. TransparentCartesianTeleopLAN supports...
void StopWithIdx(unsigned int idx)
[Blocking] Stop the teleoperation control loop and make robot hold their pose for specified robot pai...
const std::pair< std::array< bool, kIOPorts >, std::array< bool, kIOPorts > > digital_inputs(unsigned int idx) const
[Non-blocking] Current reading from all digital input ports (16 on the control box + 2 inside the wri...
void SetRepulsiveForce(unsigned int idx, JointGroup group, const std::array< double, 3 > &repulsive_force, bool in_world=true)
[Non-blocking] Set the repulsive force in World or Tcp frame of the follower robot.
void SetAxisLockCmd(unsigned int idx, JointGroup group, const AxisLock &cmd)
[Non-blocking] Set the leader robot axis locking command.
void Start()
[Non-Blocking] Start the teleoperation control loop for all robot pairs.
void SetFollowerCartStiff(unsigned int idx, JointGroup group, double stiff_scale)
[Blocking] Set stiffness of the Cartesian motion controller of the follower robot in specified robot ...
bool stopped(unsigned int idx) const
[Non-blocking] Whether teleop process has stopped. After teleop is started, the teleop process may st...
void SetLeaderMaxContactWrench(unsigned int idx, JointGroup group, const std::array< double, kCartDoF > &max_wrench)
[Non-blocking] Set maximum contact wrench for the leader robot of specified robot pair....
void SetWrenchFeedbackScalingFactor(unsigned int idx, JointGroup group, double factor=1.0)
[Non-blocking] Set the wrench feedback scaling factor.
const std::pair< bool, bool > fault(unsigned int idx) const
[Non-blocking] Fault state of the specified robot pair.
void SetFollowerMaxContactWrench(unsigned int idx, JointGroup group, const std::array< double, kCartDoF > &max_wrench)
[Non-blocking] Set maximum contact wrench for the follower robot of specified robot pair....
void InitWithIdx(unsigned int idx, bool limit_wrist_singular=true, ZeroFTSensor zero_ft_sensor=ZeroFTSensor::Enable)
[Blocking] Get connected robot in specified pair ready for teleoperation. The following actions will ...
void SetFollowerCartStiff(unsigned int idx, JointGroup group, const std::array< double, kCartDoF > &K_x)
[Blocking] Set stiffness of the follower robot's Cartesian motion controller.
void SetFollowerNullSpacePosture(unsigned int idx, JointGroup group, const std::vector< double > &ref_joint_positions)
[Blocking] Set reference joint positions used in the robot's null-space posture control module for th...
void SetLeaderNullSpacePosture(unsigned int idx, JointGroup group, const std::vector< double > &ref_joint_positions)
[Blocking] Set reference joint positions used in the robot's null-space posture control module for th...
Header file containing various constant expressions, data structs, and enums.
ZeroFTSensor
Sensor calibration options.
Definition data.hpp:248
Data for locking axis, including reference frame and axis to be locked for transparent cartesian tele...
Definition data.hpp:224