Flexiv TDK APIs 2.1
Loading...
Searching...
No Matches
transparent_cartesian_teleop_wan.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
25{
26public:
46 const std::vector<std::pair<std::string, std::string>>& robot_pairs_sn,
47 flexiv::tdk::Role role, const NetworkCfgStd& network_cfg_std, bool verbose = true);
48
50
51 //========================================= ACCESSORS ==========================================
82 bool CheckTeleopConnectionLatency(unsigned int idx, double& latency_ms) const;
83
91 bool fault(unsigned int idx) const;
92
102 const std::array<bool, kIOPorts> digital_inputs(unsigned int idx) const;
103
116 bool stopped(unsigned int idx) const;
117
118 //==================================== TELEOP LIFECYCLE ====================================
132 void Init(bool limit_wrist_singular = true, ZeroFTSensor zero_ft_sensor = ZeroFTSensor::Enable);
133
142 void Start();
143
154 void Stop();
155
171 void InitWithIdx(unsigned int idx, bool limit_wrist_singular = true,
172 ZeroFTSensor zero_ft_sensor = ZeroFTSensor::Enable);
173
184 void StartWithIdx(unsigned int idx);
185
199 void StopWithIdx(unsigned int idx);
200
201 //==================================== TELEOP CONTROL ====================================
218 void Engage(unsigned int idx, JointGroup group, bool engaged);
219
244 unsigned int idx, JointGroup group, const std::vector<double>& ref_joint_positions);
245
262 unsigned int idx, JointGroup group, const std::array<double, kCartDoF>& max_wrench);
263
274 void SetAxisLockCmd(unsigned int idx, JointGroup group, const AxisLock& cmd);
275
285 void GetAxisLockState(unsigned int idx, JointGroup group, AxisLock& data);
286
298 AxisLock GetAxisLockState(unsigned int idx, JointGroup group);
299
316 void SetTeleopLatencyLimit(unsigned int idx, double threshold_ms = 200.0);
317
318 //======================================= SYSTEM CONTROL =======================================
332 std::vector<bool> ClearFault(unsigned int timeout_sec = 30);
333
341 std::shared_ptr<Robot> instance(unsigned int idx) const;
342
343private:
344 class Impl;
345 std::unique_ptr<Impl> pimpl_;
346};
347
348} // namespace tdk
349} // namespace flexiv
void Stop()
[Blocking] Stop the teleoperation control loop and make all robots hold their pose.
std::shared_ptr< Robot > instance(unsigned int idx) const
[Non-blocking] Pointer to the underlying rdk::Robot instance of the current role.
bool stopped(unsigned int idx) const
[Non-blocking] Whether teleop process has stopped. After teleop is started, the teleop process may st...
TransparentCartesianTeleopWAN(const std::vector< std::pair< std::string, std::string > > &robot_pairs_sn, flexiv::tdk::Role role, const NetworkCfgStd &network_cfg_std, bool verbose=true)
[Blocking] Create an instance of the control interface using TDK Standard Edition TCP peer-to-peer ne...
void InitWithIdx(unsigned int idx, bool limit_wrist_singular=true, ZeroFTSensor zero_ft_sensor=ZeroFTSensor::Enable)
[Blocking] Get current role in specified pair ready for teleoperation. The following actions will hap...
void StartWithIdx(unsigned int idx)
[Non-Blocking] Start the teleoperation control loop for the specified robot pair.
void StopWithIdx(unsigned int idx)
[Blocking] Stop the teleoperation control loop and make robot hold its pose for current role in the s...
AxisLock GetAxisLockState(unsigned int idx, JointGroup group)
[Non-blocking] Get the leader robot axis locking status
void SetMaxContactWrench(unsigned int idx, JointGroup group, const std::array< double, kCartDoF > &max_wrench)
[Non-blocking] Set maximum contact wrench for the current role in the robot pairs....
void Start()
[Non-Blocking] Start the teleoperation control loop for current roles (leaders or followers) specifie...
bool CheckTeleopConnectionLatency(unsigned int idx, double &latency_ms) const
Non-blocking check of TCP connection status and average message latency.
bool fault(unsigned int idx) const
[Non-blocking] Whether the current role is in fault state.
void SetNullSpacePosture(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...
std::vector< bool > ClearFault(unsigned int timeout_sec=30)
[Blocking] Try to clear minor or critical fault for current role (leaders or followers) without a pow...
void SetAxisLockCmd(unsigned int idx, JointGroup group, const AxisLock &cmd)
[Non-blocking] Set the leader robot axis locking command.
void Init(bool limit_wrist_singular=true, ZeroFTSensor zero_ft_sensor=ZeroFTSensor::Enable)
[Blocking] Get current role ready for teleoperation. The following actions will happen in sequence: a...
const 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 Engage(unsigned int idx, JointGroup group, bool engaged)
[Non-blocking] Engage/disengage the leader and follower robot in the specified robot pair....
void GetAxisLockState(unsigned int idx, JointGroup group, AxisLock &data)
[Non-blocking] Get the leader robot axis locking status
void SetTeleopLatencyLimit(unsigned int idx, double threshold_ms=200.0)
[Non-blocking] Set the maximum acceptable TCP message latency for teleoperation. If the measured late...
Header file containing various constant expressions, data structs, and enums.
Role
Roles of participants in transparent cartesian teleop.
Definition data.hpp:95
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
TCP Server and Client Configuration TDK Standard Edition. In TDK standard edition,...
Definition data.hpp:56