ARCS SDK API  0.25.0
载入中...
搜索中...
未找到
runtime_machine.h
浏览该文件的文档.
1/** @file runtime_machine.h
2 * @brief 脚本解释器运行时接口,
3 * 可以实现脚本解释器的暂停、脚本解释器的设置/取消断点
4 */
5#ifndef AUBO_SDK_RUNTIME_MACHINE_INTERFACE_H
6#define AUBO_SDK_RUNTIME_MACHINE_INTERFACE_H
7
8#include <memory>
9#include <aubo/global_config.h>
10#include <aubo/type_def.h>
11
12namespace arcs {
13namespace common_interface {
14
15/**
16 * The RuntimeMachine class
17 */
18class ARCS_ABI_EXPORT RuntimeMachine
19{
20public:
22 virtual ~RuntimeMachine();
23
24 /**
25 * 返回 task_id
26 *
27 * @par JSON-RPC请求示例
28 * {"jsonrpc":"2.0","method":"RuntimeMachine.newTask","params":[false],"id":1}
29 *
30 * @par JSON-RPC响应示例
31 * {"id":1,"jsonrpc":"2.0","result":26}
32 *
33 */
34 int newTask(bool daemon = false);
35
36 /**
37 * 删除 task,会终止正在执行的运动
38 *
39 * @par JSON-RPC请求示例
40 * {"jsonrpc":"2.0","method":"RuntimeMachine.deleteTask","params":[26],"id":1}
41 *
42 * @par JSON-RPC响应示例
43 * {"id":1,"jsonrpc":"2.0","result":0}
44 *
45 */
46 int deleteTask(int tid);
47
48 /**
49 * 等待 task 自然结束
50 *
51 * @param tid
52 * @return
53 *
54 * @par JSON-RPC请求示例
55 * {"jsonrpc":"2.0","method":"RuntimeMachine.detachTask","params":[26],"id":1}
56 *
57 * @par JSON-RPC响应示例
58 * {"id":1,"jsonrpc":"2.0","result":0}
59 *
60 */
61 int detachTask(int tid);
62
63 /**
64 * 判断任务是否存活
65 *
66 * @param tid
67 * @return
68 *
69 * @par JSON-RPC请求示例
70 * {"jsonrpc":"2.0","method":"RuntimeMachine.isTaskAlive","params":[26],"id":1}
71 *
72 * @par JSON-RPC响应示例
73 * {"id":1,"jsonrpc":"2.0","result":true}
74 *
75 */
76 bool isTaskAlive(int tid);
77
78 /**
79 * 切换当前线程,切换之后接下来的指令将被插入切换后的线程中
80 *
81 * @param tid
82 * @return
83 *
84 * @par JSON-RPC请求示例
85 * {"jsonrpc":"2.0","method":"RuntimeMachine.switchTask","params":[26],"id":1}
86 *
87 * @par JSON-RPC响应示例
88 * {"id":1,"jsonrpc":"2.0","result":0}
89 *
90 */
91 int switchTask(int tid);
92
93 /**
94 * 标记记下来的指令的行号和注释
95 *
96 * @param lineno
97 * @param comment
98 * @return
99 *
100 * @par JSON-RPC请求示例
101 * {"jsonrpc":"2.0","method":"RuntimeMachine.setLabel","params":[5,"moveJoint"],"id":1}
102 *
103 * @par JSON-RPC响应示例
104 * {"id":1,"jsonrpc":"2.0","result":0}
105 *
106 */
107 int setLabel(int lineno, const std::string &comment);
108
109 /**
110 * 向aubo_control日志中添加注释
111 * 使用 setLabel 替换
112 *
113 * @param tid 指令的线程ID
114 * @param lineno 行号
115 * @param comment 注释
116 * @return
117 *
118 * @par Python函数原型
119 * setPlanContext(self: pyaubo_sdk.RuntimeMachine, arg0: int, arg1: int,
120 * arg2: str) -> int
121 *
122 * @par Lua函数原型
123 * setPlanContext(tid: number, lineno: number, comment: string) -> number
124 *
125 * @par JSON-RPC请求示例
126 * {"jsonrpc":"2.0","method":"RuntimeMachine.setPlanContext","params":[26,3,"moveJoint"],"id":1}
127 *
128 * @par JSON-RPC响应示例
129 * {"id":1,"jsonrpc":"2.0","result":0}
130 *
131 */
132 ARCS_DEPRECATED int setPlanContext(int tid, int lineno,
133 const std::string &comment);
134
135 /**
136 * 空操作
137 *
138 * @return
139 *
140 * @par JSON-RPC请求示例
141 * {"jsonrpc":"2.0","method":"RuntimeMachine.nop","params":[],"id":1}
142 *
143 * @par JSON-RPC响应示例
144 * {"id":1,"jsonrpc":"2.0","result":0}
145 *
146 */
147 int nop();
148
149 /**
150 * 获取耗时的接口(INST)执行状态, 如 setPersistentParameters
151 *
152 * @return 指令名字, 执行状态
153 * 执行状态: EXECUTING/FINISHED
154 *
155 * @par Python函数原型
156 * getExecutionStatus(self: pyaubo_sdk.RuntimeMachine) -> Tuple[str, str,
157 * int]
158 *
159 * @par Lua函数原型
160 * getExecutionStatus() -> string, string, number
161 *
162 * @par JSON-RPC请求示例
163 * {"jsonrpc":"2.0","method":"RuntimeMachine.getExecutionStatus","params":[],"id":1}
164 *
165 * @par JSON-RPC响应示例
166 * {"id":1,"jsonrpc":"2.0","result":["confirmSafetyParameters","FINISHED"]}
167 *
168 */
169 std::tuple<std::string, std::string> getExecutionStatus();
170 std::tuple<std::string, std::string, int> getExecutionStatus1();
171
172 /**
173 * 跳转到指定行号
174 *
175 * @param lineno
176 * @return
177 *
178 * @par Python函数原型
179 * gotoLine(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
180 *
181 * @par Lua函数原型
182 * gotoLine(lineno: number) -> number
183 *
184 * @par JSON-RPC请求示例
185 * {"jsonrpc":"2.0","method":"RuntimeMachine.gotoLine","params":[10],"id":1}
186 *
187 * @par JSON-RPC响应示例
188 * {"id":1,"jsonrpc":"2.0","result":0}
189 *
190 */
191 int gotoLine(int lineno);
192
193 /**
194 * 获取当前运行上下文
195 *
196 * @param tid 任务编号
197 * 如果指定(不是-1),返回对应任务的运行上下文;如果不指定(是-1),返回正在运行的线程的运行上下文
198 *
199 * @return
200 *
201 * @par Python函数原型
202 * getPlanContext(self: pyaubo_sdk.RuntimeMachine) -> Tuple[int, int, str]
203 *
204 * @par Lua函数原型
205 * getPlanContext() -> number
206 *
207 * @par JSON-RPC请求示例
208 * {"jsonrpc":"2.0","method":"RuntimeMachine.getPlanContext","params":[-1],"id":1}
209 *
210 * @par JSON-RPC响应示例
211 * {"id":1,"jsonrpc":"2.0","result":[-1,0,""]}
212 *
213 */
214 std::tuple<int, int, std::string> getPlanContext(int tid = -1);
215
216 /**
217 * 获取提前运行规划器的上下文信息
218 *
219 * @param tid 任务编号
220 * 如果指定(不是-1),返回对应任务运行规划器的上下文信息;如果不指定(是-1),返回正在运行的线程运行规划器的上下文信息
221 *
222 * @return
223 *
224 * @par JSON-RPC请求示例
225 * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePlanContext","params":[-1],"id":1}
226 *
227 * @par JSON-RPC响应示例
228 * {"id":1,"jsonrpc":"2.0","result":[-1,-1,""]}
229 *
230 */
231 std::tuple<int, int, std::string> getAdvancePlanContext(int tid = -1);
232
233 /**
234 * 获取AdvanceRun的程序指针
235 *
236 * @return
237 *
238 * @par JSON-RPC请求示例
239 * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePtr","params":[-1],"id":1}
240 *
241 * @par JSON-RPC响应示例
242 * {"id":1,"jsonrpc":"2.0","result":-1}
243 *
244 */
245 int getAdvancePtr(int tid = -1);
246
247 /**
248 * 获取机器人运动的程序指针
249 *
250 * @param tid 任务编号
251 * 如果指定(不是-1),返回对应任务的程序指针;如果不指定(是-1),返回正在运行线程的程序指针
252 *
253 * @return
254 *
255 * @par JSON-RPC请求示例
256 * {"jsonrpc":"2.0","method":"RuntimeMachine.getMainPtr","params":[-1],"id":1}
257 *
258 * @par JSON-RPC响应示例
259 * {"id":1,"jsonrpc":"2.0","result":-1}
260 *
261 */
262 int getMainPtr(int tid = -1);
263
264 /**
265 * 获取最近解释过的指令指针
266 *
267 * @param tid
268 * @return
269 *
270 * @par JSON-RPC请求示例
271 * {"jsonrpc":"2.0","method":"RuntimeMachine.getInterpPtr","params":[26],"id":1}
272 *
273 * @par JSON-RPC响应示例
274 * {"id":1,"jsonrpc":"2.0","result":-1}
275 *
276 */
277 int getInterpPtr(int tid);
278
279 /**
280 * 加载本地工程文件
281 * Lua 脚本,只需要给出文件名字,不需要后缀,需要从 ${ARCS_WS}/program
282 * 目录中查找
283 *
284 * @param program
285 * @return
286 *
287 * @par JSON-RPC请求示例
288 * {"jsonrpc":"2.0","method":"RuntimeMachine.loadProgram","params":["demo"],"id":1}
289 *
290 * @par JSON-RPC响应示例
291 * {"id":1,"jsonrpc":"2.0","result":0}
292 *
293 */
294 int loadProgram(const std::string &program);
295
296 /**
297 * 运行已经加载的工程文件
298 *
299 * @return
300 *
301 * @par JSON-RPC请求示例
302 * {"jsonrpc":"2.0","method":"RuntimeMachine.runProgram","params":[],"id":1}
303 *
304 * @par JSON-RPC响应示例
305 * {"id":1,"jsonrpc":"2.0","result":0}
306 *
307 */
309
310 /**
311 * 开始运行时
312 *
313 * @return
314 *
315 * @par Python函数原型
316 * start(self: pyaubo_sdk.RuntimeMachine) -> int
317 *
318 * @par Lua函数原型
319 * start() -> number
320 *
321 * @par JSON-RPC请求示例
322 * {"jsonrpc":"2.0","method":"RuntimeMachine.start","params":[],"id":1}
323 *
324 * @par JSON-RPC响应示例
325 * {"id":1,"jsonrpc":"2.0","result":0}
326 *
327 */
328 int start();
329
330 /**
331 * 停止运行时即脚本运行,无法停止运行时状态为 Stopped 时的机器人运动
332 *
333 * 如果考虑停止机器人所有运动,可以调用 RuntimeMachine::abort 接口
334 *
335 * @return
336 *
337 * @par Python函数原型
338 * stop(self: pyaubo_sdk.RuntimeMachine) -> int
339 *
340 * @par Lua函数原型
341 * stop() -> number
342 *
343 * @par JSON-RPC请求示例
344 * {"jsonrpc":"2.0","method":"RuntimeMachine.stop","params":[],"id":1}
345 *
346 * @par JSON-RPC响应示例
347 * {"id":1,"jsonrpc":"2.0","result":0}
348 *
349 */
350 int stop();
351
352 /**
353 * 终止机器人运行.
354 *
355 * 如果只是考虑停止运行时,可以调用 RuntimeMachine::stop 接口
356 *
357 * 如果脚本运行时处于 Running 状态,则终止运行时;如果运行时处于 Stopped
358 * 且机器人正在移动,则停止机器人移动;如果此时力控开启了,则机器人停止力控
359 *
360 * @return
361 *
362 * @par Python函数原型
363 * abort(self: pyaubo_sdk.RuntimeMachine) -> int
364 *
365 * @par Lua函数原型
366 * abort() -> number
367 *
368 * @par JSON-RPC请求示例
369 * {"jsonrpc":"2.0","method":"RuntimeMachine.abort","params":[],"id":1}
370 *
371 * @par JSON-RPC响应示例
372 * {"id":1,"jsonrpc":"2.0","result":0}
373 *
374 */
375 int abort();
376
377 /**
378 * 暂停解释器
379 *
380 * @return
381 *
382 * @par Python函数原型
383 * pause(self: pyaubo_sdk.RuntimeMachine) -> int
384 *
385 * @par Lua函数原型
386 * pause() -> number
387 *
388 * @par JSON-RPC请求示例
389 * {"jsonrpc":"2.0","method":"RuntimeMachine.pause","params":[],"id":1}
390 *
391 * @par JSON-RPC响应示例
392 * {"id":1,"jsonrpc":"2.0","result":0}
393 *
394 */
395 int pause();
396
397 /**
398 * 单步运行
399 *
400 * @return
401 *
402 * @par Python函数原型
403 * step(self: pyaubo_sdk.RuntimeMachine) -> int
404 *
405 * @par Lua函数原型
406 * step() -> number
407 *
408 * @par JSON-RPC请求示例
409 * {"jsonrpc":"2.0","method":"RuntimeMachine.step","params":[],"id":1}
410 *
411 * @par JSON-RPC响应示例
412 * {"id":1,"jsonrpc":"2.0","result":0}
413 *
414 */
415 int step();
416
417 /**
418 * 恢复解释器
419 *
420 * @return
421 *
422 * @par Python函数原型
423 * resume(self: pyaubo_sdk.RuntimeMachine) -> int
424 *
425 * @par Lua函数原型
426 * resume() -> number
427 *
428 * @par JSON-RPC请求示例
429 * {"jsonrpc":"2.0","method":"RuntimeMachine.resume","params":[],"id":1}
430 *
431 * @par JSON-RPC响应示例
432 * {"id":1,"jsonrpc":"2.0","result":0}
433 *
434 */
435 int resume();
436
437 /**
438 * 恢复解释器之前等待恢复前之前的序列完成
439 *
440 * @param wait
441 * @return
442 *
443 * @par JSON-RPC请求示例
444 * {"jsonrpc":"2.0","method":"RuntimeMachine.setResumeWait","params":[true],"id":1}
445 *
446 * @par JSON-RPC响应示例
447 * {"id":1,"jsonrpc":"2.0","result":0}
448 *
449 */
450 int setResumeWait(bool wait);
451
452 /**
453 * 获取规划器的状态
454 *
455 * @return
456 *
457 * @par Python函数原型
458 * getStatus(self: pyaubo_sdk.RuntimeMachine) ->
459 * arcs::common_interface::RuntimeState
460 *
461 * @par Lua函数原型
462 * getStatus() -> number
463 *
464 * @par JSON-RPC请求示例
465 * {"jsonrpc":"2.0","method":"RuntimeMachine.getStatus","params":[],"id":1}
466 *
467 * @par JSON-RPC响应示例
468 * {"id":1,"jsonrpc":"2.0","result":"Running"}
469 *
470 */
471 ARCS_DEPRECATED RuntimeState getStatus();
473
474 /**
475 * 设置断点
476 *
477 * @param lineno
478 * @return
479 *
480 * @par Python函数原型
481 * setBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
482 *
483 * @par Lua函数原型
484 * setBreakPoint(lineno: number) -> number
485 *
486 * @par JSON-RPC请求示例
487 * {"jsonrpc":"2.0","method":"RuntimeMachine.setBreakPoint","params":[15],"id":1}
488 *
489 * @par JSON-RPC响应示例
490 * {"id":1,"jsonrpc":"2.0","result":0}
491 *
492 */
493 int setBreakPoint(int lineno);
494
495 /**
496 * 移除断点
497 *
498 * @param lineno
499 * @return
500 *
501 * @par Python函数原型
502 * removeBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
503 *
504 * @par Lua函数原型
505 * removeBreakPoint(lineno: number) -> number
506 *
507 * @par JSON-RPC请求示例
508 * {"jsonrpc":"2.0","method":"RuntimeMachine.removeBreakPoint","params":[15],"id":1}
509 *
510 * @par JSON-RPC响应示例
511 * {"id":1,"jsonrpc":"2.0","result":0}
512 *
513 */
514 int removeBreakPoint(int lineno);
515
516 /**
517 * 清除所有断点
518 *
519 * @return
520 *
521 * @par Python函数原型
522 * clearBreakPoints(self: pyaubo_sdk.RuntimeMachine) -> int
523 *
524 * @par Lua函数原型
525 * clearBreakPoints() -> number
526 *
527 * @par JSON-RPC请求示例
528 * {"jsonrpc":"2.0","method":"RuntimeMachine.clearBreakPoints","params":[],"id":1}
529 *
530 * @par JSON-RPC响应示例
531 * {"id":1,"jsonrpc":"2.0","result":0}
532 *
533 */
535
536 /**
537 * 定时器开始
538 *
539 * @param name
540 * @return
541 *
542 * @par Python函数原型
543 * timerStart(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
544 *
545 * @par Lua函数原型
546 * timerStart(name: string) -> nil
547 *
548 * @par JSON-RPC请求示例
549 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStart","params":["timer"],"id":1}
550 *
551 * @par JSON-RPC响应示例
552 * {"id":1,"jsonrpc":"2.0","result":0}
553 *
554 */
555 int timerStart(const std::string &name);
556
557 /**
558 * 定时器结束
559 *
560 * @param name
561 * @return
562 *
563 * @par Python函数原型
564 * timerStop(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
565 *
566 * @par Lua函数原型
567 * timerStop(name: string) -> nil
568 *
569 * @par JSON-RPC请求示例
570 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStop","params":["timer"],"id":1}
571 *
572 * @par JSON-RPC响应示例
573 * {"id":1,"jsonrpc":"2.0","result":0}
574 *
575 */
576 int timerStop(const std::string &name);
577
578 /**
579 * 定时器重置
580 *
581 * @param name
582 * @return
583 *
584 * @par Python函数原型
585 * timerReset(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
586 *
587 * @par Lua函数原型
588 * timerReset(name: string) -> nil
589 *
590 * @par JSON-RPC请求示例
591 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerReset","params":["timer"],"id":1}
592 *
593 * @par JSON-RPC响应示例
594 * {"id":1,"jsonrpc":"2.0","result":0}
595 *
596 */
597 int timerReset(const std::string &name);
598
599 /**
600 * 定时器删除
601 *
602 * @param name
603 * @return
604 *
605 * @par Python函数原型
606 * timerDelete(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
607 *
608 * @par Lua函数原型
609 * timerDelete(name: string) -> nil
610 *
611 * @par JSON-RPC请求示例
612 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerDelete","params":["timer"],"id":1}
613 *
614 * @par JSON-RPC响应示例
615 * {"id":1,"jsonrpc":"2.0","result":0}
616 *
617 */
618 int timerDelete(const std::string &name);
619
620 /**
621 * 获取定时器数值
622 *
623 * @param name
624 * @return
625 *
626 * @par Python函数原型
627 * getTimer(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> float
628 *
629 * @par Lua函数原型
630 * getTimer(name: string) -> number
631 *
632 * @par JSON-RPC请求示例
633 * {"jsonrpc":"2.0","method":"RuntimeMachine.getTimer","params":["timer"],"id":1}
634 *
635 * @par JSON-RPC响应示例
636 * {"id":1,"jsonrpc":"2.0","result":25.409769612}
637 *
638 */
639 double getTimer(const std::string &name);
640
641 /**
642 * 开始配置触发
643 *
644 * @param distance
645 * @param delay
646 * @return
647 *
648 * @par JSON-RPC请求示例
649 * {"jsonrpc":"2.0","method":"RuntimeMachine.triggBegin","params":[],"id":1}
650 *
651 * @par JSON-RPC响应示例
652 * {"id":1,"jsonrpc":"2.0","result":0}
653 *
654 */
655 int triggBegin(double distance, double delay);
656
657 /**
658 * 终止配置触发
659 *
660 * @return
661 *
662 * @par JSON-RPC请求示例
663 * {"jsonrpc":"2.0","method":"RuntimeMachine.triggEnd","params":[],"id":1}
664 *
665 * @par JSON-RPC响应示例
666 * {"id":1,"jsonrpc":"2.0","result":0}
667 *
668 */
669 int triggEnd();
670
671 /**
672 * 返回自动分配的中断号
673 *
674 * @param distance
675 * @param delay
676 * @param intnum
677 * @return
678 */
679 int triggInterrupt(double distance, double delay);
680
681 /**
682 * 获取所有的中断号列表
683 *
684 * @return
685 *
686 * @par JSON-RPC请求示例
687 * {"jsonrpc":"2.0","method":"RuntimeMachine.getTriggInterrupts","params":[],"id":1}
688 *
689 * @par JSON-RPC响应示例
690 * {"id":1,"jsonrpc":"2.0","result":[]}
691 *
692 */
693 std::vector<int> getTriggInterrupts();
694
695protected:
696 void *d_;
697};
698
699using RuntimeMachinePtr = std::shared_ptr<RuntimeMachine>;
700
701// clang-format off
702#define RuntimeMachine_DECLARES \
703 _FUNC(RuntimeMachine, 1, newTask, daemon) \
704 _FUNC(RuntimeMachine, 1, deleteTask, tid) \
705 _FUNC(RuntimeMachine, 1, detachTask, tid) \
706 _FUNC(RuntimeMachine, 1, isTaskAlive, tid) \
707 _INST(RuntimeMachine, 0, nop) \
708 _FUNC(RuntimeMachine, 1, switchTask, tid) \
709 _FUNC(RuntimeMachine, 2, setLabel, tid, lineno) \
710 _FUNC(RuntimeMachine, 3, setPlanContext, tid, lineno, comment) \
711 _FUNC(RuntimeMachine, 1, gotoLine, lineno) \
712 _FUNC(RuntimeMachine, 1, getAdvancePlanContext, tid) \
713 _FUNC(RuntimeMachine, 1, getAdvancePtr, tid) \
714 _FUNC(RuntimeMachine, 1, getMainPtr, tid) \
715 _FUNC(RuntimeMachine, 1, getInterpPtr, tid) \
716 _FUNC(RuntimeMachine, 1, getPlanContext, tid) \
717 _FUNC(RuntimeMachine, 0, getExecutionStatus) \
718 _FUNC(RuntimeMachine, 0, getExecutionStatus1) \
719 _FUNC(RuntimeMachine, 1, loadProgram, program) \
720 _FUNC(RuntimeMachine, 0, runProgram) \
721 _FUNC(RuntimeMachine, 0, start) \
722 _FUNC(RuntimeMachine, 0, stop) \
723 _FUNC(RuntimeMachine, 0, abort) \
724 _FUNC(RuntimeMachine, 0, pause) \
725 _FUNC(RuntimeMachine, 0, step) \
726 _FUNC(RuntimeMachine, 1, setResumeWait, wait) \
727 _FUNC(RuntimeMachine, 0, resume) \
728 _FUNC(RuntimeMachine, 0, getStatus) \
729 _FUNC(RuntimeMachine, 0, getRuntimeState) \
730 _FUNC(RuntimeMachine, 1, setBreakPoint, lineno) \
731 _FUNC(RuntimeMachine, 1, removeBreakPoint, lineno) \
732 _FUNC(RuntimeMachine, 0, clearBreakPoints) \
733 _INST(RuntimeMachine, 1, timerStart, name) \
734 _INST(RuntimeMachine, 1, timerStop, name) \
735 _INST(RuntimeMachine, 1, timerReset, name) \
736 _INST(RuntimeMachine, 1, timerDelete, name) \
737 _FUNC(RuntimeMachine, 1, getTimer, name) \
738 _FUNC(RuntimeMachine, 2, triggBegin, distance, delay) \
739 _FUNC(RuntimeMachine, 0, triggEnd) \
740 _FUNC(RuntimeMachine, 2, triggInterrupt, distance, delay) \
741 _FUNC(RuntimeMachine, 0, getTriggInterrupts)
742
743// clang-format on
744} // namespace common_interface
745} // namespace arcs
746#endif // AUBO_SDK_RUNTIME_MACHINE_H
int timerStop(const std::string &name)
定时器结束
double getTimer(const std::string &name)
获取定时器数值
int switchTask(int tid)
切换当前线程,切换之后接下来的指令将被插入切换后的线程中
std::tuple< int, int, std::string > getPlanContext(int tid=-1)
获取当前运行上下文
int abort()
终止机器人运行.
int gotoLine(int lineno)
跳转到指定行号
int detachTask(int tid)
等待 task 自然结束
int runProgram()
运行已经加载的工程文件
int timerReset(const std::string &name)
定时器重置
std::tuple< int, int, std::string > getAdvancePlanContext(int tid=-1)
获取提前运行规划器的上下文信息
ARCS_DEPRECATED int setPlanContext(int tid, int lineno, const std::string &comment)
向aubo_control日志中添加注释 使用 setLabel 替换
int triggBegin(double distance, double delay)
开始配置触发
int getAdvancePtr(int tid=-1)
获取AdvanceRun的程序指针
int triggEnd()
终止配置触发
int removeBreakPoint(int lineno)
移除断点
int clearBreakPoints()
清除所有断点
std::tuple< std::string, std::string, int > getExecutionStatus1()
int setBreakPoint(int lineno)
设置断点
int setResumeWait(bool wait)
恢复解释器之前等待恢复前之前的序列完成
int loadProgram(const std::string &program)
加载本地工程文件 Lua 脚本,只需要给出文件名字,不需要后缀,需要从 ${ARCS_WS}/program 目录中查找
ARCS_DEPRECATED RuntimeState getStatus()
获取规划器的状态
int getInterpPtr(int tid)
获取最近解释过的指令指针
std::vector< int > getTriggInterrupts()
获取所有的中断号列表
int deleteTask(int tid)
删除 task,会终止正在执行的运动
int newTask(bool daemon=false)
返回 task_id
int triggInterrupt(double distance, double delay)
返回自动分配的中断号
int timerDelete(const std::string &name)
定时器删除
int getMainPtr(int tid=-1)
获取机器人运动的程序指针
int timerStart(const std::string &name)
定时器开始
std::tuple< std::string, std::string > getExecutionStatus()
获取耗时的接口(INST)执行状态, 如 setPersistentParameters
bool isTaskAlive(int tid)
判断任务是否存活
int setLabel(int lineno, const std::string &comment)
标记记下来的指令的行号和注释
int stop()
停止运行时即脚本运行,无法停止运行时状态为 Stopped 时的机器人运动
std::shared_ptr< RuntimeMachine > RuntimeMachinePtr
数据类型的定义