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