ARCS SDK API  0.24.0
robot_config.h
浏览该文件的文档.
1 /** @file robot_config.h
2  * @brief 获取机器人配置接口,如获取DH参数、碰撞等级、安装位姿等等
3  */
4 #ifndef AUBO_SDK_ROBOT_CONFIG_H
5 #define AUBO_SDK_ROBOT_CONFIG_H
6 
7 #include <vector>
8 #include <unordered_map>
9 
10 #include <aubo/global_config.h>
11 #include <aubo/type_def.h>
12 
13 namespace arcs {
14 namespace common_interface {
15 
16 class ARCS_ABI_EXPORT RobotConfig
17 {
18 public:
19  RobotConfig();
20  virtual ~RobotConfig();
21 
22  /**
23  * 获取机器人的名字
24  *
25  * @return 返回机器人的名字
26  *
27  * @throws arcs::common_interface::AuboException
28  *
29  * @par Python函数原型
30  * getName(self: pyaubo_sdk.RobotConfig) -> str
31  *
32  * @par Lua函数原型
33  * getName() -> string
34  *
35  */
36  std::string getName();
37 
38  /**
39  * 获取机器人的自由度(从硬件抽象层读取)
40  *
41  * @return 返回机器人的自由度
42  *
43  * @throws arcs::common_interface::AuboException
44  *
45  * @par Python函数原型
46  * getDof(self: pyaubo_sdk.RobotConfig) -> int
47  *
48  * @par Lua函数原型
49  * getDof() -> number
50  *
51  */
52  int getDof();
53 
54  /**
55  * 获取机器人的伺服控制周期(从硬件抽象层读取)
56  *
57  * @return 机器人的伺服控制周期
58  *
59  * @throws arcs::common_interface::AuboException
60  *
61  * @par Python函数原型
62  * getCycletime(self: pyaubo_sdk.RobotConfig) -> float
63  *
64  * @par Lua函数原型
65  * getCycletime() -> number
66  *
67  */
68  double getCycletime();
69 
70  /**
71  * 预设缓速模式下的速度缩减比例
72  *
73  * @param level 缓速等级 1, 2
74  * @param fraction
75  *
76  * @return 成功返回0;失败返回错误码
77  * AUBO_BUSY
78  * AUBO_BAD_STATE
79  * AUBO_INVL_ARGUMENT
80  * -AUBO_BAD_STATE
81  *
82  * @throws arcs::common_interface::AuboException
83  *
84  */
85  int setSlowDownFraction(int level, double fraction);
86 
87  /**
88  * 获取预设的缓速模式下的速度缩减比例
89  *
90  * @param level 缓速等级 1, 2
91  * @return 返回预设的缓速模式下的速度缩减比例
92  *
93  * @throws arcs::common_interface::AuboException
94  *
95  */
96  double getSlowDownFraction(int level);
97 
98  /**
99  * 获取默认的工具端加速度,单位m/s^2
100  *
101  * @return 默认的工具端加速度
102  *
103  * @throws arcs::common_interface::AuboException
104  *
105  * @par Python函数原型
106  * getDefaultToolAcc(self: pyaubo_sdk.RobotConfig) -> float
107  *
108  * @par Lua函数原型
109  * getDefaultToolAcc() -> number
110  *
111  */
112  double getDefaultToolAcc();
113 
114  /**
115  * 获取默认的工具端速度,单位m/s
116  *
117  * @return 默认的工具端速度
118  *
119  * @throws arcs::common_interface::AuboException
120  *
121  * @par Python函数原型
122  * getDefaultToolSpeed(self: pyaubo_sdk.RobotConfig) -> float
123  *
124  * @par Lua函数原型
125  * getDefaultToolSpeed() -> number
126  *
127  */
128  double getDefaultToolSpeed();
129 
130  /**
131  * 获取默认的关节加速度,单位rad/s^2
132  *
133  * @return 默认的关节加速度
134  *
135  * @throws arcs::common_interface::AuboException
136  *
137  * @par Python函数原型
138  * getDefaultJointAcc(self: pyaubo_sdk.RobotConfig) -> float
139  *
140  * @par Lua函数原型
141  * getDefaultJointAcc() -> number
142  *
143  */
144  double getDefaultJointAcc();
145 
146  /**
147  * 获取默认的关节速度,单位rad/s
148  *
149  * @return 默认的关节速度
150  *
151  * @throws arcs::common_interface::AuboException
152  *
153  * @par Python函数原型
154  * getDefaultJointSpeed(self: pyaubo_sdk.RobotConfig) -> float
155  *
156  * @par Lua函数原型
157  * getDefaultJointSpeed() -> number
158  *
159  */
160  double getDefaultJointSpeed();
161 
162  /**
163  * 获取机器人类型代码
164  *
165  * @return 机器人类型代码
166  *
167  * @throws arcs::common_interface::AuboException
168  *
169  * @par Python函数原型
170  * getRobotType(self: pyaubo_sdk.RobotConfig) -> str
171  *
172  * @par Lua函数原型
173  * getRobotType() -> string
174  *
175  */
176  std::string getRobotType();
177 
178  /**
179  * 获取机器人子类型代码
180  *
181  * @return 机器人子类型代码
182  *
183  * @throws arcs::common_interface::AuboException
184  *
185  * @par Python函数原型
186  * getRobotSubType(self: pyaubo_sdk.RobotConfig) -> str
187  *
188  * @par Lua函数原型
189  * getRobotSubType() -> string
190  *
191  */
192  std::string getRobotSubType();
193 
194  /**
195  * 获取控制柜类型代码
196  *
197  * @return 控制柜类型代码
198  *
199  * @throws arcs::common_interface::AuboException
200  *
201  * @par Python函数原型
202  * getControlBoxType(self: pyaubo_sdk.RobotConfig) -> str
203  *
204  * @par Lua函数原型
205  * getControlBoxType() -> string
206  *
207  */
208  std::string getControlBoxType();
209 
210  /**
211  * 设置安装位姿(机器人的基坐标系相对于世界坐标系) world->base
212  *
213  * 一般在多机器人系统中使用,默认为 [0,0,0,0,0,0]
214  *
215  * @param pose 安装位姿
216  * @return 成功返回0; 失败返回错误码
217  * AUBO_BUSY
218  * AUBO_BAD_STATE
219  * -AUBO_INVL_ARGUMENT
220  * -AUBO_BAD_STATE
221  *
222  * @throws arcs::common_interface::AuboException
223  *
224  * @par Python函数原型
225  * setMountingPose(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int
226  *
227  * @par Lua函数原型
228  * setMountingPose(pose: table) -> nil
229  *
230  */
231  int setMountingPose(const std::vector<double> &pose);
232 
233  /**
234  * 获取安装位姿(机器人的基坐标系相对于世界坐标系)
235  *
236  * @return 安装位姿
237  *
238  * @throws arcs::common_interface::AuboException
239  *
240  * @par Python函数原型
241  * getMountingPose(self: pyaubo_sdk.RobotConfig) -> List[float]
242  *
243  * @par Lua函数原型
244  * getMountingPose() -> table
245  *
246  */
247  std::vector<double> getMountingPose();
248 
249  /**
250  * 设置碰撞灵敏度等级
251  * 数值越大越灵敏
252  *
253  * @param level 碰撞灵敏度等级
254  * 0: 关闭碰撞检测功能
255  * 1~9: 碰撞灵敏等级
256  * @return 成功返回0; 失败返回错误码
257  * AUBO_BUSY
258  * AUBO_BAD_STATE
259  * -AUBO_INVL_ARGUMENT
260  * -AUBO_BAD_STATE
261  *
262  * @throws arcs::common_interface::AuboException
263  *
264  * @par Python函数原型
265  * setCollisionLevel(self: pyaubo_sdk.RobotConfig, arg0: int) -> int
266  *
267  * @par Lua函数原型
268  * setCollisionLevel(level: number) -> nil
269  *
270  */
271  int setCollisionLevel(int level);
272 
273  /**
274  * 获取碰撞灵敏度等级
275  *
276  * @return 碰撞灵敏度等级
277  *
278  * @throws arcs::common_interface::AuboException
279  *
280  * @par Python函数原型
281  * getCollisionLevel(self: pyaubo_sdk.RobotConfig) -> int
282  *
283  * @par Lua函数原型
284  * getCollisionLevel() -> number
285  *
286  */
287  int getCollisionLevel();
288 
289  /**
290  * 设置碰撞停止类型
291  *
292  * @param type 类型 \n
293  * 0: 碰撞之后进入拖动模式 \n
294  * 1: 碰撞停机
295  * @return 成功返回0; 失败返回错误码
296  * AUBO_BUSY
297  * AUBO_BAD_STATE
298  * -AUBO_INVL_ARGUMENT
299  * -AUBO_BAD_STATE
300  *
301  * @throws arcs::common_interface::AuboException
302  *
303  * @par Python函数原型
304  * setCollisionStopType(self: pyaubo_sdk.RobotConfig, arg0: int) -> int
305  *
306  * @par Lua函数原型
307  * setCollisionStopType(type: number) -> nil
308  *
309  */
310  int setCollisionStopType(int type);
311 
312  /**
313  * 获取碰撞停止类型
314  *
315  * @return 返回碰撞停止类型
316  *
317  * @throws arcs::common_interface::AuboException
318  *
319  * @par Python函数原型
320  * getCollisionStopType(self: pyaubo_sdk.RobotConfig) -> int
321  *
322  * @par Lua函数原型
323  * getCollisionStopType() -> number
324  *
325  */
326  int getCollisionStopType();
327 
328  /**
329  * 设置机器人的 Home 位置
330  *
331  * @param positions 关节角度
332  * @return 成功返回0;失败返回错误码
333  * AUBO_BUSY
334  * AUBO_BAD_STATE
335  * -AUBO_INVL_ARGUMENT
336  * -AUBO_BAD_STATE
337  *
338  * @throws arcs::common_interface::AuboException
339  *
340  */
341  int setHomePosition(const std::vector<double> &positions);
342 
343  /**
344  * 获取机器人 Home 位置
345  *
346  * @return
347  *
348  * @throws arcs::common_interface::AuboException
349  *
350  */
351  std::vector<double> getHomePosition();
352 
353  /**
354  * 设置拖动阻尼
355  *
356  * @param damp 阻尼
357  *
358  * @return 成功返回0;失败返回错误码
359  * AUBO_BUSY
360  * AUBO_BAD_STATE
361  * -AUBO_INVL_ARGUMENT
362  * -AUBO_BAD_STATE
363  *
364  * @throws arcs::common_interface::AuboException
365  *
366  * @par Python函数原型
367  * setFreedriveDamp(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int
368  *
369  * @par Lua函数原型
370  * setFreedriveDamp(damp: table) -> number
371  *
372  */
373  int setFreedriveDamp(const std::vector<double> &damp);
374 
375  /**
376  * 获取拖动阻尼
377  *
378  * @return 拖动阻尼
379  *
380  * @throws arcs::common_interface::AuboException
381  *
382  * @par Python函数原型
383  * getFreedriveDamp(self: pyaubo_sdk.RobotConfig) -> List[float]
384  *
385  * @par Lua函数原型
386  * getFreedriveDamp() -> table
387  *
388  */
389  std::vector<double> getFreedriveDamp();
390 
391  /**
392  * 获取机器人DH参数
393  * alpha a d theta beta
394  *
395  * @param real 读取真实参数(理论值+补偿值)或者理论参数
396  * @return 返回机器人DH参数
397  *
398  * @throws arcs::common_interface::AuboException
399  *
400  * @par Python函数原型
401  * getKinematicsParam(self: pyaubo_sdk.RobotConfig, arg0: bool) -> Dict[str,
402  * List[float]]
403  *
404  * @par Lua函数原型
405  * getKinematicsParam(real: boolean) -> table
406  *
407  */
408  std::unordered_map<std::string, std::vector<double>> getKinematicsParam(
409  bool real);
410 
411  /**
412  * 获取指定温度下的DH参数补偿值:alpha a d theta beta
413  *
414  * @param ref_temperature 参考温度 ℃,默认20℃
415  * @return 返回DH参数补偿值
416  *
417  * @throws arcs::common_interface::AuboException
418  *
419  * @par Python函数原型
420  * getKinematicsCompensate(self: pyaubo_sdk.RobotConfig, arg0: float) ->
421  * Dict[str, List[float]]
422  *
423  * @par Lua函数原型
424  * getKinematicsCompensate(ref_temperature: number) -> table
425  *
426  */
427  std::unordered_map<std::string, std::vector<double>>
428  getKinematicsCompensate(double ref_temperature);
429 
430  /**
431  * 设置标准 DH 补偿到机器人
432  *
433  * @param param
434  *
435  * @return 成功返回0;失败返回错误码
436  * AUBO_BUSY
437  * AUBO_BAD_STATE
438  * -AUBO_INVL_ARGUMENT
439  * -AUBO_BAD_STATE
440  *
441  * @throws arcs::common_interface::AuboException
442  *
443  */
444  int setKinematicsCompensate(
445  const std::unordered_map<std::string, std::vector<double>> &param);
446 
447  /**
448  * 设置需要保存到接口板底座的参数
449  *
450  * @param param 补偿数据
451  *
452  * @return 成功返回0;失败返回错误码
453  * AUBO_BUSY
454  * AUBO_BAD_STATE
455  * -AUBO_INVL_ARGUMENT
456  * -AUBO_BAD_STATE
457  *
458  * @throws arcs::common_interface::AuboException
459  *
460  * @par Python函数原型
461  * setPersistentParameters(self: pyaubo_sdk.RobotConfig, arg0: str) -> int
462  *
463  * @par Lua函数原型
464  * setPersistentParameters(param: string) -> nil
465  *
466  */
467  int setPersistentParameters(const std::string &param);
468 
469  /**
470  * 设置硬件抽象层自定义参数
471  * 目的是为了做不同硬件之间的兼容
472  *
473  * @param param 自定义参数
474  *
475  * @return 成功返回0;失败返回错误码
476  * AUBO_BUSY
477  * AUBO_BAD_STATE
478  * -AUBO_INVL_ARGUMENT
479  * -AUBO_BAD_STATE
480  *
481  * @throws arcs::common_interface::AuboException
482  *
483  */
484  int setHardwareCustomParameters(const std::string &param);
485 
486  /**
487  * 获取硬件抽象层自定义参数
488  *
489  * @param
490  * @return 返回硬件抽象层自定义的参数
491  *
492  * @throws arcs::common_interface::AuboException
493  *
494  */
495  std::string getHardwareCustomParameters(const std::string &param);
496 
497  /**
498  * 设置机器人关节零位
499  *
500  * @return 成功返回0;失败返回错误码
501  * AUBO_BUSY
502  * AUBO_BAD_STATE
503  * -AUBO_BAD_STATE
504  *
505  * @throws arcs::common_interface::AuboException
506  *
507  * @par Python函数原型
508  * setRobotZero(self: pyaubo_sdk.RobotConfig) -> int
509  *
510  * @par Lua函数原型
511  * setRobotZero() -> nil
512  *
513  */
514  int setRobotZero();
515 
516  /**
517  * 获取可用的末端力矩传感器的名字
518  *
519  * @return 返回可用的末端力矩传感器的名字
520  *
521  * @throws arcs::common_interface::AuboException
522  *
523  * @par Python函数原型
524  * getTcpForceSensorNames(self: pyaubo_sdk.RobotConfig) -> List[str]
525  *
526  * @par Lua函数原型
527  * getTcpForceSensorNames() -> table
528  *
529  */
530  std::vector<std::string> getTcpForceSensorNames();
531 
532  /**
533  * 设置末端力矩传感器
534  * 如果存在内置的末端力矩传感器,默认将使用内置的力矩传感器
535  *
536  * @param name 末端力矩传感器的名字
537  *
538  * @return 成功返回0;失败返回错误码
539  * AUBO_BUSY
540  * AUBO_BAD_STATE
541  * -AUBO_INVL_ARGUMENT
542  * -AUBO_BAD_STATE
543  *
544  * @throws arcs::common_interface::AuboException
545  *
546  * @par Python函数原型
547  * selectTcpForceSensor(self: pyaubo_sdk.RobotConfig, arg0: str) -> int
548  *
549  * @par Lua函数原型
550  * selectTcpForceSensor(name: string) -> nil
551  *
552  */
553  int selectTcpForceSensor(const std::string &name);
554 
555  /**
556  * 设置传感器安装位姿
557  *
558  * @param sensor_pose 传感器安装位姿
559  *
560  * @return 成功返回0;失败返回错误码
561  * AUBO_BUSY
562  * AUBO_BAD_STATE
563  * -AUBO_INVL_ARGUMENT
564  * -AUBO_BAD_STATE
565  *
566  * @throws arcs::common_interface::AuboException
567  *
568  */
569  int setTcpForceSensorPose(const std::vector<double> &sensor_pose);
570 
571  /**
572  * 获取传感器安装位姿
573  *
574  * @return 传感器安装位姿
575  *
576  * @throws arcs::common_interface::AuboException
577  *
578  */
579  std::vector<double> getTcpForceSensorPose();
580  /**
581  * 是否安装了末端力矩传感器
582  *
583  * @return 安装返回true; 没有安装返回false
584  *
585  * @throws arcs::common_interface::AuboException
586  *
587  * @par Python函数原型
588  * hasTcpForceSensor(self: pyaubo_sdk.RobotConfig) -> bool
589  *
590  * @par Lua函数原型
591  * hasTcpForceSensor() -> boolean
592  *
593  */
594  bool hasTcpForceSensor();
595 
596  /**
597  * 设置末端力矩偏移
598  *
599  * @param force_offset 末端力矩偏移
600  * @return 成功返回0; 失败返回错误码
601  *
602  * @throws arcs::common_interface::AuboException
603  *
604  * @par Python函数原型
605  * setTcpForceOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int
606  *
607  * @par Lua函数原型
608  * setTcpForceOffset(force_offset: table) -> nil
609  *
610  */
611  int setTcpForceOffset(const std::vector<double> &force_offset);
612 
613  /**
614  * 获取末端力矩偏移
615  *
616  * @return 返回末端力矩偏移
617  *
618  * @throws arcs::common_interface::AuboException
619  *
620  * @par Python函数原型
621  * getTcpForceOffset(self: pyaubo_sdk.RobotConfig) -> List[float]
622  *
623  * @par Lua函数原型
624  * getTcpForceOffset() -> table
625  *
626  */
627  std::vector<double> getTcpForceOffset();
628 
629  /**
630  * 获取可用的底座力矩传感器的名字
631  *
632  * @return 返回可用的底座力矩传感器的名字
633  *
634  * @throws arcs::common_interface::AuboException
635  *
636  * @par Python函数原型
637  * getBaseForceSensorNames(self: pyaubo_sdk.RobotConfig) -> List[str]
638  *
639  * @par Lua函数原型
640  * getBaseForceSensorNames() -> table
641  *
642  */
643  std::vector<std::string> getBaseForceSensorNames();
644 
645  /**
646  * 设置底座力矩传感器
647  * 如果存在内置的底座力矩传感器,默认将使用内置的力矩传感器
648  *
649  * @param name 底座力矩传感器的名字
650  *
651  * @return 成功返回0;失败返回错误码
652  * AUBO_BUSY
653  * AUBO_BAD_STATE
654  * -AUBO_INVL_ARGUMENT
655  * -AUBO_BAD_STATE
656  *
657  * @throws arcs::common_interface::AuboException
658  *
659  * @par Python函数原型
660  * selectBaseForceSensor(self: pyaubo_sdk.RobotConfig, arg0: str) -> int
661  *
662  * @par Lua函数原型
663  * selectBaseForceSensor(name: string) -> nil
664  *
665  */
666  int selectBaseForceSensor(const std::string &name);
667 
668  /**
669  * 是否安装了底座力矩传感器
670  *
671  * @return 安装返回true;没有安装返回false
672  *
673  * @throws arcs::common_interface::AuboException
674  *
675  * @par Python函数原型
676  * hasBaseForceSensor(self: pyaubo_sdk.RobotConfig) -> bool
677  *
678  * @par Lua函数原型
679  * hasBaseForceSensor() -> boolean
680  *
681  */
682  bool hasBaseForceSensor();
683 
684  /**
685  * 设置底座力矩偏移
686  *
687  * @param force_offset 底座力矩偏移
688  *
689  * @return 成功返回0;失败返回错误码
690  * AUBO_BUSY
691  * AUBO_BAD_STATE
692  * -AUBO_INVL_ARGUMENT
693  * -AUBO_BAD_STATE
694  *
695  * @throws arcs::common_interface::AuboException
696  *
697  * @par Python函数原型
698  * setBaseForceOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) ->
699  * int
700  *
701  * @par Lua函数原型
702  * setBaseForceOffset(force_offset: table) -> nil
703  *
704  */
705  int setBaseForceOffset(const std::vector<double> &force_offset);
706 
707  /**
708  * 获取底座力矩偏移
709  *
710  * @return 返回底座力矩偏移
711  *
712  * @throws arcs::common_interface::AuboException
713  *
714  * @par Python函数原型
715  * getBaseForceOffset(self: pyaubo_sdk.RobotConfig) -> List[float]
716  *
717  * @par Lua函数原型
718  * getBaseForceOffset() -> table
719  *
720  */
721  std::vector<double> getBaseForceOffset();
722 
723  /**
724  * 获取安全参数校验码 CRC32
725  *
726  * @return 返回安全参数校验码
727  *
728  * @throws arcs::common_interface::AuboException
729  *
730  * @par Python函数原型
731  * getSafetyParametersCheckSum(self: pyaubo_sdk.RobotConfig) -> int
732  *
733  * @par Lua函数原型
734  * getSafetyParametersCheckSum() -> number
735  *
736  */
737  uint32_t getSafetyParametersCheckSum();
738 
739  /**
740  * 发起确认安全配置参数请求:
741  * 将安全配置参数写入到安全接口板flash或文件
742  *
743  * @param parameters 安全配置参数
744  *
745  * @return 成功返回0;失败返回错误码
746  * AUBO_BUSY
747  * AUBO_BAD_STATE
748  * -AUBO_INVL_ARGUMENT
749  * -AUBO_BAD_STATE
750  *
751  * @throws arcs::common_interface::AuboException
752  *
753  * @par Python函数原型
754  * confirmSafetyParameters(self: pyaubo_sdk.RobotConfig, arg0:
755  * arcs::common_interface::RobotSafetyParameterRange) -> int
756  *
757  * @par Lua函数原型
758  *
759  *
760  */
761  int confirmSafetyParameters(const RobotSafetyParameterRange &parameters);
762 
763  /**
764  * 计算安全参数的 CRC32 校验值
765  *
766  * @return crc32
767  *
768  * @throws arcs::common_interface::AuboException
769  *
770  */
771  uint32_t calcSafetyParametersCheckSum(
772  const RobotSafetyParameterRange &parameters);
773 
774  /**
775  * 获取关节最大位置(物理极限)
776  *
777  * @return 返回关节最大位置
778  *
779  * @throws arcs::common_interface::AuboException
780  *
781  * @par Python函数原型
782  * getJointMaxPositions(self: pyaubo_sdk.RobotConfig) -> List[float]
783  *
784  * @par Lua函数原型
785  * getJointMaxPositions() -> table
786  *
787  */
788  std::vector<double> getJointMaxPositions();
789 
790  /**
791  * 获取关节最小位置(物理极限)
792  *
793  * @return 返回关节最小位置
794  *
795  * @throws arcs::common_interface::AuboException
796  *
797  * @par Python函数原型
798  * getJointMinPositions(self: pyaubo_sdk.RobotConfig) -> List[float]
799  *
800  * @par Lua函数原型
801  * getJointMinPositions() -> table
802  *
803  */
804  std::vector<double> getJointMinPositions();
805 
806  /**
807  * 获取关节最大速度(物理极限)
808  *
809  * @return 返回关节最大速度
810  *
811  * @throws arcs::common_interface::AuboException
812  *
813  * @par Python函数原型
814  * getJointMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float]
815  *
816  * @par Lua函数原型
817  * getJointMaxSpeeds() -> table
818  *
819  */
820  std::vector<double> getJointMaxSpeeds();
821 
822  /**
823  * 获取关节最大加速度(物理极限)
824  *
825  * @return 返回关节最大加速度
826  *
827  * @throws arcs::common_interface::AuboException
828  *
829  * @par Python函数原型
830  * getJointMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> List[float]
831  *
832  * @par Lua函数原型
833  * getJointMaxAccelerations() -> table
834  *
835  */
836  std::vector<double> getJointMaxAccelerations();
837 
838  /**
839  * 获取TCP最大速度(物理极限)
840  *
841  * @return 返回TCP最大速度
842  *
843  * @throws arcs::common_interface::AuboException
844  *
845  * @par Python函数原型
846  * getTcpMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float]
847  *
848  * @par Lua函数原型
849  * getTcpMaxSpeeds() -> table
850  *
851  */
852  std::vector<double> getTcpMaxSpeeds();
853 
854  /**
855  * 获取TCP最大加速度(物理极限)
856  *
857  * @return 返回TCP最大加速度
858  *
859  * @throws arcs::common_interface::AuboException
860  *
861  * @par Python函数原型
862  * getTcpMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> List[float]
863  *
864  * @par Lua函数原型
865  * getTcpMaxAccelerations() -> table
866  *
867  */
868  std::vector<double> getTcpMaxAccelerations();
869 
870  /**
871  * 设置机器人安装姿态
872  *
873  * @param gravity 安装姿态
874  *
875  * @return 成功返回0;失败返回错误码
876  * AUBO_BUSY
877  * AUBO_BAD_STATE
878  * -AUBO_INVL_ARGUMENT
879  * -AUBO_BAD_STATE
880  *
881  * @throws arcs::common_interface::AuboException
882  *
883  * @par Python函数原型
884  * setGravity(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int
885  *
886  * @par Lua函数原型
887  * setGravity(gravity: table) -> nil
888  *
889  */
890  int setGravity(const std::vector<double> &gravity);
891 
892  /**
893  * 获取机器人的安装姿态
894  *
895  * 如果机器人底座安装了姿态传感器,则从传感器读取数据,否则按照用户设置
896  *
897  * @return 返回安装姿态
898  *
899  * @throws arcs::common_interface::AuboException
900  *
901  * @par Python函数原型
902  * getGravity(self: pyaubo_sdk.RobotConfig) -> List[float]
903  *
904  * @par Lua函数原型
905  * getGravity() -> table
906  *
907  */
908  std::vector<double> getGravity();
909 
910  /**
911  * 设置当前的TCP偏移
912  *
913  * TCP偏移表示形式为(x,y,z,rx,ry,rz)。
914  * 其中x、y、z是工具中心点(TCP)在基坐标系下相对于法兰盘中心的位置偏移,单位是m。
915  * rx、ry、rz是工具中心点(TCP)在基坐标系下相对于法兰盘中心的的姿态偏移,是ZYX欧拉角,单位是rad。
916  *
917  * @param offset 当前的TCP偏移,形式为(x,y,z,rx,ry,rz)
918  *
919  * @return 成功返回0;失败返回错误码
920  * AUBO_BUSY
921  * AUBO_BAD_STATE
922  * -AUBO_INVL_ARGUMENT
923  * -AUBO_BAD_STATE
924  *
925  * @throws arcs::common_interface::AuboException
926  *
927  * @par Python函数原型
928  * setTcpOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int
929  *
930  * @par Lua函数原型
931  * setTcpOffset(offset: table) -> nil
932  *
933  */
934  int setTcpOffset(const std::vector<double> &offset);
935 
936  /**
937  * 获取当前的TCP偏移
938  *
939  * TCP偏移表示形式为(x,y,z,rx,ry,rz)。
940  * 其中x、y、z是工具中心点(TCP)在基坐标系下相对于法兰盘中心的位置偏移,单位是m。
941  * rx、ry、rz是工具中心点(TCP)在基坐标系下相对于法兰盘中心的的姿态偏移,是ZYX欧拉角,单位是rad。
942  *
943  * @return 当前的TCP偏移,形式为(x,y,z,rx,ry,rz)
944  *
945  * @throws arcs::common_interface::AuboException
946  *
947  * @par Python函数原型
948  * getTcpOffset(self: pyaubo_sdk.RobotConfig) -> List[float]
949  *
950  * @par Lua函数原型
951  * getTcpOffset() -> table
952  *
953  */
954  std::vector<double> getTcpOffset();
955 
956  /**
957  * 设置工具端质量、质心及惯量
958  *
959  * @param m 工具端质量
960  * @param com 质心
961  * @param inertial 惯量
962  *
963  * @return 成功返回0;失败返回错误码
964  * AUBO_BUSY
965  * AUBO_BAD_STATE
966  * -AUBO_INVL_ARGUMENT
967  * -AUBO_BAD_STATE
968  *
969  * @throws arcs::common_interface::AuboException
970  *
971  * @par Python函数原型
972  * setToolInertial(self: pyaubo_sdk.RobotConfig, arg0: float, arg1:
973  * List[float], arg2: List[float]) -> int
974  *
975  * @par Lua函数原型
976  * setToolInertial(m: number, com: table, inertial: table) -> nil
977  *
978  */
979  int setToolInertial(double m, const std::vector<double> &com,
980  const std::vector<double> &inertial);
981 
982  /**
983  * 设置有效负载
984  *
985  * @param m 质量, 单位: kg
986  * @param cog 重心, 单位: m, 形式为(CoGx, CoGy, CoGz)
987  * @param aom 力矩轴的方向, 单位: rad, 形式为(rx, ry, rz)
988  * @param inertia 惯量, 单位: kg*m^2, 形式为(Ixx, Ixy, Ixz, Iyx, Iyy, Iyz,
989  * Izx, Izy, Izz)
990  *
991  * @return 成功返回0;失败返回错误码
992  * AUBO_BUSY
993  * AUBO_BAD_STATE
994  * -AUBO_INVL_ARGUMENT
995  * -AUBO_BAD_STATE
996  *
997  * @throws arcs::common_interface::AuboException
998  *
999  * @par Python函数原型
1000  * setPayload(self: pyaubo_sdk.RobotConfig, arg0: float, arg1: List[float],
1001  * arg2: List[float], arg3: List[float]) -> int
1002  *
1003  * @par Lua函数原型
1004  * setPayload(m: number, cog: table, aom: table, inertia: table) -> nil
1005  *
1006  * @par Lua示例
1007  * setPayload(3, {0,0,0}, {0,0,0}, {0,0,0,0,0,0,0,0,0})
1008  *
1009  * @par JSON-RPC请求示例
1010  * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setPayload","params":[3,[0,0,0],[0,0,0],[0,0,0,0,0,0,0,0,0]],"id":1}
1011  *
1012  * @par JSON-RPC响应示例
1013  * {"id":1,"jsonrpc":"2.0","result":0}
1014  *
1015  */
1016  int setPayload(double m, const std::vector<double> &cog,
1017  const std::vector<double> &aom,
1018  const std::vector<double> &inertia);
1019 
1020  /**
1021  * 获取有效负载
1022  *
1023  * @return 有效负载.
1024  * 第一个元素表示质量, 单位: kg;
1025  * 第二个元素表示重心, 单位: m, 形式为(CoGx, CoGy, CoGz);
1026  * 第三个元素表示力矩轴的方向, 单位: rad, 形式为(rx, ry, rz);
1027  * 第四个元素表示惯量, 单位: kg*m^2, 形式为(Ixx, Ixy, Ixz, Iyx, Iyy, Iyz,
1028  * Izx, Izy, Izz)
1029  *
1030  * @throws arcs::common_interface::AuboException
1031  *
1032  * @par Python函数原型
1033  * getPayload(self: pyaubo_sdk.RobotConfig) -> Tuple[float, List[float],
1034  * List[float], List[float]]
1035  *
1036  * @par Lua函数原型
1037  * getPayload() -> number, table, table, table
1038  *
1039  * @par Lua示例
1040  * m, cog, aom, inertia = getPayload()
1041  *
1042  * @par JSON-RPC请求示例
1043  * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getPayload","params":[],"id":1}
1044  *
1045  * @par JSON-RPC响应示例
1046  * {"id":1,"jsonrpc":"2.0","result":[3.0,[0.0,0.0,0.0],[0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]]}
1047  *
1048  */
1049  Payload getPayload();
1050 
1051  /**
1052  * 末端位姿是否在安全范围之内
1053  *
1054  * @param pose 末端位姿
1055  * @return 在安全范围内返回true; 反之返回false
1056  *
1057  * @throws arcs::common_interface::AuboException
1058  *
1059  * @par Python函数原型
1060  * toolSpaceInRange(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> bool
1061  *
1062  * @par Lua函数原型
1063  * toolSpaceInRange(pose: table) -> boolean
1064  *
1065  */
1066  bool toolSpaceInRange(const std::vector<double> &pose);
1067 
1068  /**
1069  * 发起固件升级请求,控制器软件将进入固件升级模式
1070  *
1071  * @param fw 固件路径 \n
1072  * pm://param/model/xx.bin \n
1073  * /absolute/path/to/xx.bin \n
1074  * relative/path/to/xx.bin
1075  * @return 成功返回0; 失败返回错误码
1076  * AUBO_BUSY
1077  * AUBO_BAD_STATE
1078  * -AUBO_INVL_ARGUMENT
1079  * -AUBO_BAD_STATE: 当前运行时状态不处于 Stopped, 固件升级请求被拒绝
1080  *
1081  * @throws arcs::common_interface::AuboException
1082  *
1083  * @par Python函数原型
1084  * firmwareUpdate(self: pyaubo_sdk.RobotConfig, arg0: str) -> int
1085  *
1086  * @par Lua函数原型
1087  * firmwareUpdate(fw: string) -> nil
1088  *
1089  */
1090  int firmwareUpdate(const std::string &fw);
1091 
1092  /**
1093  * 获取固件升级的进程
1094  *
1095  * @return 返回升级进程 \n
1096  * std::string 代表步骤名称 \n
1097  * double 代表进度(0~1),完成之后,返回("", 1)
1098  *
1099  * @throws arcs::common_interface::AuboException
1100  *
1101  * @par Python函数原型
1102  * getFirmwareUpdateProcess(self: pyaubo_sdk.RobotConfig) -> Tuple[str,
1103  * float]
1104  *
1105  * @par Lua函数原型
1106  * getFirmwareUpdateProcess() -> table
1107  *
1108  */
1109  std::tuple<std::string, double> getFirmwareUpdateProcess();
1110 
1111  /**
1112  * 获取关节最大位置(当前正在使用的限制值)
1113  *
1114  * @return 返回关节最大位置(当前正在使用的限制值)
1115  *
1116  * @throws arcs::common_interface::AuboException
1117  *
1118  * @par Python函数原型
1119  * getLimitJointMaxPositions(self: pyaubo_sdk.RobotConfig) -> List[float]
1120  *
1121  * @par Lua函数原型
1122  * getLimitJointMaxPositions() -> table
1123  *
1124  */
1125  std::vector<double> getLimitJointMaxPositions();
1126 
1127  /**
1128  * 获取关节最小位置(当前正在使用的限制值)
1129  *
1130  * @return 返回关节最小位置(当前正在使用的限制值)
1131  *
1132  * @throws arcs::common_interface::AuboException
1133  *
1134  * @par Python函数原型
1135  * getLimitJointMinPositions(self: pyaubo_sdk.RobotConfig) -> List[float]
1136  *
1137  * @par Lua函数原型
1138  * getLimitJointMinPositions() -> table
1139  *
1140  */
1141  std::vector<double> getLimitJointMinPositions();
1142 
1143  /**
1144  * 获取关节最大速度(当前正在使用的限制值)
1145  *
1146  * @return 返回关节最大速度(当前正在使用的限制值)
1147  *
1148  * @throws arcs::common_interface::AuboException
1149  *
1150  * @par Python函数原型
1151  * getLimitJointMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float]
1152  *
1153  * @par Lua函数原型
1154  * getLimitJointMaxSpeeds() -> table
1155  *
1156  */
1157  std::vector<double> getLimitJointMaxSpeeds();
1158 
1159  /**
1160  * 获取关节最大加速度(当前正在使用的限制值)
1161  *
1162  * @return 返回关节最大加速度(当前正在使用的限制值)
1163  *
1164  * @throws arcs::common_interface::AuboException
1165  *
1166  * @par Python函数原型
1167  * getLimitJointMaxAccelerations(self: pyaubo_sdk.RobotConfig) ->
1168  * List[float]
1169  *
1170  * @par Lua函数原型
1171  * getLimitJointMaxAccelerations() -> table
1172  *
1173  */
1174  std::vector<double> getLimitJointMaxAccelerations();
1175 
1176  /**
1177  * 获取TCP最大速度(当前正在使用的限制值)
1178  *
1179  * @return 返回TCP最大速度(当前正在使用的限制值)
1180  *
1181  * @throws arcs::common_interface::AuboException
1182  *
1183  * @par Python函数原型
1184  * getLimitTcpMaxSpeed(self: pyaubo_sdk.RobotConfig) -> List[float]
1185  *
1186  * @par Lua函数原型
1187  * getLimitTcpMaxSpeed() -> table
1188  *
1189  */
1190  double getLimitTcpMaxSpeed();
1191 
1192  /**
1193  * 获取当前安全停止的类型
1194  *
1195  * @return 返回当前安全停止的类型
1196  *
1197  */
1198  SafeguedStopType getSafeguardStopType();
1199 
1200  /**
1201  * 按位获取完整的安全停止触发源
1202  *
1203  * @return 返回所有安全停止触发源
1204  *
1205  * 安全停止的原因:
1206  * 手动模式下可配置安全IO触发的安全停止 - 1<<0
1207  * 自动模式下可配置安全IO触发的安全停止 - 1<<1
1208  * 控制柜SI输入触发的安全停止 - 1<<2
1209  * 示教器三态开关触发的安全停止 - 1<<3
1210  * 自动切手动触发的安全停止 - 1<<4
1211  *
1212  */
1213  int getSafeguardStopSource();
1214 
1215 protected:
1216  void *d_;
1217 };
1218 using RobotConfigPtr = std::shared_ptr<RobotConfig>;
1219 
1220 // clang-format off
1221 #define RobotConfig_DECLARES \
1222  _FUNC(RobotConfig, 0, getDof) \
1223  _FUNC(RobotConfig, 0, getName) \
1224  _FUNC(RobotConfig, 0, getCycletime) \
1225  _FUNC(RobotConfig, 2, setSlowDownFraction, level, fraction) \
1226  _FUNC(RobotConfig, 1, getSlowDownFraction, level) \
1227  _FUNC(RobotConfig, 0, getRobotType) \
1228  _FUNC(RobotConfig, 0, getRobotSubType) \
1229  _FUNC(RobotConfig, 0, getControlBoxType) \
1230  _FUNC(RobotConfig, 0, getDefaultToolAcc) \
1231  _FUNC(RobotConfig, 0, getDefaultToolSpeed) \
1232  _FUNC(RobotConfig, 0, getDefaultJointAcc) \
1233  _FUNC(RobotConfig, 0, getDefaultJointSpeed) \
1234  _INST(RobotConfig, 1, setMountingPose, pose) \
1235  _FUNC(RobotConfig, 0, getMountingPose) \
1236  _INST(RobotConfig, 1, setCollisionLevel, level); \
1237  _FUNC(RobotConfig, 0, getCollisionLevel); \
1238  _INST(RobotConfig, 1, setCollisionStopType, type); \
1239  _FUNC(RobotConfig, 0, getCollisionStopType); \
1240  _FUNC(RobotConfig, 1, setHomePosition, positions); \
1241  _FUNC(RobotConfig, 0, getHomePosition); \
1242  _INST(RobotConfig, 1, setFreedriveDamp, damp); \
1243  _FUNC(RobotConfig, 0, getFreedriveDamp); \
1244  _FUNC(RobotConfig, 0, getTcpForceSensorNames) \
1245  _INST(RobotConfig, 1, selectTcpForceSensor, name) \
1246  _FUNC(RobotConfig, 0, hasTcpForceSensor) \
1247  _INST(RobotConfig, 1, setTcpForceOffset, force_offset) \
1248  _FUNC(RobotConfig, 0, getTcpForceOffset) \
1249  _FUNC(RobotConfig, 0, getBaseForceSensorNames) \
1250  _INST(RobotConfig, 1, selectBaseForceSensor, name) \
1251  _FUNC(RobotConfig, 0, hasBaseForceSensor) \
1252  _INST(RobotConfig, 1, setBaseForceOffset, force_offset) \
1253  _FUNC(RobotConfig, 0, getBaseForceOffset) \
1254  _INST(RobotConfig, 1, setPersistentParameters, param) \
1255  _INST(RobotConfig, 1, setKinematicsCompensate, param) \
1256  _INST(RobotConfig, 1, setHardwareCustomParameters, param) \
1257  _FUNC(RobotConfig, 1, getHardwareCustomParameters, param) \
1258  _INST(RobotConfig, 0, setRobotZero) \
1259  _FUNC(RobotConfig, 1, getKinematicsParam, real) \
1260  _FUNC(RobotConfig, 1, getKinematicsCompensate, ref_temperature) \
1261  _FUNC(RobotConfig, 0, getSafetyParametersCheckSum) \
1262  _FUNC(RobotConfig, 1, confirmSafetyParameters, parameters) \
1263  _FUNC(RobotConfig, 1, calcSafetyParametersCheckSum, parameters) \
1264  _FUNC(RobotConfig, 0, getJointMaxPositions) \
1265  _FUNC(RobotConfig, 0, getJointMinPositions) \
1266  _FUNC(RobotConfig, 0, getJointMaxSpeeds) \
1267  _FUNC(RobotConfig, 0, getJointMaxAccelerations) \
1268  _FUNC(RobotConfig, 0, getTcpMaxSpeeds) \
1269  _FUNC(RobotConfig, 0, getTcpMaxAccelerations) \
1270  _FUNC(RobotConfig, 1, toolSpaceInRange, pose) \
1271  _INST(RobotConfig, 4, setPayload, m, cog, aom, inertia) \
1272  _FUNC(RobotConfig, 0, getPayload) \
1273  _FUNC(RobotConfig, 0, getTcpOffset) \
1274  _FUNC(RobotConfig, 0, getGravity) \
1275  _INST(RobotConfig, 1, setGravity, gravity) \
1276  _INST(RobotConfig, 1, setTcpOffset, offset) \
1277  _INST(RobotConfig, 3, setToolInertial, m, com, inertial) \
1278  _FUNC(RobotConfig, 1, firmwareUpdate, fw) \
1279  _FUNC(RobotConfig, 0, getFirmwareUpdateProcess) \
1280  _FUNC(RobotConfig, 1, setTcpForceSensorPose, sensor_pose) \
1281  _FUNC(RobotConfig, 0, getTcpForceSensorPose) \
1282  _FUNC(RobotConfig, 0, getLimitJointMaxPositions) \
1283  _FUNC(RobotConfig, 0, getLimitJointMinPositions) \
1284  _FUNC(RobotConfig, 0, getLimitJointMaxSpeeds) \
1285  _FUNC(RobotConfig, 0, getLimitJointMaxAccelerations) \
1286  _FUNC(RobotConfig, 0, getLimitTcpMaxSpeed) \
1287  _FUNC(RobotConfig, 0, getSafeguardStopType) \
1288  _FUNC(RobotConfig, 0, getSafeguardStopSource)
1289 
1290 // clang-format on
1291 } // namespace common_interface
1292 } // namespace arcs
1293 #endif // AUBO_SDK_ROBOT_CONFIG_H
数据类型的定义
std::tuple< double, std::vector< double >, std::vector< double >, std::vector< double >> Payload
Definition: type_def.h:664
std::shared_ptr< RobotConfig > RobotConfigPtr
Definition: aubo_api.h:17