ARCS SDK API  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 * syncMoveOn is used to start synchronized movement mode.
45 *
46 * A syncMoveOn instruction will wait for the other task programs. When
47 * all task programs have reached the syncMoveOn, they will continue
48 * their execution in synchronized movement mode. The move instructions
49 * in the different task programs are executed simultaneously, until the
50 * instruction syncMoveOff is executed.
51 * A stop point must be programmed before the syncMoveOn instruction.
52 *
53 * @param syncident
54 * @param taskset
55 * @return
56 *
57 * @par Python函数原型
58 * syncMoveOn(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int
59 *
60 * @par Lua函数原型
61 * syncMoveOn(syncident: string, taskset: table) -> nil
62 * @endcoe
63 */
64 int syncMoveOn(const std::string &syncident, const TaskSet &taskset);
65
66 /**
67 * 设置同步路径段的ID
68 * In synchronized movements mode, all or none of the simultaneous move
69 * instructions must be programmed with corner zones. This means that the
70 * move instructions with the same ID must either all have corner zones, or
71 * all have stop points. If a move instruction with a corner zone and a move
72 * instruction with a stop point are synchronously executed in their
73 * respective task program, an error will occur.
74 *
75 * Synchronously executed move instructions can have corner zones of
76 * different sizes (e.g. one use z10 and one use z50).
77 *
78 * @param id
79 * @return
80 *
81 * @par Python函数原型
82 * syncMoveSegment(self: pyaubo_sdk.SyncMove, arg0: int) -> bool
83 *
84 * @par Lua函数原型
85 * syncMoveSegment(id: number) -> boolean
86 * @endcoe
87 */
88 bool syncMoveSegment(int id);
89
90 /**
91 * syncMoveOff is used to end synchronized movement mode.
92 *
93 * A syncMoveOff instruction will wait for the other task programs. When
94 * all task programs have reached the syncMoveOff, they will continue
95 * their execution in unsynchronized mode.
96 * A stop point must be programmed before the syncMoveOff instruction.
97 *
98 * @param syncident
99 * @return
100 *
101 * @par Python函数原型
102 * syncMoveOff(self: pyaubo_sdk.SyncMove, arg0: str) -> int
103 *
104 * @par Lua函数原型
105 * syncMoveOff(syncident: string) -> nil
106 * @endcoe
107 */
108 int syncMoveOff(const std::string &syncident);
109
110 /**
111 * syncMoveUndo is used to turn off synchronized movements, even if not
112 * all the other task programs execute the syncMoveUndo instruction.
113 *
114 * syncMoveUndo is intended for UNDO handlers. When the program
115 * pointer is moved from the procedure, syncMoveUndo is used to turn off
116 * the synchronization.
117 *
118 * @return
119 *
120 * @par Python函数原型
121 * syncMoveUndo(self: pyaubo_sdk.SyncMove) -> int
122 *
123 * @par Lua函数原型
124 * syncMoveUndo() -> nil
125 * @endcoe
126 */
128
129 /**
130 * waitSyncTasks used to synchronize several task programs at a special
131 * point in the program.
132 *
133 * A waitSyncTasks instruction will wait for the other
134 * task programs. When all task programs have reached the waitSyncTasks
135 * instruction, they will continue their execution.
136 *
137 * @param syncident
138 * @param taskset
139 * @return
140 *
141 * @par Python函数原型
142 * waitSyncTasks(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) ->
143 * int
144 *
145 * @par Lua函数原型
146 * waitSyncTasks(syncident: string, taskset: table) -> nil
147 * @endcoe
148 */
149 int waitSyncTasks(const std::string &syncident, const TaskSet &taskset);
150
151 /**
152 * isSyncMoveOn is used to tell if the mechanical unit group is in synchron-
153 * ized movement mode.
154 *
155 * A task that does not control any mechanical unit can find out if the
156 * mechanical units defined in the parameter Use Mechanical Unit Group are
157 * in synchronized movement mode.
158 *
159 * @return
160 *
161 * @par Python函数原型
162 * isSyncMoveOn(self: pyaubo_sdk.SyncMove) -> bool
163 *
164 * @par Lua函数原型
165 * isSyncMoveOn() -> boolean
166 * @endcoe
167 */
169
170 /**
171 *
172 * @return
173 *
174 * @par Python函数原型
175 * syncMoveSuspend(self: pyaubo_sdk.SyncMove) -> int
176 *
177 * @par Lua函数原型
178 * syncMoveSuspend() -> nil
179 * @endcoe
180 */
182
183 /**
184 *
185 * @return
186 *
187 * @par Python函数原型
188 * syncMoveResume(self: pyaubo_sdk.SyncMove) -> int
189 *
190 * @par Lua函数原型
191 * syncMoveResume() -> nil
192 * @endcoe
193 */
195
196protected:
197 void *d_;
198};
199
200using SyncMovePtr = std::shared_ptr<SyncMove>;
201
202// clang-format off
203#define SyncMove_DECLARES \
204 _INST(SyncMove, 2, syncMoveOn, syncident, taskset) \
205 _INST(SyncMove, 1, syncMoveSegment, id) \
206 _INST(SyncMove, 1, syncMoveOff, syncident) \
207 _INST(SyncMove, 0, syncMoveUndo) \
208 _INST(SyncMove, 2, waitSyncTasks, syncident, taskset) \
209 _FUNC(SyncMove, 0, isSyncMoveOn) \
210 _INST(SyncMove, 0, syncMoveSuspend) \
211 _INST(SyncMove, 0, syncMoveResume)
212// clang-format on
213} // namespace common_interface
214} // namespace arcs
215#endif // AUBO_SDK_SYNC_MOVE_INTERFACE_H
int syncMoveOn(const std::string &syncident, const TaskSet &taskset)
syncMoveOn is used to start synchronized movement mode.
int waitSyncTasks(const std::string &syncident, const TaskSet &taskset)
waitSyncTasks used to synchronize several task programs at a special point in the program.
bool isSyncMoveOn()
isSyncMoveOn is used to tell if the mechanical unit group is in synchron- ized movement mode.
int syncMoveOff(const std::string &syncident)
syncMoveOff is used to end synchronized movement mode.
bool syncMoveSegment(int id)
设置同步路径段的ID In synchronized movements mode, all or none of the simultaneous move instructions must be ...
int syncMoveUndo()
syncMoveUndo is used to turn off synchronized movements, even if not all the other task programs exec...
std::shared_ptr< SyncMove > SyncMovePtr
Definition sync_move.h:200
std::unordered_set< std::string > TaskSet
Definition sync_move.h:36