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