PDF
AUBO SDK  0.26.0
axis_interface.h
浏览该文件的文档.
1/** @file axes.h
2 * @brief 外部轴接口
3 */
4#ifndef AUBO_SDK_AXIS_INTERFACE_H
5#define AUBO_SDK_AXIS_INTERFACE_H
6
7#include <aubo/sync_move.h>
8#include <aubo/trace.h>
9
10namespace arcs {
11namespace common_interface {
12
13/**
14 * \chinese
15 * @defgroup AxisInterface AxisInterface (外部轴)
16 * 外部轴API接口
17 * \endchinese
18 *
19 * \english
20 * @defgroup AxisInterface External Axis
21 * External axis API interface
22 * \endenglish
23 */
24class ARCS_ABI_EXPORT AxisInterface
25{
26public:
28 virtual ~AxisInterface();
29
30 /**
31 * @ingroup AxisInterface
32 * \~chinese 通电
33 * \~english Power on
34 * @return
35 */
37
38 /**
39 * @ingroup AxisInterface
40 * \~chinese 断电
41 * \~english Power off
42 * @return
43 */
45
46 /**
47 * @ingroup AxisInterface
48 * \~chinese 使能
49 * \~english Enable
50 * @return
51 */
53
54 /**
55 * @ingroup AxisInterface
56 * \~chinese 设置外部轴的安装位姿(相对于世界坐标系)
57 * \~chinese @param pose
58 * \~english Set mounting pose of external axis (wrt world frame)
59 * \~english @param pose
60
61 * @return
62 */
63 int setExtAxisMountingPose(const std::vector<double> &pose);
64
65 /**
66 * @ingroup AxisInterface
67 * \chinese 运动到指定点, 旋转或者平移
68 *
69 * @param pos
70 * @param v
71 * @param a
72 * @param duration
73 * @return
74 * \endchinese
75 *
76 * \english move to pos, rotation or linear
77 *
78 * @param pos
79 * @param v
80 * @param a
81 * @param duration
82 * @return
83 * \endenglish
84 */
85 int moveExtJoint(double pos, double v, double a, double duration);
86
87 /**
88 * @ingroup AxisInterface
89 * \chinese
90 * 制定目标运动速度
91 *
92 * @param v
93 * @param a
94 * @param duration
95 * @return
96 * \endchinese
97 *
98 * \english
99 * Set target speed, acceleration and duration
100 * @param v
101 * @param a
102 * @param duration
103 * @return
104 * \endenglish
105 */
106 int speedExtJoint(double v, double a, double duration);
107
108 /**
109 * @ingroup AxisInterface
110 * \chinese
111 * 停止外部轴运动
112 *
113 * @param a
114 * @return
115 * \endchinese
116 *
117 * \english
118 * stop ext joint
119 * @param a
120 * @return
121 * \endenglish
122 */
123 int stopExtJoint(double a);
124
125 /**
126 * @ingroup AxisInterface
127 * \~chinese 获取外部轴的类型 0代表是旋转 1代表平移
128 * \~english Get external axis type: 0 for rotation, 1 for linear
129 * @return
130 */
132
133 /**
134 * @ingroup AxisInterface
135 * \~chinese 设置外部轴的类型
136 * @param type 0代表是旋转 1代表平移
137 *
138 * \~english Set external axis type
139 * @param type: 0 for rotation, 1 for linear
140 * @return
141 */
142 int setExtAxisType(int type);
143
144 /**
145 * @ingroup AxisInterface
146 * \chinese
147 * 获取当前外部轴的状态
148 *
149 * @return 当前外部轴的状态
150 * \endchinese
151 *
152 * \english
153 * Get external axis status
154 *
155 * @return Current exteral axis status
156 * \endenglish
157 */
159
160 /**
161 * @ingroup AxisInterface
162 * \chinese
163 * 获取外部轴安装位姿
164 *
165 * @return 外部轴安装位姿
166 * \endchinese
167 *
168 * \english
169 * Get external axis mounting pose
170 *
171 * @return External axis pose
172 * \endenglish
173 */
174 std::vector<double> getExtAxisMountingPose();
175
176 /**
177 * @ingroup AxisInterface
178 * \chinese
179 * 获取相对于安装坐标系的位姿,外部轴可能为变位机或者导轨
180 *
181 * @return 相对于安装坐标系的位姿
182 * \endchinese
183 *
184 * \english
185 * Get pose wrt mounting coordinate system, axis can be positioner or linear
186 * rail
187 *
188 * @return Pose wrt mounting coordinate system
189 * \endenglish
190 */
191 std::vector<double> getExtAxisPose();
192
193 /**
194 * @ingroup AxisInterface
195 * \chinese
196 * 获取外部轴位置
197 *
198 * @return 外部轴位置
199 * \endchinese
200 *
201 * \english
202 * Get external axis position
203 *
204 * @return External axis position
205 * \endenglish
206 */
208
209 /**
210 * @ingroup AxisInterface
211 * \chinese
212 * 获取外部轴运行速度
213 *
214 * @return 外部轴运行速度
215 * \endchinese
216 *
217 * \english
218 * Get external axis speed
219 *
220 * @return External axis speed
221 * \endenglish
222 */
224
225 /**
226 * @ingroup AxisInterface
227 * \chinese
228 * 设置外部轴运行速度
229 *
230 * @return
231 * \endchinese
232 *
233 * \english
234 * Set external axis speed
235 *
236 * @return
237 * \endenglish
238 */
239 int setExtAxisVelocity(double velocity);
240
241 /**
242 * @ingroup AxisInterface
243 * \chinese
244 * 获取外部轴运行加速度
245 *
246 * @return 外部轴运行加速度
247 * \endchinese
248 *
249 * \english
250 * Get external axis acceleration
251 *
252 * @return External axis acceleration
253 * \endenglish
254 */
256
257 /**
258 * @ingroup AxisInterface
259 * \chinese
260 * 设置外部轴运行加速度
261 *
262 * @param acc
263 * @return
264 * \endchinese
265 *
266 * \english
267 * Set external axis acceleration
268 *
269 * @param acc
270 * @return
271 * \endenglish
272 */
273 int setExtAxisAcceleration(double acc);
274
275 /**
276 * @ingroup AxisInterface
277 * \chinese
278 * 获取外部轴电流
279 *
280 * @return 外部轴电流
281 * \endchinese
282 *
283 * \english
284 * Get external axis current
285 *
286 * @return External axis current
287 * \endenglish
288 */
290
291 /**
292 * @ingroup AxisInterface
293 * \chinese
294 * 获取外部轴温度
295 *
296 * @return 外部轴温度
297 * \endchinese
298 *
299 * \english
300 * Get external axis temperature
301 *
302 * @return External axis temperature
303 * \endenglish
304 */
306
307 /**
308 * @ingroup AxisInterface
309 * \chinese
310 * 获取外部轴电压
311 *
312 * @return 外部轴电压
313 * \endchinese
314 *
315 * \english
316 * Get external axis voltage
317 *
318 * @return External axis voltage
319 * \endenglish
320 */
322
323 /**
324 * @ingroup AxisInterface
325 * \chinese
326 * 获取外部轴电流
327 *
328 * @return 外部轴电流
329 * \endchinese
330 *
331 * \english
332 * Get external axis current
333 *
334 * @return external axis current
335 * \endenglish
336 */
338
339 /**
340 * @ingroup AxisInterface
341 * \chinese
342 * 获取外部轴最大位置(物理极限)
343 *
344 * @return 外部轴最大位置
345 * \endchinese
346 *
347 * \english
348 * Get external axis max position
349 *
350 * @return External axis max position
351 * \endenglish
352 */
354
355 /**
356 * @ingroup AxisInterface
357 * \chinese
358 * 设置外部轴最大位置(软件/算法限制)
359 *
360 * @param q
361 * @return
362 * \endchinese
363 *
364 * \english
365 * Set external axis max position
366 *
367 * @param q
368 * @return
369 * \endenglish
370 */
372
373 /**
374 * @ingroup AxisInterface
375 * \chinese
376 * 获取外部轴最大位置(软件/算法限制)
377 *
378 * @return 外部轴最大位置
379 * \endchinese
380 *
381 * \english
382 * Get external axis max position
383 *
384 * @return External axis max position
385 * \endenglish
386 */
388
389 /**
390 * @ingroup AxisInterface
391 * \chinese
392 * 获取外部轴最小位置(物理极限)
393 *
394 * @return 外部轴最小位置
395 * \endchinese
396 *
397 * \english
398 * Get external axis min position
399 *
400 * @return External axis min position
401 * \endenglish
402 */
404
405 /**
406 * @ingroup AxisInterface
407 * \chinese
408 * 设置外部轴最小位置(软件/算法限制)
409 *
410 * @param q
411 * @return
412 * \endchinese
413 *
414 * \english
415 * Set external axis min position
416 *
417 * @param q
418 * @return
419 * \endenglish
420 */
422
423 /**
424 * @ingroup AxisInterface
425 * \chinese
426 * 获取外部轴最小位置(软件/算法限制)
427 *
428 * @return 外部轴最小位置
429 * \endchinese
430 *
431 * \english
432 * Get external axis min position
433 *
434 * @return External axis min position
435 * \endenglish
436 */
438
439 /**
440 * @ingroup AxisInterface
441 * \chinese
442 * 获取外部轴最大速度(物理极限)
443 *
444 * @return 外部轴最大速度
445 * \endchinese
446 *
447 * \english
448 * Get external axis max speed
449 *
450 * @return External axis max speed
451 * \endenglish
452 */
454
455 /**
456 * @ingroup AxisInterface
457 * \chinese
458 * 设置外部轴最大速度(软件/算法限制)
459 *
460 * @param v
461 * @return
462 * \endchinese
463 *
464 * \english
465 * Set external axis max speed
466 *
467 * @param v
468 * @return
469 * \endenglish
470 */
472
473 /**
474 * @ingroup AxisInterface
475 * \chinese
476 * 获取外部轴最大速度(软件/算法限制)
477 *
478 * @return 外部轴最大速度
479 * \endchinese
480 *
481 * \english
482 * Get external axis max speed
483 *
484 * @return External axis max speed
485 * \endenglish
486 */
488
489 /**
490 * @ingroup AxisInterface
491 * \chinese
492 * 获取外部轴最大加速度(物理极限)
493 *
494 * @return 外部轴最大加速度
495 * \endchinese
496 *
497 * \english
498 * Get external axis max acceleration
499 *
500 * @return External axis max acceleration
501 * \endenglish
502 */
504
505 /**
506 * @ingroup AxisInterface
507 * \chinese
508 * 设置外部轴最大加速度(软件/算法限制)
509 *
510 * @param acc
511 * @return
512 * \endchinese
513 *
514 * \english
515 * Set external axis max acceleration
516 *
517 * @param acc
518 * @return
519 * \endenglish
520 */
522
523 /**
524 * @ingroup AxisInterface
525 * \chinese
526 * 获取外部轴最大加速度(软件/算法限制)
527 *
528 * @return 外部轴最大加速度
529 * \endchinese
530 *
531 * \english
532 * Get external axis max acceleration
533 *
534 * @return External axis max acceleration
535 * \endenglish
536 */
538
539 /**
540 * @ingroup AxisInterface
541 * \chinese
542 * 跟踪另一个外部轴的运动(禁止运动过程中使用)
543 *
544 * @param target_name 目标的外部轴名字
545 * @param phase 相位差
546 * @param err 跟踪运行的最大误差
547 * @return
548 * \endchinese
549 *
550 * \english
551 * Follow motion of another external axis (not to be used during motion)
552 *
553 * @param target_name name of target axis
554 * @param phase phase difference
555 * @param err max error when following motion
556 * @return
557 * \endenglish
558 */
559 int followAnotherAxis(const std::string &target_name, double phase,
560 double err);
561
562 /**
563 * @ingroup AxisInterface
564 * \~chinese @brief stopFollowAnotherAxis(禁止运动过程中使用)
565 * \~english @brief stopFollowAnotherAxis(not to be used during motion)
566 * @return
567 */
569
570 /**
571 * @ingroup AxisInterface
572 * \~chinese @brief getErrorCode(获取外部轴错误码)
573 * \~english @brief getErrorCode(Get raw external axis error code)
574 * @return
575 */
577
578 /**
579 * @ingroup AxisInterface
580 * \chinese
581 * 重置外部轴错误
582 *
583 * @return
584 * \endchinese
585 *
586 * \english
587 * Reset axis error
588 *
589 * @return
590 * \endenglish
591 */
593
594 /**
595 * @ingroup AxisInterface
596 * \chinese
597 * 将当前外部轴位置设置为零位
598 *
599 * @return
600 * \endchinese
601 *
602 * \english
603 * Set current external axis position as zero.
604 *
605 * @return
606 * \endenglish
607 */
609
610 /**
611 * @ingroup AxisInterface
612 * \chinese
613 * 设置外部轴减速比
614 *
615 * @return
616 * \endchinese
617 *
618 * \english
619 * Set axis reduction ratio
620 *
621 * @return
622 * \endenglish
623 */
624 int setReductionRatio(double ratio);
625
626 /**
627 * @ingroup AxisInterface
628 * \chinese
629 * 获取外部轴减速比
630 *
631 * @return
632 * \endchinese
633 *
634 * \english
635 * Get axis reduction ratio
636 *
637 * @return
638 * \endenglish
639 */
641
642protected:
643 void *d_;
644};
645using AxisInterfacePtr = std::shared_ptr<AxisInterface>;
646
647} // namespace common_interface
648} // namespace arcs
649
650#endif // AUBO_SDK_AXIS_INTERFACE_H
double getExtAxisMaxPositionLimit()
获取外部轴最大位置(软件/算法限制)
int setReductionRatio(double ratio)
设置外部轴减速比
double getExtAxisCurrent()
获取外部轴电流
int setExtAxisMaxPositionLimit(double q)
设置外部轴最大位置(软件/算法限制)
int speedExtJoint(double v, double a, double duration)
制定目标运动速度
double getExtAxisMaxVelocityLimit()
获取外部轴最大速度(软件/算法限制)
int followAnotherAxis(const std::string &target_name, double phase, double err)
跟踪另一个外部轴的运动(禁止运动过程中使用)
double getExtAxisVelocity()
获取外部轴运行速度
int setExtAxisMountingPose(const std::vector< double > &pose)
设置外部轴的安装位姿(相对于世界坐标系)
double getExtAxisMaxPosition()
获取外部轴最大位置(物理极限)
double getExtAxisBusVoltage()
获取外部轴电压
int setExtAxisVelocity(double velocity)
设置外部轴运行速度
std::vector< double > getExtAxisPose()
获取相对于安装坐标系的位姿,外部轴可能为变位机或者导轨
int moveExtJoint(double pos, double v, double a, double duration)
运动到指定点, 旋转或者平移
double getExtAxisPosition()
获取外部轴位置
double getExtAxisMaxVelocity()
获取外部轴最大速度(物理极限)
double getExtAxisMaxAccelerationLimit()
获取外部轴最大加速度(软件/算法限制)
double getExtAxisAcceleration()
获取外部轴运行加速度
int setExtAxisMaxAccelerationLimit(double acc)
设置外部轴最大加速度(软件/算法限制)
double getExtAxisBusCurrent()
获取外部轴电流
std::vector< double > getExtAxisMountingPose()
获取外部轴安装位姿
double getExtMinPositionLimit()
获取外部轴最小位置(软件/算法限制)
int stopFollowAnotherAxis()
stopFollowAnotherAxis(禁止运动过程中使用)
int setExtMinPositionLimit(double q)
设置外部轴最小位置(软件/算法限制)
int getErrorCode()
getErrorCode(获取外部轴错误码)
double getExtMinPosition()
获取外部轴最小位置(物理极限)
int setExtAxisAcceleration(double acc)
设置外部轴运行加速度
int getExtAxisType()
获取外部轴的类型 0代表是旋转 1代表平移
AxisModeType getAxisModeType()
获取当前外部轴的状态
double getExtAxisTemperature()
获取外部轴温度
double getExtAxisMaxAcceleration()
获取外部轴最大加速度(物理极限)
int stopExtJoint(double a)
停止外部轴运动
double getReductionRatio()
获取外部轴减速比
int setExtAxisZero()
将当前外部轴位置设置为零位
int setExtAxisMaxVelocityLimit(double v)
设置外部轴最大速度(软件/算法限制)
int setExtAxisType(int type)
设置外部轴的类型
int clearAxisError()
重置外部轴错误
std::shared_ptr< AxisInterface > AxisInterfacePtr
同步运行
向控制器日志系统注入日志方面的接口