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 * 获取当前外部轴的状态
131 *
132 * @return 当前外部轴的状态
133 * \endchinese
134 *
135 * \english
136 * Get external axis status
137 *
138 * @return Current exteral axis status
139 * \endenglish
140 */
142
143 /**
144 * @ingroup AxisInterface
145 * \chinese
146 * 获取外部轴安装位姿
147 *
148 * @return 外部轴安装位姿
149 * \endchinese
150 *
151 * \english
152 * Get external axis mounting pose
153 *
154 * @return External axis pose
155 * \endenglish
156 */
157 std::vector<double> getExtAxisMountingPose();
158
159 /**
160 * @ingroup AxisInterface
161 * \chinese
162 * 获取相对于安装坐标系的位姿,外部轴可能为变位机或者导轨
163 *
164 * @return 相对于安装坐标系的位姿
165 * \endchinese
166 *
167 * \english
168 * Get pose wrt mounting coordinate system, axis can be positioner or linear rail
169 *
170 * @return Pose wrt mounting coordinate system
171 * \endenglish
172 */
173 std::vector<double> getExtAxisPose();
174
175 /**
176 * @ingroup AxisInterface
177 * \chinese
178 * 获取外部轴位置
179 *
180 * @return 外部轴位置
181 * \endchinese
182 *
183 * \english
184 * Get external axis position
185 *
186 * @return External axis position
187 * \endenglish
188 */
190
191 /**
192 * @ingroup AxisInterface
193 * \chinese
194 * 获取外部轴运行速度
195 *
196 * @return 外部轴运行速度
197 * \endchinese
198 *
199 * \english
200 * Get external axis speed
201 *
202 * @return External axis speed
203 * \endenglish
204 */
206
207 /**
208 * @ingroup AxisInterface
209 * \chinese
210 * 获取外部轴运行加速度
211 *
212 * @return 外部轴运行加速度
213 * \endchinese
214 *
215 * \english
216 * Get external axis acceleration
217 *
218 * @return External axis acceleration
219 * \endenglish
220 */
222
223 /**
224 * @ingroup AxisInterface
225 * \chinese
226 * 获取外部轴电流
227 *
228 * @return 外部轴电流
229 * \endchinese
230 *
231 * \english
232 * Get external axis current
233 *
234 * @return External axis current
235 * \endenglish
236 */
238
239 /**
240 * @ingroup AxisInterface
241 * \chinese
242 * 获取外部轴温度
243 *
244 * @return 外部轴温度
245 * \endchinese
246 *
247 * \english
248 * Get external axis temperature
249 *
250 * @return External axis temperature
251 * \endenglish
252 */
254
255 /**
256 * @ingroup AxisInterface
257 * \chinese
258 * 获取外部轴电压
259 *
260 * @return 外部轴电压
261 * \endchinese
262 *
263 * \english
264 * Get external axis voltage
265 *
266 * @return External axis voltage
267 * \endenglish
268 */
270
271 /**
272 * @ingroup AxisInterface
273 * \chinese
274 * 获取外部轴电流
275 *
276 * @return 外部轴电流
277 * \endchinese
278 *
279 * \english
280 * Get external axis current
281 *
282 * @return external axis current
283 * \endenglish
284 */
286
287 /**
288 * @ingroup AxisInterface
289 * \chinese
290 * 获取外部轴最大位置
291 *
292 * @return 外部轴最大位置
293 * \endchinese
294 *
295 * \english
296 * Get external axis max position
297 *
298 * @return External axis max position
299 * \endenglish
300 */
302
303 /**
304 * @ingroup AxisInterface
305 * \chinese
306 * 获取外部轴最小位置
307 *
308 * @return 外部轴最小位置
309 * \endchinese
310 *
311 * \english
312 * Get external axis min position
313 *
314 * @return External axis min position
315 * \endenglish
316 */
318
319 /**
320 * @ingroup AxisInterface
321 * \chinese
322 * 获取外部轴最大速度
323 *
324 * @return 外部轴最大速度
325 * \endchinese
326 *
327 * \english
328 * Get external axis max speed
329 *
330 * @return External axis max speed
331 * \endenglish
332 */
334
335 /**
336 * @ingroup AxisInterface
337 * \chinese
338 * 获取外部轴最大加速度
339 *
340 * @return 外部轴最大加速度
341 * \endchinese
342 *
343 * \english
344 * Get external axis max acceleration
345 *
346 * @return External axis max acceleration
347 * \endenglish
348 */
350
351 /**
352 * @ingroup AxisInterface
353 * \chinese
354 * 跟踪另一个外部轴的运动(禁止运动过程中使用)
355 *
356 * @param target_name 目标的外部轴名字
357 * @param phase 相位差
358 * @param err 跟踪运行的最大误差
359 * @return
360 * \endchinese
361 *
362 * \english
363 * Follow motion of another external axis (not to be used during motion)
364 *
365 * @param target_name name of target axis
366 * @param phase phase difference
367 * @param err max error when following motion
368 * @return
369 * \endenglish
370 */
371 int followAnotherAxis(const std::string &target_name, double phase,
372 double err);
373
374 /**
375 * @ingroup AxisInterface
376 * \~chinese @brief stopFollowAnotherAxis(禁止运动过程中使用)
377 * \~english @brief stopFollowAnotherAxis(not to be used during motion)
378 * @return
379 */
381
382 /**
383 * @ingroup AxisInterface
384 * \chinese
385 * 获取外部轴错误码
386 *
387 * @return 外部轴错误码
388 * \endchinese
389 *
390 * \english
391 * Get external axis error code
392 *
393 * @return External axis error code
394 * \endenglish
395 */
397
398 /**
399 * @ingroup AxisInterface
400 * \chinese
401 * 重置外部轴错误
402 *
403 * @return
404 * \endchinese
405 *
406 * \english
407 * Reset axis error
408 *
409 * @return
410 * \endenglish
411 */
413
414protected:
415 void *d_;
416};
417using AxisInterfacePtr = std::shared_ptr<AxisInterface>;
418
419} // namespace common_interface
420} // namespace arcs
421
422#endif // AUBO_SDK_AXIS_INTERFACE_H
double getExtAxisCurrent()
Get external axis current
int speedExtJoint(double v, double a, double duration)
Set target speed, acceleration and duration
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
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 getExtAxisAcceleration()
Get external axis acceleration
double getExtAxisBusCurrent()
Get external axis current
std::vector< double > getExtAxisMountingPose()
Get external axis mounting pose
int stopFollowAnotherAxis()
stopFollowAnotherAxis(not to be used during motion)
int getErrorCode()
Get external axis error code
double getExtMinPosition()
Get external axis min position
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
int clearAxisError()
Reset axis error
std::shared_ptr< AxisInterface > AxisInterfacePtr
同步运行
Interface for injecting logs into the controller's logging system.