Flexiv TDK APIs 1.7
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
35{
36public:
67 const std::vector<std::pair<std::string, std::string>>& robot_pairs_sn,
68 flexiv::tdk::Role role, const NetworkCfgStd& network_cfg_std, bool verbose = true);
69
100 const std::vector<std::pair<std::string, std::string>>& robot_pairs_sn,
101 flexiv::tdk::Role role, const NetworkCfgPro& network_cfg_pro, bool verbose = true);
102
104
105 //========================================= ACCESSORS ==========================================
139 bool CheckTeleopConnectionLatency(unsigned int idx, double& latency_ms) const;
140
148 bool fault(unsigned int idx) const;
149
159 const std::array<bool, kIOPorts> digital_inputs(unsigned int idx) const;
160
173 bool stopped(unsigned int idx) const;
174
180
189 std::pair<std::string, std::string> robot_pair_sn(unsigned int idx) const;
190
191 //==================================== TELEOP LIFECYCLE ====================================
205 void Init(bool limit_wrist_singular = true, ZeroFTSensor zero_ft_sensor = ZeroFTSensor::Enable);
206
215 void Start();
216
227 void Stop();
228
241 void HomeAll();
242
258 void InitWithIdx(unsigned int idx, bool limit_wrist_singular = true,
259 ZeroFTSensor zero_ft_sensor = ZeroFTSensor::Enable);
260
271 void StartWithIdx(unsigned int idx);
272
286 void StopWithIdx(unsigned int idx);
287
288 //==================================== TELEOP CONTROL ====================================
304 void Engage(unsigned int idx, bool engaged);
305
328 void SetNullSpacePosture(unsigned int idx, const std::vector<double>& ref_joint_positions);
329
344 void SetMaxContactWrench(unsigned int idx, const std::array<double, kCartDoF>& max_wrench);
345
363 void SetTeleopLatencyLimit(unsigned int idx, double threshold_ms = 200.0);
364
374 void SetAxisLockCmd(unsigned int idx, const AxisLock& cmd);
375
384 void GetAxisLockState(unsigned int idx, AxisLock& data);
385
396 AxisLock GetAxisLockState(unsigned int idx);
397
415 void GetTeleopStatus(unsigned int idx, TeleopStatus& status) const;
416
427 TeleopStatus GetTeleopStatus(unsigned int idx) const;
428
429 //======================================= SYSTEM CONTROL =======================================
445 std::vector<bool> ClearFault(unsigned int timeout_sec = 30);
446
454 std::shared_ptr<Robot> instance(unsigned int idx) const;
455
456private:
457 class Impl;
458 std::unique_ptr<Impl> pimpl_;
459};
460
461} // namespace tdk
462} // namespace flexiv
void Stop()
[Blocking] Stop the teleoperation control loop and make all robots hold their pose.
void SetAxisLockCmd(unsigned int idx, const AxisLock &cmd)
[Non-blocking] Set the leader robot axis locking command.
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. More than one pair of teleoperated robots can...
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...
void GetAxisLockState(unsigned int idx, AxisLock &data)
[Non-blocking] Get the leader robot axis locking status
void Engage(unsigned int idx, bool engaged)
[Non-blocking] Engage/disengage the leader and follower robot in the specified robot pair....
flexiv::tdk::Role role() const
[Non-blocking] Role of this teleop instance.
void Start()
[Non-Blocking] Start the teleoperation control loop for current roles (leaders or followers) specifie...
void SetMaxContactWrench(unsigned int idx, const std::array< double, kCartDoF > &max_wrench)
[Non-blocking] Set maximum contact wrench for the current role in the robot pairs....
bool CheckTeleopConnectionLatency(unsigned int idx, double &latency_ms) const
Non-blocking check of WAN connection status and average message latency.
AxisLock GetAxisLockState(unsigned int idx)
[Non-blocking] Get the leader robot axis locking status
TeleopStatus GetTeleopStatus(unsigned int idx) const
[Non-blocking] Query why teleoperation is restricted, paused, or stopped.
bool fault(unsigned int idx) const
[Non-blocking] Whether the current role is in fault state.
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 GetTeleopStatus(unsigned int idx, TeleopStatus &status) const
[Non-blocking] Query why teleoperation is restricted, paused, or stopped, and what the operator shoul...
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...
void HomeAll()
[Blocking] Move all connected robots of the current role to their home posture simultaneously.
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...
TransparentCartesianTeleopWAN(const std::vector< std::pair< std::string, std::string > > &robot_pairs_sn, flexiv::tdk::Role role, const NetworkCfgPro &network_cfg_pro, bool verbose=true)
[Blocking] Create an instance of the control interface using TDK Professional Edition networking,...
void SetNullSpacePosture(unsigned int idx, 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 SetTeleopLatencyLimit(unsigned int idx, double threshold_ms=200.0)
[Non-blocking] Set the maximum acceptable message latency over the WAN connection for teleoperation....
std::pair< std::string, std::string > robot_pair_sn(unsigned int idx) const
[Non-blocking] Serial number pair {leader_sn, follower_sn} of the specified robot pair.
Header file containing various constant expressions, data structs, and enums.
Role
Roles of participants in transparent cartesian teleop.
Definition data.hpp:121
ZeroFTSensor
Sensor calibration options.
Definition data.hpp:274
Data for locking axis, including reference frame and axis to be locked for transparent cartesian tele...
Definition data.hpp:250
Network configuration for TDK Professional Edition (credential file from TDK Server).
Definition data.hpp:101
TCP Server and Client Configuration TDK Standard Edition. In a teleoperation-over-WAN setup,...
Definition data.hpp:53
Snapshot of teleoperation health for one robot pair.
Definition data.hpp:394