40#ifndef AUBO_SDK_FORCE_CONTROL_INTERFACE_H
41#define AUBO_SDK_FORCE_CONTROL_INTERFACE_H
46#include <aubo/global_config.h>
50namespace common_interface {
181 const std::vector<bool> &compliance,
182 const std::vector<double> &wrench,
183 const std::vector<double> &limits,
209 const std::vector<double> &stiff_scale);
234 const std::vector<double> &stiff_scale);
260 const std::vector<double> &d,
261 const std::vector<double> &k);
411 const std::vector<double> &max,
bool outside,
455 double max_rot,
bool outside,
double timeout);
520 bool outside,
double timeout);
548 bool outside,
double timeout);
590 const std::vector<double> &max,
bool outside,
627 const std::vector<double> &args,
double timeout);
708 const std::vector<double> &max);
747 double max_rot,
bool outside);
1077 int setDamping(
const std::vector<double> &damping,
double ramp_time);
1168 const std::vector<double> &stiff_percent,
1169 const std::vector<double> &stiff_damp_ratio,
1170 const std::vector<double> &force_threshold,
1171 const std::vector<double> &force_limit);
1184 void *d_{
nullptr };
1189#define ForceControl_DECLARES \
1190 _INST(ForceControl, 0, fcEnable) \
1191 _INST(ForceControl, 0, fcDisable) \
1192 _FUNC(ForceControl, 0, isFcEnabled) \
1193 _INST(ForceControl, 5, setTargetForce, feature, compliance, wrench, limits, type) \
1194 _INST(ForceControl, 1, fcSetSensorThresholds, thresholds) \
1195 _INST(ForceControl, 1, fcSetSensorLimits, limits) \
1196 _FUNC(ForceControl, 0, getFcSensorThresholds) \
1197 _FUNC(ForceControl, 0, getFcSensorLimits) \
1198 _INST(ForceControl, 2, setDynamicModelSearch, damp_scale, stiff_scale) \
1199 _INST(ForceControl, 2, setDynamicModelInsert, damp_scale, stiff_scale) \
1200 _INST(ForceControl, 3, setDynamicModel, m, d, k) \
1201 _FUNC(ForceControl, 0, getDynamicModel) \
1202 _INST(ForceControl, 4, setCondForce, min, max, outside, timeout) \
1203 _INST(ForceControl, 5, setCondOrient, frame, max_angle, max_rot, outside, timeout) \
1204 _INST(ForceControl, 2, setCondPlane, plane, timeout) \
1205 _INST(ForceControl, 4, setCondCylinder, axis, radius, outside, timeout) \
1206 _INST(ForceControl, 4, setCondSphere, center, radius, outside, timeout) \
1207 _INST(ForceControl, 4, setCondTcpSpeed, min, max, outside, timeout) \
1208 _INST(ForceControl, 0, setCondActive) \
1209 _INST(ForceControl, 2, setCondDistance, distance, timeout) \
1210 _INST(ForceControl, 3, setCondAdvanced, type, args, timeout) \
1211 _FUNC(ForceControl, 0, isCondFullfiled) \
1212 _INST(ForceControl, 2, setSupvForce, min, max) \
1213 _INST(ForceControl, 4, setSupvOrient, frame, max_angle, max_rot, outside) \
1214 _INST(ForceControl, 2, setSupvPosBox, frame, box) \
1215 _INST(ForceControl, 2, setSupvPosCylinder, frame, cylinder) \
1216 _INST(ForceControl, 2, setSupvPosSphere, frame, sphere) \
1217 _INST(ForceControl, 3, setSupvReoriSpeed, speed_limit, outside, timeout) \
1218 _INST(ForceControl, 3, setSupvTcpSpeed, speed_limit, outside, timeout) \
1219 _INST(ForceControl, 1, setLpFilter, cutoff_freq) \
1220 _INST(ForceControl, 0, resetLpFilter) \
1221 _INST(ForceControl, 2, speedChangeTune, speed_levels, speed_ratio_min) \
1222 _INST(ForceControl, 1, speedChangeEnable, ref_force) \
1223 _INST(ForceControl, 0, speedChangeDisable) \
1224 _INST(ForceControl, 2, setDamping, damping, ramp_time) \
1225 _INST(ForceControl, 0, resetDamping) \
1226 _INST(ForceControl, 0, softFloatEnable) \
1227 _INST(ForceControl, 0, softFloatDisable) \
1228 _FUNC(ForceControl, 0, isSoftFloatEnabled) \
1229 _INST(ForceControl, 6, setSoftFloatParams, joint_space, select, stiff_percent, stiff_damp_ratio, force_threshold, force_limit) \
1230 _FUNC(ForceControl, 1, toolContact, direction)
int setSoftFloatParams(bool joint_space, const std::vector< bool > &select, const std::vector< double > &stiff_percent, const std::vector< double > &stiff_damp_ratio, const std::vector< double > &force_threshold, const std::vector< double > &force_limit)
设置软浮动参数
int speedChangeEnable(double ref_force)
The FCSpdChgAct is used to activate FC SpeedChange function with desired reference and recover behavi...
int setSupvReoriSpeed(const std::vector< double > &speed_limit, bool outside, double timeout)
FCSupvReoriSpeed is used to set up reorientation speed supervision in Force Control.
int setDynamicModelSearch(const std::vector< double > &damp_scale, const std::vector< double > &stiff_scale)
设置力控搜孔场景下的动力学模型
int fcDisable()
End force control
int setCondDistance(double distance, double timeout)
力控终止条件-距离
bool isSoftFloatEnabled()
返回是否开启了软浮动
int setSupvTcpSpeed(const std::vector< double > &speed_limit, bool outside, double timeout)
FCSupvTCPSpeed is used to set up TCP speed supervision in Force Control.
int setCondActive()
激活力控终止条件
bool isCondFullfiled()
力控终止条件是否已经满足
int setDynamicModelInsert(const std::vector< double > &damp_scale, const std::vector< double > &stiff_scale)
设置力控插/拔孔场景下的动力学模型
int setCondCylinder(const std::vector< double > &axis, double radius, bool outside, double timeout)
指定力控有效圆柱体,提供中心轴和圆柱半径,可以指定圆柱内部还是外部
int setDamping(const std::vector< double > &damping, double ramp_time)
FCSetDampingTune is used to tune the damping in the force control coordinate systems.
int resetLpFilter()
重置低通滤波器
int setCondAdvanced(const std::string &type, const std::vector< double > &args, double timeout)
高级力控终止条件
int setLpFilter(const std::vector< double > &cutoff_freq)
设置低通滤波器
int setCondTcpSpeed(const std::vector< double > &min, const std::vector< double > &max, bool outside, double timeout)
FCCondTCPSpeed is used to setup an end condition for the TCP speed.
int setCondForce(const std::vector< double > &min, const std::vector< double > &max, bool outside, double timeout)
设置力控终止条件:力,当测量的力在设置的范围之内,力控算法将保持运行,直到设置的条件不满足,力控将退出
int setCondSphere(const std::vector< double > ¢er, double radius, bool outside, double timeout)
指定力控有效球体,提供球心和半径,可以指定球体内部还是外部
int setCondPlane(const std::vector< double > &plane, double timeout)
指定力控有效平面,x-y平面,z方向有效
bool isFcEnabled()
判断力控是否被使能
int setSupvPosBox(const std::vector< double > &frame, const Box &box)
FCSupvPos is used to set up position supervision in Force Control.
int setSupvPosSphere(const std::vector< double > &frame, const Sphere &sphere)
int setSupvForce(const std::vector< double > &min, const std::vector< double > &max)
FCSupvForce is used to set up force supervision in Force Control.
std::vector< double > getFcSensorLimits()
获取最大力限制
int speedChangeDisable()
Deactivate FC SpeedChange function.
int fcSetSensorThresholds(const std::vector< double > &thresholds)
设置力控阈值
int setSupvPosCylinder(const std::vector< double > &frame, const Cylinder &cylinder)
int setDynamicModel(const std::vector< double > &m, const std::vector< double > &d, const std::vector< double > &k)
设置力控动力学模型
int fcSetSensorLimits(const std::vector< double > &limits)
设置力控最大受力限制
DynamicsModel getDynamicModel()
获取力控动力学模型
int setTargetForce(const std::vector< double > &feature, const std::vector< bool > &compliance, const std::vector< double > &wrench, const std::vector< double > &limits, TaskFrameType type=TaskFrameType::FRAME_FORCE)
设置力控参考(目标)值
int fcEnable()
Start force control
int setSupvOrient(const std::vector< double > &frame, double max_angle, double max_rot, bool outside)
FCSupvOrient is used to set up an supervision for the tool orientation.
std::vector< double > getFcSensorThresholds()
获取力控阈值
int speedChangeTune(int speed_levels, double speed_ratio_min)
FCSpdChgTunSet is used to set FC SpeedChange system parameters to a new value.
int toolContact(const std::vector< bool > &direction)
检测工具和外部物体的接触
int setCondOrient(const std::vector< double > &frame, double max_angle, double max_rot, bool outside, double timeout)
FCCondOrient is used to set up an end condition for the tool orientation.
std::tuple< std::vector< double >, std::vector< double >, std::vector< double > > DynamicsModel
std::vector< double > Box
std::vector< double > Sphere
std::shared_ptr< ForceControl > ForceControlPtr
std::vector< double > Cylinder