Flexiv TDK APIs 1.7
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
25{
26public:
51 const std::vector<std::pair<std::string, std::string>>& robot_pairs_sn,
52 const std::vector<std::string>& network_interface_whitelist = {});
54
55 //========================================= ACCESSORS ==========================================
56
66 const std::pair<std::array<bool, kIOPorts>, std::array<bool, kIOPorts>> digital_inputs(
67 unsigned int idx) const;
68
77 const std::pair<bool, bool> fault(unsigned int idx) const;
78
83 bool any_fault(void) const;
84
97 bool stopped(unsigned int idx) const;
98
99 //==================================== TELEOP LIFECYCLE ====================================
112 void Init(bool limit_wrist_singular = true, ZeroFTSensor zero_ft_sensor = ZeroFTSensor::Enable);
113
120 void Start();
121
132 void Stop();
133
142 void HomeAll();
143
161 void InitWithIdx(unsigned int idx, bool limit_wrist_singular = true,
162 ZeroFTSensor zero_ft_sensor = ZeroFTSensor::Enable);
163
173 void StartWithIdx(unsigned int idx);
174
189 void StopWithIdx(unsigned int idx);
190
191 //==================================== TELEOP CONTROL ====================================
206 void Engage(unsigned int idx, bool engaged);
207
228 unsigned int idx, const std::array<double, 3>& repulsive_force, bool in_world = true);
229
248 void SetWrenchFeedbackScalingFactor(unsigned int idx, double factor = 1.0);
249
258 void SetAxisLockCmd(unsigned int idx, const AxisLock& cmd);
259
267 void GetAxisLockState(unsigned int idx, AxisLock& data);
268
278 AxisLock GetAxisLockState(unsigned int idx);
279
296 void GetTeleopStatus(unsigned int idx, TeleopStatus& status) const;
297
308 TeleopStatus GetTeleopStatus(unsigned int idx) const;
309
334 unsigned int idx, const std::vector<double>& ref_joint_positions);
335
360 unsigned int idx, const std::vector<double>& ref_joint_positions);
361
377 unsigned int idx, const std::array<double, kCartDoF>& max_wrench);
378
394 unsigned int idx, const std::array<double, kCartDoF>& max_wrench);
395
411 void SetFollowerCartStiff(unsigned int idx, double stiff_scale);
412
429 void SetFollowerCartStiff(unsigned int idx, const std::array<double, kCartDoF>& K_x);
430
431 //======================================= SYSTEM CONTROL =======================================
446 std::vector<std::pair<bool, bool>> ClearFault(unsigned int timeout_sec = 30);
447
455 std::pair<std::shared_ptr<Robot>, std::shared_ptr<Robot>> instances(unsigned int idx) const;
456
457private:
458 class Impl;
459 std::unique_ptr<Impl> pimpl_;
460};
461
462} // namespace tdk
463} // namespace flexiv
Teleoperation control interface to run Cartesian-space teleoperation for one or more pairs of robots ...
void SetFollowerNullSpacePosture(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 GetTeleopStatus(unsigned int idx, TeleopStatus &status) const
[Non-blocking] Query why teleoperation is restricted, paused, or stopped, and what the operator shoul...
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.
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 SetFollowerMaxContactWrench(unsigned int idx, const std::array< double, kCartDoF > &max_wrench)
[Non-blocking] Set maximum contact wrench for the follower robot of specified robot pair....
void SetWrenchFeedbackScalingFactor(unsigned int idx, double factor=1.0)
[Non-blocking] Set the wrench feedback scaling factor.
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.
void GetAxisLockState(unsigned int idx, AxisLock &data)
[Non-blocking] Get the leader robot axis locking status
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.
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 Start()
[Non-Blocking] Start the teleoperation control loop for all robot pairs.
void HomeAll()
[Blocking] Move all connected robots to their home posture simultaneously.
TransparentCartesianTeleopLAN(const std::vector< std::pair< std::string, std::string > > &robot_pairs_sn, const std::vector< std::string > &network_interface_whitelist={})
[Blocking] Create an instance of the control interface. More than one pair of teleoperated robots can...
void SetLeaderMaxContactWrench(unsigned int idx, const std::array< double, kCartDoF > &max_wrench)
[Non-blocking] Set maximum contact wrench for the leader robot of specified robot pair....
void SetRepulsiveForce(unsigned int idx, 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.
TeleopStatus GetTeleopStatus(unsigned int idx) const
[Non-blocking] Query why teleoperation is restricted, paused, or stopped.
AxisLock GetAxisLockState(unsigned int idx)
[Non-blocking] Get the leader robot axis locking status
bool stopped(unsigned int idx) const
[Non-blocking] Whether teleop process has stopped. After teleop is started, the teleop process may st...
void SetFollowerCartStiff(unsigned int idx, const std::array< double, kCartDoF > &K_x)
[Blocking] Set stiffness of the follower robot's Cartesian motion controller.
const std::pair< bool, bool > fault(unsigned int idx) const
[Non-blocking] Fault state of the specified robot pair.
void SetFollowerCartStiff(unsigned int idx, double stiff_scale)
[Blocking] Set stiffness of the Cartesian motion controller of the follower robot in specified robot ...
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 Engage(unsigned int idx, bool engaged)
[Non-blocking] Engage/disengage the leader and follower robot. TransparentCartesianTeleopLAN supports...
void SetLeaderNullSpacePosture(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...
Header file containing various constant expressions, data structs, and enums.
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
Snapshot of teleoperation health for one robot pair.
Definition data.hpp:394