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