PDF
AUBO SDK  0.26.0
sync_move.h
浏览该文件的文档.
1/** @file sync_move.h
2 * @brief 同步运行
3 *
4 * 1. Independent movements
5 * If the different task programs, and their robots, work independently, no
6 * synchronization or coordination is needed. Each task program is then
7 * written as if it was the program for a single robot system.
8 *
9 * 2. Semi coordinated movements
10 * Several robots can work with the same work object, without synchronized
11 * movements, as long as the work object is not moving.
12 * A positioner can move the work object when the robots are not coordinated
13 * to it, and the robots can be coordinated to the work object when it is not
14 * moving. Switching between moving the object and coordinating the robots is
15 * called semi coordinated movements.
16 *
17 * 3. Coordinated synchronized movements
18 * Several robots can work with the same moving work object.
19 * The positioner or robot that holds the work object and the robots that work
20 * with the work object must have synchronized movements. This means that the
21 * RAPID task programs, that handle one mechanical unit each, execute their
22 * move instructions simultaneously.
23 */
24#ifndef AUBO_SDK_SYNC_MOVE_INTERFACE_H
25#define AUBO_SDK_SYNC_MOVE_INTERFACE_H
26
27#include <vector>
28#include <unordered_set>
29#include <string>
30#include <memory>
31#include <aubo/global_config.h>
32
33namespace arcs {
34namespace common_interface {
35
36typedef std::unordered_set<std::string> TaskSet;
37
38/**
39 * \chinese
40 * @defgroup SyncMove SyncMove (同步运动控制和轴组管理)
41 * 同步运动控制和轴组管理API接口
42 * \endchinese
43 *
44 * \english
45 * @defgroup SyncMove Synchronized Movement Control and Axis Group Management
46 * Synchronized movement control and axis group management API interface
47 * \endenglish
48 */
49class ARCS_ABI_EXPORT SyncMove
50{
51public:
53 virtual ~SyncMove();
54
55 /**
56 * @ingroup SyncMove
57 * \chinese
58 * syncMoveOn 用于启动同步运动模式。
59 *
60 * syncMoveOn 指令会等待其他任务程序。当所有任务程序都到达 syncMoveOn 时,
61 * 它们将继续以同步运动模式执行。不同任务程序中的移动指令将同时执行,
62 * 直到执行 syncMoveOff 指令为止。在 syncMoveOn 指令之前必须编程一个停止点。
63 *
64 * @param syncident
65 * @param taskset
66 * @return
67 *
68 * @par Python函数原型
69 * syncMoveOn(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int
70 *
71 * @par Lua函数原型
72 * syncMoveOn(syncident: string, taskset: table) -> nil
73 * @endcoe
74 * \endchinese
75 * \english
76 * syncMoveOn is used to start synchronized movement mode.
77 *
78 * A syncMoveOn instruction will wait for the other task programs. When
79 * all task programs have reached the syncMoveOn, they will continue
80 * their execution in synchronized movement mode. The move instructions
81 * in the different task programs are executed simultaneously, until the
82 * instruction syncMoveOff is executed.
83 * A stop point must be programmed before the syncMoveOn instruction.
84 *
85 * @param syncident
86 * @param taskset
87 * @return
88 *
89 * @par Python function prototype
90 * syncMoveOn(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int
91 *
92 * @par Lua function prototype
93 * syncMoveOn(syncident: string, taskset: table) -> nil
94 * @endcoe
95 * \endenglish
96 */
97 int syncMoveOn(const std::string &syncident, const TaskSet &taskset);
98
99 /**
100 * @ingroup SyncMove
101 * \chinese
102 * 设置同步路径段的ID
103 * 在同步运动模式下,所有同时执行的移动指令必须全部编程为圆角区(corner zones)或全部为停止点(stop points)。
104 * 这意味着具有相同ID的移动指令要么全部带有圆角区,要么全部带有停止点。
105 * 如果在各自的任务程序中同步执行的移动指令中,一个带有圆角区而另一个带有停止点,则会发生错误。
106 * 同步执行的移动指令可以有不同大小的圆角区(例如,一个使用z10,另一个使用z50)。
107 *
108 * @param id
109 * @return
110 *
111 * @par Python函数原型
112 * syncMoveSegment(self: pyaubo_sdk.SyncMove, arg0: int) -> bool
113 *
114 * @par Lua函数原型
115 * syncMoveSegment(id: number) -> boolean
116 * @endcoe
117 * \endchinese
118 * \english
119 * Set the ID for the synchronized path segment.
120 * In synchronized movements mode, all or none of the simultaneous move instructions must be programmed with corner zones.
121 * This means that move instructions with the same ID must either all have corner zones, or all have stop points.
122 * If a move instruction with a corner zone and a move instruction with a stop point are synchronously executed in their respective task program, an error will occur.
123 * Synchronously executed move instructions can have corner zones of different sizes (e.g. one uses z10 and one uses z50).
124 *
125 * @param id
126 * @return
127 *
128 * @par Python prototype
129 * syncMoveSegment(self: pyaubo_sdk.SyncMove, arg0: int) -> bool
130 *
131 * @par Lua prototype
132 * syncMoveSegment(id: number) -> boolean
133 * @endcoe
134 * \endenglish
135 */
136 bool syncMoveSegment(int id);
137
138 /**
139 * @ingroup SyncMove
140 * \chinese
141 * syncMoveOff 用于结束同步运动模式。
142 *
143 * syncMoveOff 指令会等待其他任务程序。当所有任务程序都到达 syncMoveOff 时,
144 * 它们将继续以非同步模式执行。在 syncMoveOff 指令之前必须编程一个停止点。
145 *
146 * @param syncident
147 * @return
148 *
149 * @par Python函数原型
150 * syncMoveOff(self: pyaubo_sdk.SyncMove, arg0: str) -> int
151 *
152 * @par Lua函数原型
153 * syncMoveOff(syncident: string) -> nil
154 * @endcoe
155 * \endchinese
156 * \english
157 * syncMoveOff is used to end synchronized movement mode.
158 *
159 * A syncMoveOff instruction will wait for the other task programs. When
160 * all task programs have reached the syncMoveOff, they will continue
161 * their execution in unsynchronized mode.
162 * A stop point must be programmed before the syncMoveOff instruction.
163 *
164 * @param syncident
165 * @return
166 *
167 * @par Python prototype
168 * syncMoveOff(self: pyaubo_sdk.SyncMove, arg0: str) -> int
169 *
170 * @par Lua prototype
171 * syncMoveOff(syncident: string) -> nil
172 * @endcoe
173 * \endenglish
174 */
175 int syncMoveOff(const std::string &syncident);
176
177 /**
178 * @ingroup SyncMove
179 * \chinese
180 * syncMoveUndo 用于关闭同步运动,即使不是所有其他任务程序都执行了 syncMoveUndo 指令。
181 *
182 * syncMoveUndo 主要用于 UNDO 处理程序。当程序指针从过程移动时,syncMoveUndo 用于关闭同步。
183 *
184 * @return
185 *
186 * @par Python函数原型
187 * syncMoveUndo(self: pyaubo_sdk.SyncMove) -> int
188 *
189 * @par Lua函数原型
190 * syncMoveUndo() -> nil
191 * @endcoe
192 * \endchinese
193 * \english
194 * syncMoveUndo is used to turn off synchronized movements, even if not
195 * all the other task programs execute the syncMoveUndo instruction.
196 *
197 * syncMoveUndo is intended for UNDO handlers. When the program
198 * pointer is moved from the procedure, syncMoveUndo is used to turn off
199 * the synchronization.
200 *
201 * @return
202 *
203 * @par Python prototype
204 * syncMoveUndo(self: pyaubo_sdk.SyncMove) -> int
205 *
206 * @par Lua prototype
207 * syncMoveUndo() -> nil
208 * @endcoe
209 * \endenglish
210 */
212
213 /**
214 * @ingroup SyncMove
215 * \chinese
216 * waitSyncTasks 用于在程序中的特定点同步多个任务程序。
217 *
218 * waitSyncTasks 指令会等待其他任务程序。当所有任务程序都到达 waitSyncTasks 指令时,
219 * 它们将继续执行。
220 *
221 * @param syncident
222 * @param taskset
223 * @return
224 *
225 * @par Python函数原型
226 * waitSyncTasks(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int
227 *
228 * @par Lua函数原型
229 * waitSyncTasks(syncident: string, taskset: table) -> nil
230 * @endcoe
231 * \endchinese
232 * \english
233 * waitSyncTasks is used to synchronize several task programs at a specific
234 * point in the program.
235 *
236 * A waitSyncTasks instruction will wait for the other task programs. When all
237 * task programs have reached the waitSyncTasks instruction, they will continue
238 * their execution.
239 *
240 * @param syncident
241 * @param taskset
242 * @return
243 *
244 * @par Python prototype
245 * waitSyncTasks(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int
246 *
247 * @par Lua prototype
248 * waitSyncTasks(syncident: string, taskset: table) -> nil
249 * @endcoe
250 * \endenglish
251 */
252 int waitSyncTasks(const std::string &syncident, const TaskSet &taskset);
253
254 /**
255 * @ingroup SyncMove
256 * \chinese
257 * isSyncMoveOn 用于判断机械单元组是否处于同步运动模式。
258 *
259 * 不控制任何机械单元的任务可以通过该函数判断参数“使用机械单元组”中定义的机械单元是否处于同步运动模式。
260 *
261 * @return
262 *
263 * @par Python函数原型
264 * isSyncMoveOn(self: pyaubo_sdk.SyncMove) -> bool
265 *
266 * @par Lua函数原型
267 * isSyncMoveOn() -> boolean
268 * \endchinese
269 * \english
270 * isSyncMoveOn is used to tell if the mechanical unit group is in synchronized movement mode.
271 *
272 * A task that does not control any mechanical unit can find out if the mechanical units defined in the parameter Use Mechanical Unit Group are in synchronized movement mode.
273 *
274 * @return
275 *
276 * @par Python prototype
277 * isSyncMoveOn(self: pyaubo_sdk.SyncMove) -> bool
278 *
279 * @par Lua prototype
280 * isSyncMoveOn() -> boolean
281 * \endenglish
282 */
284
285 /**
286 * @ingroup SyncMove
287 * \chinese
288 * 暂停同步运动模式。
289 *
290 * @return
291 *
292 * @par Python函数原型
293 * syncMoveSuspend(self: pyaubo_sdk.SyncMove) -> int
294 *
295 * @par Lua函数原型
296 * syncMoveSuspend() -> nil
297 * \endchinese
298 * \english
299 * Suspend synchronized movement mode.
300 *
301 * @return
302 *
303 * @par Python prototype
304 * syncMoveSuspend(self: pyaubo_sdk.SyncMove) -> int
305 *
306 * @par Lua prototype
307 * syncMoveSuspend() -> nil
308 * \endenglish
309 */
311
312 /**
313 * @ingroup SyncMove
314 * \chinese
315 * 恢复同步运动模式。
316 *
317 * @return
318 *
319 * @par Python函数原型
320 * syncMoveResume(self: pyaubo_sdk.SyncMove) -> int
321 *
322 * @par Lua函数原型
323 * syncMoveResume() -> nil
324 * \endchinese
325 * \english
326 * Resume synchronized movement mode.
327 *
328 * @return
329 *
330 * @par Python prototype
331 * syncMoveResume(self: pyaubo_sdk.SyncMove) -> int
332 *
333 * @par Lua prototype
334 * syncMoveResume() -> nil
335 * \endenglish
336 */
338
339 /**
340 * @ingroup SyncMove
341 * \chinese
342 * 添加一个名为 name 的坐标系,其初始位姿为 pose,位姿以 ref_frame 坐标系表达。
343 * 此命令仅向世界模型添加一个坐标系,并不会将其附加到 ref_frame 坐标系。
344 * 如需将新添加的坐标系附加到 ref_frame,请使用 frameAttach()。
345 *
346 * @param name: 要添加的坐标系名称。名称不能与任何已存在的世界模型对象(坐标系、轴或轴组)重复,否则会抛出异常。
347 * @param pose: 新对象的初始位姿。
348 * @param ref_frame: 位姿所表达的参考坐标系对象名称。若未指定,默认使用机器人“base”坐标系。
349 *
350 * @return
351 * \endchinese
352 * \english
353 * Add a frame with the name "name" initialized at the specified pose
354 * expressed in the ref_frame coordinate frame. This command only adds a
355 * frame to the world, it does not attach it to the ref_frame coordinate
356 * frame. Use frameAttach() to attach the newly added frame to ref_frame if
357 * desired.
358 *
359 * @param name: name of the frame to be added. The name must not be the same
360 * as any existing world model object (frame, axis, or axis group),
361 * otherwise an exception is thrown
362 * @param pose: initial pose of the new object
363 * @param ref_frame: name of the world model object whose coordinate frame
364 * the pose is expressed in. If nothing is provided here, the default is the
365 * robot “base” frame.
366 *
367 * @return
368 * \endenglish
369 */
370 int frameAdd(const std::string &name, const std::vector<double> &pose,
371 const std::string &ref_name);
372
373 /**
374 * @ingroup SyncMove
375 * \chinese
376 * 将子坐标系附加到父世界模型对象。附加时会设置父子之间的相对变换,使得子坐标系在世界中不会移动。
377 *
378 * 子坐标系不能为“world”、“flange”、“tcp”,也不能与父坐标系同名。
379 *
380 * 如果子或父不是已存在的坐标系,或导致形成闭环,则操作会失败。
381 *
382 * 如果用于 MotionPlus,parent 参数可以是外部轴或轴组的名称。
383 *
384 * @param child: 要附加的子坐标系名称,不能为“world”、“flange”或“tcp”。
385 * @param parent: 子坐标系将要附加到的父对象名称。
386 *
387 * @return
388 * \endchinese
389 * \english
390 * Attaches the child frame to the parent world model object. The relative
391 * transform between the parent and child will be set such that the child
392 * does not move in the world when the attachment occurs.
393 *
394 * The child cannot be “world”, “flange”, “tcp”, or the same as parent.
395 *
396 * This will fail if child or parent is not an existing frame, or this makes
397 * the attachments form a closed chain.
398 *
399 * If being used with the MotionPlus, the parent argument can be the name of
400 * an external axis or axis group.
401 *
402 * @param child: name of the frame to be attached. The name must not be
403 * “world”, “flange”, or “tcp”.
404 * @param parent: name of the object that the child frame will be attached
405 * to.
406 *
407 * @return
408 * \endenglish
409 */
410 int frameAttach(const std::string &child, const std::string &parent);
411
412 /**
413 * @ingroup SyncMove
414 * \chinese
415 * 删除所有已添加到世界模型的坐标系。
416 *
417 * “world”、“base”、“flange”和“tcp”坐标系不能被删除。
418 *
419 * 任何附加到被删除坐标系的坐标系将会被附加到“world”坐标系,并设置新的偏移,使得被分离的坐标系在世界中不会移动。
420 *
421 * @return
422 * \endchinese
423 * \english
424 * Delete all frames that have been added to the world model.
425 *
426 * The “world”, “base”, “flange”, and “tcp” frames cannot be deleted.
427 *
428 * Any frames that are attached to the deleted frames will be attached to
429 * the “world” frame with new frame offsets set such that the detached
430 * frames do not move in the world.
431 *
432 * @return
433 * \endenglish
434 */
436
437 /**
438 * @ingroup SyncMove
439 * \chinese
440 * 删除指定名称的坐标系。
441 *
442 * “world”、“base”、“flange”和“tcp”坐标系不能被删除。
443 *
444 * 任何附加到被删除坐标系的坐标系将会被附加到“world”坐标系,并设置新的偏移,使得被分离的坐标系在世界中不会移动。
445 *
446 * 如果指定的坐标系不存在,则操作会失败。
447 *
448 * @param name: 要删除的坐标系名称
449 *
450 * @return
451 * \endchinese
452 * \english
453 * Delete the frame with name from the world model.
454 *
455 * The “world”, “base”, “flange”, and “tcp” frames cannot be deleted.
456 *
457 * Any frames that are attached to the deleted frame will be attached to the
458 * “world” frame with new frame offsets set such that the detached frame
459 * does not move in the world.
460 *
461 * This command will fail if the frame does not exist.
462 *
463 * @param name: name of the frame to be deleted
464 *
465 * @return
466 * \endenglish
467 */
468 int frameDelete(const std::string &name);
469
470 /**
471 * @ingroup SyncMove
472 * \chinese
473 * 更改名为 name 的坐标系的位置,将其移动到由 pose 指定的新位置,pose 以 ref_name 坐标系表达。
474 *
475 * 如果 name 为 “world”、“flange”、“tcp”,或该坐标系不存在,则操作会失败。注意:如需移动 “tcp” 坐标系,请使用 set_tcp() 命令。
476 *
477 * 如果用于 MotionPlus,ref_name 参数可以是外部轴或轴组的名称。
478 *
479 * @param name: 要移动的坐标系名称
480 * @param pose: 新的位置
481 * @param ref_name: pose 所表达的参考坐标系,默认值为机器人的 “base” 坐标系。
482 *
483 * @return
484 * \endchinese
485 * \english
486 * Changes the placement of the coordinate frame named name to the new
487 * placement given by pose that is defined in the ref_name coordinate frame.
488 *
489 * This will fail if name is “world”, “flange”, “tcp”, or if the frame does
490 * not exist. Note: to move the “tcp” frame, use the set_tcp() command
491 * instead.
492 *
493 * If being used with the MotionPlus, the ref_name argument can be the name
494 * of an external axis or axis group.
495 *
496 * @param name: the name of the frame to move
497 * @param pose: the new placement
498 * @param ref_name: the coordinate frame that pose is expressed in. The
499 * default value is the robot’s “base” frame.
500 *
501 * @return
502 * \endenglish
503 */
504 int frameMove(const std::string &name, const std::vector<double> &pose,
505 const std::string &ref_name);
506
507 /**
508 * @ingroup SyncMove
509 * \chinese
510 * 获取名为 name 的坐标系相对于 rel_frame 坐标系的位姿,并以 ref_frame 坐标系表达。
511 * 如果未提供 ref_frame,则返回 name 坐标系相对于 rel_frame 坐标系的位姿,并以 rel_frame 坐标系表达。
512 *
513 * 如果任一参数不是已存在的坐标系,则操作会失败。
514 *
515 * 如果用于 MotionPlus,所有三个参数也可以是外部轴或轴组的名称。
516 *
517 * @param name: 要查询的坐标系名称。
518 * @param rel_frame: “相对坐标系”,用于计算相对位姿的坐标系。
519 * @param ref_frame: “参考坐标系”,用于表达结果相对位姿的坐标系。如果未提供,则默认为 rel_frame。
520 *
521 * @return 以 ref_frame 坐标系表达的 name 坐标系的位姿。
522 * \endchinese
523 * \english
524 * Get the pose of the name frame relative to the rel_frame frame but
525 * expressed in the coordinates of the ref_frame frame. If ref_frame is not
526 * provided, then this returns the pose of the name frame relative to and
527 * expressed in the same frame as rel_frame.
528 *
529 * This will fail if any arguments are not an existing frame.
530 *
531 * If being used with MotionPlus, all three arguments can also be the names
532 * of external axes or axis groups.
533 *
534 * @param name: name of the frame to query.
535 * @param rel_frame: short for “relative frame” is the frame where the pose
536 * is computed relative to
537 * @param ref_frame: short for “reference frame” is the frame to express the
538 * coordinates of resulting relative pose in. If this is not provided, then
539 * it will default to match the value of rel_frame.
540 *
541 * @return The pose of the frame expressed in the ref_frame coordinates.
542 * \endenglish
543 */
544 std::vector<double> frameGetPose(const std::string &name,
545 const std::string &rel_frame,
546 const std::string &ref_frame);
547
548 /**
549 * @ingroup SyncMove
550 * \chinese
551 * 将位姿从 from_frame 坐标系转换到 to_frame 坐标系。
552 *
553 * 如果任一坐标系参数不是已存在的坐标系,则操作会失败。
554 *
555 * 如果用于 MotionPlus,所有三个参数也可以是外部轴或轴组的名称。
556 *
557 * @param pose: 要转换的位姿
558 * @param from_frame: 原始坐标系的参考坐标系名称
559 * @param to_frame: 新坐标系的参考坐标系名称
560 *
561 * @return 以 to_frame 坐标系表达的 pose 值。
562 * \endchinese
563 * \english
564 * Convert pose from from_frame to to_frame.
565 *
566 * This will fail if either coordinate system argument is not an existing
567 * frame.
568 *
569 * If being used with MotionPlus, all three arguments can also be the names
570 * of external axes or axis groups.
571 *
572 * @param pose: pose to be converted
573 * @param from_frame: name of reference frame at origin of old coordinate
574 * system
575 * @param to_frame: name of reference frame at origin of new coordinate
576 * system
577 *
578 * @return Value of pose expressed in the coordinates of to_frame.
579 * \endenglish
580 */
581 std::vector<double> frameConvertPose(const std::vector<double> &pose,
582 const std::string &from_frame,
583 const std::string &to_frame);
584
585 /**
586 * @ingroup SyncMove
587 * \chinese
588 * 查询指定名称的坐标系是否存在。
589 *
590 * @param name: 要查询的坐标系名称。
591 *
592 * @return 如果存在该名称的坐标系则返回 true,否则返回 false。
593 * \endchinese
594 * \english
595 * Queries for the existence of a frame by the given name.
596 *
597 * @param name: name of the frame to be queried.
598 *
599 * @return Returns true if there is a frame by the given name, false if not.
600 * \endenglish
601 */
602 bool frameExist(const std::string &name);
603
604 /**
605 * @ingroup SyncMove
606 * \chinese
607 * 获取名为 name 的坐标系在世界模型中的父坐标系名称。
608 *
609 * 如果该坐标系没有附加到其他坐标系,则其父坐标系为 "world"。
610 *
611 * @param name: 要查询的坐标系名称
612 *
613 * @return 父坐标系的名称,字符串类型
614 * \endchinese
615 * \english
616 * Get the parent of the frame named name in the world model.
617 *
618 * If the frame is not attached to another frame, then “world” is the
619 * parent.
620 *
621 * @param name: the frame being queried
622 *
623 * @return name of the parent as a string
624 * \endenglish
625 */
626 std::string frameGetParent(const std::string &name);
627
628 /**
629 * @ingroup SyncMove
630 * \chinese
631 * 返回指定父对象的直接子对象坐标系名称列表。父子关系由世界模型的附加关系定义。
632 * 如果用于 MotionPlus,子对象也可以是轴组或轴。
633 *
634 * @param name: 父对象的名称。
635 *
636 * @return 直接子对象坐标系名称列表
637 * \endchinese
638 * \english
639 * Returns a list of immediate child object frame names. Parent-child
640 * relationships are defined by world model attachments. If being used with
641 * MotionPlus, the child objects may also be an axis group or an axis.
642 *
643 * @param name: the name of the parent object.
644 *
645 * @return a list of immediate child object frame names
646 * \endenglish
647 */
648 std::vector<std::string> frameGetChildren(const std::string &name);
649
650 /**
651 * @ingroup SyncMove
652 * \chinese
653 * 向世界模型添加一个新的轴组,名称为 name。轴组基座放置在 ref_frame 坐标系下的 pose 位置。
654 *
655 * 轴组只能附加到世界坐标系。
656 *
657 * 每个轴组的基座都附加有一个坐标系,可以通过轴组名称作为参数传递给其他世界模型函数。
658 *
659 * 世界模型最多可添加 6 个轴组。
660 *
661 * @param name: 要添加的轴组名称,不能为空字符串。世界模型对象(如坐标系、轴组、轴等)的名称必须唯一。
662 * @param pose: 轴组基座在参考坐标系下的位姿。
663 * @param ref_frame (可选): pose 所在的参考坐标系名称,可以是任何带有坐标系的世界模型实体(如坐标系、轴组、轴等)。默认值 "base" 表示机器人基座坐标系。
664 *
665 * @return
666 * \endchinese
667 * \english
668 * Adds a new axis group with the given name to the world model. It is
669 * placed at the given pose in the reference coordinate frame defined by
670 * ref_frame.
671 *
672 * An axis group can only be attached to the world coordinate frame.
673 *
674 * Each axis group has a coordinate frame attached to its base, which can be
675 * used as an argument to other world model functions by referring the name
676 * of the group.
677 *
678 * At most 6 axis groups can be added to the world model.
679 *
680 * @param name: (string) Name of the axis group to add. The name cannot be
681 * an empty string. Names used by world model objects (e.g., frame, axis
682 * group, axis, etc.) must be unique.
683 *
684 * @param pose: (pose) Pose of the axis group’s base, in the reference
685 * coordinate frame.
686 *
687 * @param ref_frame (optional): (string) Name of the reference coordinate
688 * frame that pose is defined in. This can be any world model entity with a
689 * coordinate system (e.g., frame, axis group, axis, etc.). The default
690 * value "base" refers to the robot’s base frame.
691 *
692 * @return
693 * \endenglish
694 */
695 int axisGroupAdd(const std::string &name, const std::vector<double> &pose,
696 const std::string &ref_frame);
697
698 /**
699 * @ingroup SyncMove
700 * \chinese
701 * 删除具有给定名称的轴组。
702 *
703 * 所有附加的轴也会被禁用(如果处于活动状态)并删除。
704 *
705 * 如果该轴组正被其他函数控制,则操作会失败。
706 *
707 * @param name: 要删除的轴组名称。该名称的轴组必须存在。
708 *
709 * @return
710 * \endchinese
711 * \english
712 * Deletes the axis group with the given name from the world model.
713 *
714 * All attached axes are also disabled (if live) and deleted.
715 *
716 * This function will fail, if this axis group is under control by another function.
717 *
718 * @param name: (string) Name of the axis group to delete. Axis group with
719 * such name must exist.
720 *
721 * @return
722 * \endenglish
723 */
724 int axisGroupDelete(const std::string &name);
725
726 /**
727 * @ingroup SyncMove
728 * \chinese
729 * 向名为 group_name 的轴组添加一个名为 name 的外部轴。该轴在 parent 坐标系下的 pose 位置附加,pose 表示轴位置为 0 时的位姿。
730 * 轴的类型、最大速度、最大加速度、位置限制和索引分别由 type、v_limit、a_limit、q_limits 和 axis_index 定义。
731 * pose 参数通常通过外部轴调试标定流程获得。
732 * 如果该轴组正被其他函数控制,或附加关系形成闭环,则操作会失败。
733 *
734 * @param group_name: 要添加轴的轴组名称,需已通过 axis_group_add() 创建且存在。
735 * @param name: 新轴的名称,不能为空且需唯一。
736 * @param parent: 父轴名称,若为空或与 group_name 相同,则附加到轴组基座。父轴需已存在于该轴组。
737 * @param pose: 轴在父坐标系下的零位姿。type 为 0(旋转轴)时,z 轴为旋转轴;type 为 1(直线轴)时,z 轴为移动方向。
738 * @param type: 轴类型,0 表示旋转轴,1 表示直线轴。
739 * @param v_limit: 最大速度。
740 * @param a_limit: 最大加速度。
741 * @param q_limits: 位置限制。
742 * @param axis_index: 轴索引。
743 * \endchinese
744 * \english
745 * Adds an external axis with the given name to the axis group named group_name.
746 * The axis is attached at the given pose in the reference coordinate frame defined by parent when its axis position is 0.
747 * The type, max velocity, max acceleration, position limits, and index of this axis are defined by type, v_limit, a_limit, q_limits, and axis_index, respectively.
748 * The pose parameter is typically obtained from a calibration process when the external axis is commissioned.
749 * This function will fail if this axis group is under control of another function, or if the kinematic chain created by the attachment forms a closed chain.
750 *
751 * @param group_name: Name of the axis group this new axis is added to. The axis group would have been created using axis_group_add(). Axis group with such name must exist.
752 * @param name: Name of the new axis. The name cannot be an empty string. Names used by world model objects (e.g., frame, axis group, axis, etc.) must be unique.
753 * @param parent: Name of the parent axis. If it’s empty or the same as group_name, the new axis will be attached to the base of the axis group. Axis with such name must exist in the axis group.
754 * @param pose: The zero-position pose, in the parent coordinate frame, this axis will be placed and attached to. This is the pose the axis will be (relative to its parent) when its axis position is 0. If type is 0 (rotary), then the z axis of the frame corresponds to the axis of rotation. If type is 1 (linear), then the z axis is the axis of translation.
755 * @param type: Axis type, 0 for rotary, 1 for linear.
756 * @param v_limit: Maximum velocity.
757 * @param a_limit: Maximum acceleration.
758 * @param q_limits: Position limits.
759 * @param axis_index: Axis index.
760 * \endenglish
761 */
762 int axisGroupAddAxis(const std::string &group_name, const std::string &name,
763 const std::string &parent,
764 const std::vector<double> &pose);
765
766 /**
767 * @ingroup SyncMove
768 * \chinese
769 * 更新指定名称的轴的相关属性。pose 参数通常通过外部轴调试标定流程获得。
770 * 如果该轴所属的轴组正被其他命令控制,则操作会失败。
771 * 如果该轴组中任何已附加的轴处于激活和使能状态,则操作会失败。
772 *
773 * @param name: 要更新的轴的名称,需已存在。
774 * @param pose (可选): 轴在父轴(或轴组)坐标系下的零位姿。即轴位置为 0 时的位姿。
775 * \endchinese
776 * \english
777 * Updates the corresponding properties of axis with name. The pose
778 * parameter is typically obtained from a calibration process when the
779 * external axis is commissioned. See here for a guide on a basic routine
780 * for calibrating a single rotary axis.
781 *
782 * This function will fail, if the axis group the axis attached to is
783 * already being controlled by another command.
784 * This function will fail, if any attached axis of the axis group is live
785 * and enabled.
786 *
787 * @param name: (string) Name of the axis to update. Axis with such name
788 * must exist.
789 *
790 * @param pose (optional): (pose) New zero-position pose, in the coordinate
791 * frame of the parent axis (or axis group), of the axis. This is the pose
792 * of the axis when its axis position is 0.
793 * \endenglish
794 */
795 int axisGroupUpdateAxis(const std::string &name,
796 const std::vector<double> &pose);
797
798 /**
799 * @ingroup SyncMove
800 * \chinese
801 * 返回指定轴名称在 RTDE 目标位置和实际位置数组中的索引。
802 *
803 * @param axis_name: (string) 要查询的轴名称。该名称的轴必须存在。
804 *
805 * @return integer: 该轴在 RTDE 目标位置和实际位置数组中的索引。
806 * \endchinese
807 * \english
808 * Returns the index of the axis with given axis_name in the RTDE target
809 * positions and actual positions arrays.
810 *
811 * @param axis_name: (string) Name of the axis in query.
812 * Axis with such name must exist.
813 *
814 * @return integer: Index of the axis in the RTDE target positions and
815 * actual positions arrays.
816 * \endenglish
817 */
818 int axisGroupGetAxisIndex(const std::string &name);
819
820 /**
821 * @ingroup SyncMove
822 * \chinese
823 * 返回指定轴索引对应的轴名称。
824 *
825 * @param axis_index: (整数) 要查询的轴索引。该索引的轴必须存在。
826 *
827 * @return 字符串: 轴的名称。
828 * \endchinese
829 * \english
830 * Returns the name of the axis with the given axis_index.
831 *
832 * @param axis_index: (integer) Index of the axis in query.
833 * Axis with such index must exist.
834 *
835 * @return string: Name of the axis.
836 * \endenglish
837 */
838 std::string axisGroupGetAxisName(int index);
839
840 /**
841 * @ingroup SyncMove
842 * \chinese
843 * 返回指定轴组的当前目标位置。
844 * 如果未指定 group_name,则返回所有外部轴的目标位置。
845 *
846 * 如果外部轴总线被禁用,则该函数会失败。
847 *
848 * @param group_name (可选): (string) 要查询的轴组名称。该名称的轴组必须真实存在。
849 *
850 * @return Double[]: 涉及轴的目标位置,顺序为其外部轴索引顺序。
851 * \endchinese
852 * \english
853 * Returns the current target positions of the axis group with group_name.
854 * If group_name is not provided, the target positions of all external axes
855 * will be returned.
856 *
857 * This function will fail, if the external axis bus is disabled.
858 *
859 * @param group_name (optional): (string) Name of the axis group in query.
860 * Axis group with such name must REALLY exist.
861 *
862 * @return Double[]: Target positions of the involved axes, in the order of
863 * their external axis indices.
864 * \endenglish
865 */
866 std::vector<double> axisGroupGetTargetPositions(
867 const std::string &group_name);
868
869 /**
870 * @ingroup SyncMove
871 * \chinese
872 * 返回指定轴组的当前实际位置。
873 * 如果未指定 group_name,则返回所有外部轴的实际位置。
874 *
875 * 如果外部轴总线被禁用,则该函数会失败。
876 *
877 * @param group_name (可选): (string) 要查询的轴组名称。该名称的轴组必须真实存在。
878 *
879 * @return Double[]: 涉及轴的实际位置,顺序为其外部轴索引顺序。
880 * \endchinese
881 * \english
882 * Returns the current actual positions of the axis group with group_name.
883 * If group_name is not provided, the actual positions of all external axes
884 * will be returned.
885 *
886 * This function will fail, if the external axis bus is disabled.
887 *
888 * @param group_name (optional): (string) Name of the axis group in query.
889 * Axis group with such name must exist.
890 *
891 * @return Double[]: Actual positions of the involved axes, in the order of
892 * their external axis indices.
893 * \endenglish
894 */
895 std::vector<double> axisGroupGetActualPositions(
896 const std::string &group_name);
897
898 /**
899 * @ingroup SyncMove
900 * \chinese
901 * 通过给定的 offset,将轴组 group_name 的目标位置和实际位置整体偏移。
902 *
903 * 这是一个仅在控制器内部进行的软件偏移,不会影响外部轴驱动器。该偏移也会应用于通过 RTDE 发布的任何目标和实际位置流。
904 *
905 * @param group_name: (string) 要应用偏移的轴组名称。该名称的轴组必须存在。
906 *
907 * @param offset: (float[]) 目标和实际位置需要整体偏移的量。offset 的大小必须与该轴组所包含的轴数量一致。
908 *
909 * @return
910 * \endchinese
911 * \english
912 * Shifts the target and actual positions of the axis group group_name by
913 * the given offset.
914 *
915 * This is a software shift that happens in the controller only, it does not
916 * affect external axis drives. The shift is also applied to any streamed
917 * target and actual positions published on RTDE.
918 *
919 * @param group_name: (string) Name of the axis group to apply the offset
920 * positions to. Axis group with such name must exist.
921 *
922 * @param offset: (float[]) Offsets that the target and actual positions
923 * should be shifted by. The size of offset must match the number of axes
924 * attached to the given group.
925 *
926 * @return
927 * \endenglish
928 */
929 int axisGroupOffsetPositions(const std::string &group_name,
930 const std::vector<double> &offset);
931
932 /**
933 * @ingroup SyncMove
934 * \chinese
935 * 以梯形速度曲线将名为 group_name 的轴组移动到新的位置 q。
936 * 参数 a 指定本次运动的最大加速度占各轴加速度极限的百分比。
937 * 参数 v 指定本次运动的最大速度占各轴速度极限的百分比。
938 *
939 * 实际的加速度和速度由最受限制的轴决定,以确保所有轴在加速、匀速和减速阶段同时完成。
940 *
941 * @param group_name: (string) 要移动的轴组名称。该名称的轴组必须存在。
942 * @param q: (float[]) 目标位置,旋转轴为弧度,直线轴为米。如果目标超出位置极限,则会被限制在最近的极限值。涉及的轴按其索引递增排序。q 的大小必须与该轴组包含的轴数量一致。
943 * @param a: (float) 本次运动的最大加速度因子,取值范围 (0,1],表示占加速度极限的百分比。
944 * @param v: (float) 本次运动的最大速度因子,取值范围 (0,1],表示占速度极限的百分比。
945 *
946 * 返回值: 无
947 * \endchinese
948 * \english
949 * Moves the axes of axis group named group_name to new positions q, using a
950 * trapezoidal velocity profile. Factor a specifying the percentage of the
951 * max profile accelerations out of the acceleration limits of each axes.
952 * Factor v specifying the percentage of the max profile velocities out of
953 * the velocity limits of each axes.
954 *
955 * The actual accelerations and velocities are determined by the most
956 * constraining axis, so that all the axes complete the acceleration,
957 * cruise, and deceleration phases at the same time.
958 *
959 * @param group_name: (string) Name of the axis group to move.
960 * Axis group with such name must exist.
961 *
962 * @param q: (float[]) Target positions in rad (rotary) or in m (linear). If
963 * the target exceeds the position limits, then it is set to the nearest
964 * limit. The involved axes are ordered increasingly by their axis indices.
965 * The size of q must match the number of axes attached to the given group.
966 *
967 * @param a: (float) Factor specifying the max accelerations of this move
968 * out of the acceleration limits. a must be in range of (0,1].
969 *
970 * @param v: (float) Factor specifying the max velocities of this move out
971 * of the velocity limits. v must be in range of (0,1].
972 *
973 * Return: n/a
974 * \endenglish
975 */
976 int axisGroupMoveJoint(const std::string &group_name,
977 const std::vector<double> &q, double a, double v);
978
979 /**
980 * @ingroup SyncMove
981 * \chinese
982 * 以指定的加速度因子 a,将名为 group_name 的轴组加速到目标速度 qd。该函数会运行 t 秒。
983 * @param group_name: (string) 要控制的外部轴组名称,必须已存在。
984 * @param qd: (float[]) 轴组各轴的目标速度。如果目标速度超过速度极限,则会被限制在极限值。涉及的轴按其索引递增排序。qd 的大小必须与该轴组包含的轴数量一致。
985 * @param a: (float) 本次运动的最大加速度因子,取值范围 (0,1],表示占加速度极限的百分比。
986 * @param t (可选): (float) 函数运行的持续时间(秒)。若 t < 0,则函数将在目标速度达到时返回;若 t ≥ 0,则函数将在该持续时间后返回,无论实际速度是否达到目标值。
987 * \endchinese
988 * \english
989 * Accelerates the axes of axis group named group_name up to the target
990 * velocities qd. Factor a specifying the percentage of the max
991 * accelerations out of the acceleration limits of each axes. The function
992 * will run for a period of t seconds.
993 *
994 * @param group_name: (string) Name of the external axis group to control.
995 * Axis group with such name must exist.
996 *
997 * @param qd: (float[]) Target velocities for the axes in the axis group. If
998 * the target exceeds the velocity limits, then it is set to the limit. The
999 * involved axes are ordered increasingly by their axis indices. The size of
1000 * qd must match the number of axes attached to the given group.
1001 *
1002 * @param a: (float) Factor specifying the max accelerations of this move
1003 * out of the acceleration limits. a must be in range of (0,1].
1004 *
1005 * @param t (optional): (float) Duration in seconds before the function
1006 * returns. If t < 0, then the function will return when the target
1007 * velocities are reached. if t ≥ 0, then the function will return after
1008 * this duration, regardless of what the achieved axes velocities are.
1009 * \endenglish
1010 */
1011 int axisGroupSpeedJoint(const std::string &group_name,
1012 const std::vector<double> &qd, double a, double t);
1013
1014protected:
1015 void *d_;
1016};
1017
1018using SyncMovePtr = std::shared_ptr<SyncMove>;
1019} // namespace common_interface
1020} // namespace arcs
1021#endif // AUBO_SDK_SYNC_MOVE_INTERFACE_H
int axisGroupSpeedJoint(const std::string &group_name, const std::vector< double > &qd, double a, double t)
以指定的加速度因子 a,将名为 group_name 的轴组加速到目标速度 qd。该函数会运行 t 秒。
int frameAttach(const std::string &child, const std::string &parent)
将子坐标系附加到父世界模型对象。附加时会设置父子之间的相对变换,使得子坐标系在世界中不会移动。
std::vector< double > frameConvertPose(const std::vector< double > &pose, const std::string &from_frame, const std::string &to_frame)
将位姿从 from_frame 坐标系转换到 to_frame 坐标系。
std::string axisGroupGetAxisName(int index)
返回指定轴索引对应的轴名称。
std::string frameGetParent(const std::string &name)
获取名为 name 的坐标系在世界模型中的父坐标系名称。
bool frameExist(const std::string &name)
查询指定名称的坐标系是否存在。
int frameDelete(const std::string &name)
删除指定名称的坐标系。
int syncMoveResume()
恢复同步运动模式。
int frameMove(const std::string &name, const std::vector< double > &pose, const std::string &ref_name)
更改名为 name 的坐标系的位置,将其移动到由 pose 指定的新位置,pose 以 ref_name 坐标系表达。
int axisGroupMoveJoint(const std::string &group_name, const std::vector< double > &q, double a, double v)
以梯形速度曲线将名为 group_name 的轴组移动到新的位置 q。 参数 a 指定本次运动的最大加速度占各轴加速度极限的百分比。 参数 v 指定本次运动的最大速度占各轴速度极限的百分比。
int axisGroupDelete(const std::string &name)
删除具有给定名称的轴组。
std::vector< double > frameGetPose(const std::string &name, const std::string &rel_frame, const std::string &ref_frame)
获取名为 name 的坐标系相对于 rel_frame 坐标系的位姿,并以 ref_frame 坐标系表达。 如果未提供 ref_frame,则返回 name 坐标系相对于 rel_frame 坐标系的...
int syncMoveOn(const std::string &syncident, const TaskSet &taskset)
syncMoveOn 用于启动同步运动模式。
int axisGroupAdd(const std::string &name, const std::vector< double > &pose, const std::string &ref_frame)
向世界模型添加一个新的轴组,名称为 name。轴组基座放置在 ref_frame 坐标系下的 pose 位置。
std::vector< double > axisGroupGetTargetPositions(const std::string &group_name)
返回指定轴组的当前目标位置。 如果未指定 group_name,则返回所有外部轴的目标位置。
int waitSyncTasks(const std::string &syncident, const TaskSet &taskset)
waitSyncTasks 用于在程序中的特定点同步多个任务程序。
int syncMoveSuspend()
暂停同步运动模式。
bool isSyncMoveOn()
isSyncMoveOn 用于判断机械单元组是否处于同步运动模式。
int axisGroupOffsetPositions(const std::string &group_name, const std::vector< double > &offset)
通过给定的 offset,将轴组 group_name 的目标位置和实际位置整体偏移。
int syncMoveOff(const std::string &syncident)
syncMoveOff 用于结束同步运动模式。
int axisGroupUpdateAxis(const std::string &name, const std::vector< double > &pose)
更新指定名称的轴的相关属性。pose 参数通常通过外部轴调试标定流程获得。 如果该轴所属的轴组正被其他命令控制,则操作会失败。 如果该轴组中任何已附加的轴处于激活和使能状态,则操作会失败。
int frameDeleteAll()
删除所有已添加到世界模型的坐标系。
std::vector< double > axisGroupGetActualPositions(const std::string &group_name)
返回指定轴组的当前实际位置。 如果未指定 group_name,则返回所有外部轴的实际位置。
int axisGroupGetAxisIndex(const std::string &name)
返回指定轴名称在 RTDE 目标位置和实际位置数组中的索引。
bool syncMoveSegment(int id)
设置同步路径段的ID 在同步运动模式下,所有同时执行的移动指令必须全部编程为圆角区(corner zones)或全部为停止点(stop points)。 这意味着具有相同ID的移动指令要么全部带有圆角区...
int frameAdd(const std::string &name, const std::vector< double > &pose, const std::string &ref_name)
添加一个名为 name 的坐标系,其初始位姿为 pose,位姿以 ref_frame 坐标系表达。 此命令仅向世界模型添加一个坐标系,并不会将其附加到 ref_frame 坐标系。 如需将新添加的坐标系...
int axisGroupAddAxis(const std::string &group_name, const std::string &name, const std::string &parent, const std::vector< double > &pose)
向名为 group_name 的轴组添加一个名为 name 的外部轴。该轴在 parent 坐标系下的 pose 位置附加,pose 表示轴位置为 0 时的位姿。 轴的类型、最大速度、最大加速度、位置限...
std::vector< std::string > frameGetChildren(const std::string &name)
返回指定父对象的直接子对象坐标系名称列表。父子关系由世界模型的附加关系定义。 如果用于 MotionPlus,子对象也可以是轴组或轴。
int syncMoveUndo()
syncMoveUndo 用于关闭同步运动,即使不是所有其他任务程序都执行了 syncMoveUndo 指令。
std::shared_ptr< SyncMove > SyncMovePtr
std::unordered_set< std::string > TaskSet