| xCore-SDK 0.4.1 xCore SDK C# API

force_control_cli.hpp
1
8#pragma once
9#ifndef XCORESDK_SRC_MANAGED_FORCE_CONTROL_CLI_HPP_
10#define XCORESDK_SRC_MANAGED_FORCE_CONTROL_CLI_HPP_
11
12#include <unordered_map>
13#include "data_types_cli.hpp"
14#include "exception_cli.hpp"
15
16 using namespace System;
17 using namespace System::Collections::Generic;
18 using namespace System::Runtime::InteropServices;
19
20 namespace rokae {
21 class BaseForceControl;
22 template<unsigned short DoF>
23 class ForceControl_T;
24}
25
26 namespace rokae::clr {
27
31 public ref class ForceControl {
32
33 protected:
34 rokae::ForceControl_T<5>* fc_cr5;
35 rokae::ForceControl_T<6>* fc_xmate;
36 rokae::ForceControl_T<7>* fc_pro;
37 const int dof;
38 rokae::BaseForceControl* fc_base;
39
40 public:
41
42 ForceControl(rokae::ForceControl_T<5>*);
43 ForceControl(rokae::ForceControl_T<6>*);
44 ForceControl(rokae::ForceControl_T<7>*);
45
46 virtual ~ForceControl();
47
63 void getEndTorque(FrameType ref_type,
64 array<double>^% joint_torque_measured,
65 array<double>^% external_torque_measured,
66 array<double>^% cart_torque,
67 array<double>^% cart_force, [Out] ErrorCode^% ec);
68
74 void fcInit(FrameType type, [Out] ErrorCode^% ec);
75
82 void fcStart([Out] ErrorCode^% ec);
83
88 void fcStop([Out] ErrorCode^% ec);
89
95 void setControlType(int type, [Out] ErrorCode^% ec);
96
102 void setLoad(Load^ load, [Out] ErrorCode^% ec);
103
110 void setJointStiffness(array<double>^ stiffness, [Out] ErrorCode^% ec);
111
118 void setCartesianStiffness(array<double>^ stiffness, [Out] ErrorCode^% ec);
119
125 void setCartesianNullspaceStiffness(double stiffness, [Out] ErrorCode^% ec);
126
132 void setJointDesiredTorque(array<double>^ torque, [Out] ErrorCode^% ec);
133
139 void setCartesianDesiredForce(array<double>^ value, [Out] ErrorCode^% ec);
140
152 void setSineOverlay(int line_dir, double amplify, double frequency, double phase,
153 double bias, [Out] ErrorCode^% ec);
154
166 void setLissajousOverlay(int plane, double amplify_one, double frequency_one, double amplify_two,
167 double frequency_two, double phase_diff, [Out] ErrorCode^% ec);
168
174 void startOverlay([Out] ErrorCode^% ec);
175
180 void stopOverlay([Out] ErrorCode^% ec);
181
186 void pauseOverlay([Out] ErrorCode^% ec);
187
192 void restartOverlay([Out] ErrorCode^% ec);
193
203 void setForceCondition(array<double>^ range, bool isInside, double timeout, [Out] ErrorCode^% ec);
204
214 void setTorqueCondition(array<double>^ range, bool isInside, double timeout, [Out] ErrorCode^% ec);
215
224 void setPoseBoxCondition(Frame^ supervising_frame, array<double>^ box, bool isInside,
225 double timeout, [Out] ErrorCode^% ec);
226
231 void waitCondition([Out] ErrorCode^% ec);
232
242 void fcMonitor(bool enable, [Out] ErrorCode^% ec);
243
249 void setJointMaxVel(array<double>^ velocity, [Out] ErrorCode^% ec);
250
257 void setJointMaxMomentum(array<double>^ momentum, [Out] ErrorCode^% ec);
258
265 void setJointMaxEnergy(array<double>^ energy, [Out] ErrorCode^% ec);
266
272 void setCartesianMaxVel(array<double>^ velocity, [Out] ErrorCode^% ec);
273 };
274
275}
276
277
278#endif //XCORESDK_SRC_MANAGED_FORCE_CONTROL_CLI_HPP_
rokae::ForceControl_T
Definition: force_control_cli.hpp:23
rokae::clr::ErrorCode
xCoreSDK错误码
Definition: data_types_cli.hpp:23
rokae::clr::ForceControl
力控指令
Definition: force_control_cli.hpp:31
rokae::clr::ForceControl::setCartesianMaxVel
void setCartesianMaxVel(array< double >^ velocity, [Out] ErrorCode^% ec)
设置力控模式下, 机械臂末端相对基坐标系的最大速度
rokae::clr::ForceControl::setControlType
void setControlType(int type, [Out] ErrorCode^% ec)
设置阻抗控制类型
rokae::clr::ForceControl::setSineOverlay
void setSineOverlay(int line_dir, double amplify, double frequency, double phase, double bias, [Out] ErrorCode^% ec)
设置绕单轴旋转的正弦搜索运动。 设置阻抗控制类型为笛卡尔阻抗(即setControlType(1))之后, startOverlay()之前调用生效。 各机型的搜索运动幅值上限和搜索运动频率上限不同，请...
rokae::clr::ForceControl::setForceCondition
void setForceCondition(array< double >^ range, bool isInside, double timeout, [Out] ErrorCode^% ec)
设置与接触力有关的终止条件
rokae::clr::ForceControl::setPoseBoxCondition
void setPoseBoxCondition(Frame^ supervising_frame, array< double >^ box, bool isInside, double timeout, [Out] ErrorCode^% ec)
设置与接触位置有关的终止条件
rokae::clr::ForceControl::setJointMaxVel
void setJointMaxVel(array< double >^ velocity, [Out] ErrorCode^% ec)
设置力控模式下的轴最大速度
rokae::clr::ForceControl::setLissajousOverlay
void setLissajousOverlay(int plane, double amplify_one, double frequency_one, double amplify_two, double frequency_two, double phase_diff, [Out] ErrorCode^% ec)
设置平面内的莉萨如搜索运动。 设置阻抗控制类型为笛卡尔阻抗(即setControlType(1))之后, startOverlay()之前调用生效。
rokae::clr::ForceControl::startOverlay
void startOverlay([Out] ErrorCode^% ec)
开启搜索运动，fcStart()之后调用生效。 搜索运动为前序设置的 setSineOverlay()或 setLissajousOverlay()的叠加
rokae::clr::ForceControl::fcInit
void fcInit(FrameType type, [Out] ErrorCode^% ec)
力控初始化
rokae::clr::ForceControl::fcStart
void fcStart([Out] ErrorCode^% ec)
开始力控，fcInit()之后调用。 如需在力控模式下执行运动指令，fcStart()之后可执行。 注意，如果在fcStart()之前通过moveAppend()下发了运动指令但未开始运动，fcStar...
rokae::clr::ForceControl::setCartesianStiffness
void setCartesianStiffness(array< double >^ stiffness, [Out] ErrorCode^% ec)
设置笛卡尔阻抗刚度, fcInit()之后调用生效.
rokae::clr::ForceControl::setTorqueCondition
void setTorqueCondition(array< double >^ range, bool isInside, double timeout, [Out] ErrorCode^% ec)
设置与接触力矩有关的终止条件
rokae::clr::ForceControl::setJointMaxMomentum
void setJointMaxMomentum(array< double >^ momentum, [Out] ErrorCode^% ec)
设置力控模式下轴最大动量。 计算方式：F* t，可以理解为冲量，F为力矩传感器读数，t为控制周期，如果超过30个周期都超过动量阈值则触发保护
rokae::clr::ForceControl::waitCondition
void waitCondition([Out] ErrorCode^% ec)
激活前序设置的终止条件并等待，直到满足这些条件或者超时
rokae::clr::ForceControl::setCartesianNullspaceStiffness
void setCartesianNullspaceStiffness(double stiffness, [Out] ErrorCode^% ec)
设置笛卡尔零空间阻抗刚度。fcInit()之后调用生效
rokae::clr::ForceControl::pauseOverlay
void pauseOverlay([Out] ErrorCode^% ec)
暂停搜索运动。startOverlay()之后调用生效
rokae::clr::ForceControl::fcStop
void fcStop([Out] ErrorCode^% ec)
停止力控
rokae::clr::ForceControl::restartOverlay
void restartOverlay([Out] ErrorCode^% ec)
重新开启暂停的搜索运动。pauseOverlay()之后调用生效。
rokae::clr::ForceControl::setJointDesiredTorque
void setJointDesiredTorque(array< double >^ torque, [Out] ErrorCode^% ec)
设置关节期望力矩。fcStart()之后可调用
rokae::clr::ForceControl::stopOverlay
void stopOverlay([Out] ErrorCode^% ec)
停止搜索运动
rokae::clr::ForceControl::setCartesianDesiredForce
void setCartesianDesiredForce(array< double >^ value, [Out] ErrorCode^% ec)
设置笛卡尔期望力/力矩。fcStart()之后可调用
rokae::clr::ForceControl::getEndTorque
void getEndTorque(FrameType ref_type, array< double >^% joint_torque_measured, array< double >^% external_torque_measured, array< double >^% cart_torque, array< double >^% cart_force, [Out] ErrorCode^% ec)
获取当前力矩信息
rokae::clr::ForceControl::setJointMaxEnergy
void setJointMaxEnergy(array< double >^ energy, [Out] ErrorCode^% ec)
设置力控模式下轴最大动能。 计算方式：F* v，可以理解为功率，F为力矩传感器读数，v为关节速度, 如果超过30个周期都超过动能阈值则触发保护
rokae::clr::ForceControl::fcMonitor
void fcMonitor(bool enable, [Out] ErrorCode^% ec)
启动/关闭力控模块保护监控。 设置监控参数(setJointMaxVel, setJointMaxMomentum, setJointMaxEnergy, setCartesianMaxVel)后，不立...
rokae::clr::ForceControl::setLoad
void setLoad(Load^ load, [Out] ErrorCode^% ec)
设置力控模块使用的负载信息，fcStart()之后可调用。
rokae::clr::ForceControl::setJointStiffness
void setJointStiffness(array< double >^ stiffness, [Out] ErrorCode^% ec)
设置关节阻抗刚度, fcInit()之后调用生效.
rokae::clr::Frame
坐标系
Definition: data_types_cli.hpp:268
rokae::clr::Load
负载信息
Definition: data_types_cli.hpp:416