AUBO SDK  0.26.0
runtime_machine.h
Go to the documentation of this file.
1/** @file runtime_machine.h
2 * @brief Script interpreter runtime interface,
3 * allows pausing the script interpreter and setting/removing breakpoints.
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 * @defgroup RuntimeMachine RuntimeMachine (运行时管理)
17 * The RuntimeMachine class
18 */
19class ARCS_ABI_EXPORT RuntimeMachine
20{
21public:
23 virtual ~RuntimeMachine();
24
25 /**
26 * @ingroup RuntimeMachine
27 * \chinese
28 * 返回 task_id
29 *
30 * @par JSON-RPC请求示例
31 * {"jsonrpc":"2.0","method":"RuntimeMachine.newTask","params":[false],"id":1}
32 *
33 * @par JSON-RPC响应示例
34 * {"id":1,"jsonrpc":"2.0","result":26}
35 * \endchinese
36 * \english
37 * Returns the task_id
38 *
39 * @par JSON-RPC Request Example
40 * {"jsonrpc":"2.0","method":"RuntimeMachine.newTask","params":[false],"id":1}
41 *
42 * @par JSON-RPC Response Example
43 * {"id":1,"jsonrpc":"2.0","result":26}
44 * \endenglish
45 */
46 int newTask(bool daemon = false);
47
48 /**
49 * @ingroup RuntimeMachine
50 * \chinese
51 * 删除 task,会终止正在执行的运动
52 *
53 * @par JSON-RPC请求示例
54 * {"jsonrpc":"2.0","method":"RuntimeMachine.deleteTask","params":[26],"id":1}
55 *
56 * @par JSON-RPC响应示例
57 * {"id":1,"jsonrpc":"2.0","result":0}
58 *
59 * \endchinese
60 * \english
61 * Delete a task, which will terminate any ongoing motion.
62 *
63 * @par JSON-RPC Request Example
64 * {"jsonrpc":"2.0","method":"RuntimeMachine.deleteTask","params":[26],"id":1}
65 *
66 * @par JSON-RPC Response Example
67 * {"id":1,"jsonrpc":"2.0","result":0}
68 *
69 * \endenglish
70 */
71 int deleteTask(int tid);
72
73 /**
74 * @ingroup RuntimeMachine
75 * \chinese
76 * 等待 task 自然结束
77 *
78 * @param tid
79 * @return
80 *
81 * @par JSON-RPC请求示例
82 * {"jsonrpc":"2.0","method":"RuntimeMachine.detachTask","params":[26],"id":1}
83 *
84 * @par JSON-RPC响应示例
85 * {"id":1,"jsonrpc":"2.0","result":0}
86 *
87 * \endchinese
88 * \english
89 * Wait for the task to finish naturally
90 *
91 * @param tid
92 * @return
93 *
94 * @par JSON-RPC Request Example
95 * {"jsonrpc":"2.0","method":"RuntimeMachine.detachTask","params":[26],"id":1}
96 *
97 * @par JSON-RPC Response Example
98 * {"id":1,"jsonrpc":"2.0","result":0}
99 *
100 * \endenglish
101 */
102 int detachTask(int tid);
103
104 /**
105 * @ingroup RuntimeMachine
106 * \chinese
107 * 判断任务是否存活
108 *
109 * @param tid
110 * @return
111 *
112 * @par JSON-RPC请求示例
113 * {"jsonrpc":"2.0","method":"RuntimeMachine.isTaskAlive","params":[26],"id":1}
114 *
115 * @par JSON-RPC响应示例
116 * {"id":1,"jsonrpc":"2.0","result":true}
117 *
118 * \endchinese
119 * \english
120 * Check if the task is alive
121 *
122 * @param tid
123 * @return
124 *
125 * @par JSON-RPC Request Example
126 * {"jsonrpc":"2.0","method":"RuntimeMachine.isTaskAlive","params":[26],"id":1}
127 *
128 * @par JSON-RPC Response Example
129 * {"id":1,"jsonrpc":"2.0","result":true}
130 *
131 * \endenglish
132 */
133 bool isTaskAlive(int tid);
134
135 /**
136 * @ingroup RuntimeMachine
137 * \chinese
138 * 获取任务中缓存的指令的数量
139 *
140 * @param tid
141 * @return
142 * \endchinese
143 * \english
144 * Get the number of cached instructions in the task
145 *
146 * @param tid
147 * @return
148 * \endenglish
149 */
150 int getTaskQueueSize(int tid);
151
152 /**
153 * @ingroup RuntimeMachine
154 * \chinese
155 * 切换当前线程,切换之后接下来的指令将被插入切换后的线程中
156 *
157 * @param tid
158 * @return
159 *
160 * @par JSON-RPC请求示例
161 * {"jsonrpc":"2.0","method":"RuntimeMachine.switchTask","params":[26],"id":1}
162 *
163 * @par JSON-RPC响应示例
164 * {"id":1,"jsonrpc":"2.0","result":0}
165 *
166 * \endchinese
167 * \english
168 * Switch the current thread. After switching, subsequent instructions will
169 * be inserted into the switched thread.
170 *
171 * @param tid
172 * @return
173 *
174 * @par JSON-RPC Request Example
175 * {"jsonrpc":"2.0","method":"RuntimeMachine.switchTask","params":[26],"id":1}
176 *
177 * @par JSON-RPC Response Example
178 * {"id":1,"jsonrpc":"2.0","result":0}
179 *
180 * \endenglish
181 */
182 int switchTask(int tid);
183
184 /**
185 * @ingroup RuntimeMachine
186 * \chinese
187 * 标记记下来的指令的行号和注释
188 *
189 * @param lineno
190 * @param comment
191 * @return
192 *
193 * @par JSON-RPC请求示例
194 * {"jsonrpc":"2.0","method":"RuntimeMachine.setLabel","params":[5,"moveJoint"],"id":1}
195 *
196 * @par JSON-RPC响应示例
197 * {"id":1,"jsonrpc":"2.0","result":0}
198 *
199 * \endchinese
200 * \english
201 * Mark the line number and comment of the recorded instruction
202 *
203 * @param lineno
204 * @param comment
205 * @return
206 *
207 * @par JSON-RPC Request Example
208 * {"jsonrpc":"2.0","method":"RuntimeMachine.setLabel","params":[5,"moveJoint"],"id":1}
209 *
210 * @par JSON-RPC Response Example
211 * {"id":1,"jsonrpc":"2.0","result":0}
212 *
213 * \endenglish
214 */
215 int setLabel(int lineno, const std::string &comment);
216
217 /**
218 * @ingroup RuntimeMachine
219 * \chinese
220 * 向aubo_control日志中添加注释
221 * 使用 setLabel 替换
222 *
223 * @param tid 指令的线程ID
224 * @param lineno 行号
225 * @param comment 注释
226 * @return
227 *
228 * @par Python函数原型
229 * setPlanContext(self: pyaubo_sdk.RuntimeMachine, arg0: int, arg1: int,
230 * arg2: str) -> int
231 *
232 * @par Lua函数原型
233 * setPlanContext(tid: number, lineno: number, comment: string) -> number
234 *
235 * @par JSON-RPC请求示例
236 * {"jsonrpc":"2.0","method":"RuntimeMachine.setPlanContext","params":[26,3,"moveJoint"],"id":1}
237 *
238 * @par JSON-RPC响应示例
239 * {"id":1,"jsonrpc":"2.0","result":0}
240 *
241 * \endchinese
242 * \english
243 * Add a comment to the aubo_control log
244 * Use setLabel instead
245 *
246 * @param tid Thread ID of the instruction
247 * @param lineno Line number
248 * @param comment Comment
249 * @return
250 *
251 * @par Python function prototype
252 * setPlanContext(self: pyaubo_sdk.RuntimeMachine, arg0: int, arg1: int,
253 * arg2: str) -> int
254 *
255 * @par Lua function prototype
256 * setPlanContext(tid: number, lineno: number, comment: string) -> number
257 *
258 * @par JSON-RPC Request Example
259 * {"jsonrpc":"2.0","method":"RuntimeMachine.setPlanContext","params":[26,3,"moveJoint"],"id":1}
260 *
261 * @par JSON-RPC Response Example
262 * {"id":1,"jsonrpc":"2.0","result":0}
263 *
264 * \endenglish
265 */
266 ARCS_DEPRECATED int setPlanContext(int tid, int lineno,
267 const std::string &comment);
268
269 /**
270 * @ingroup RuntimeMachine
271 * \chinese
272 * 空操作
273 *
274 * @return
275 *
276 * @par JSON-RPC请求示例
277 * {"jsonrpc":"2.0","method":"RuntimeMachine.nop","params":[],"id":1}
278 *
279 * @par JSON-RPC响应示例
280 * {"id":1,"jsonrpc":"2.0","result":0}
281 *
282 * \endchinese
283 * \english
284 * No operation
285 *
286 * @return
287 *
288 * @par JSON-RPC Request Example
289 * {"jsonrpc":"2.0","method":"RuntimeMachine.nop","params":[],"id":1}
290 *
291 * @par JSON-RPC Response Example
292 * {"id":1,"jsonrpc":"2.0","result":0}
293 *
294 * \endenglish
295 */
296 int nop();
297
298 /**
299 * @ingroup RuntimeMachine
300 * \chinese
301 * 获取耗时的接口(INST)执行状态, 如 setPersistentParameters
302 *
303 * @return 指令名字, 执行状态
304 * 执行状态: EXECUTING/FINISHED
305 *
306 * @par Python函数原型
307 * getExecutionStatus(self: pyaubo_sdk.RuntimeMachine) -> Tuple[str, str,
308 * int]
309 *
310 * @par Lua函数原型
311 * getExecutionStatus() -> string, string, number
312 *
313 * @par JSON-RPC请求示例
314 * {"jsonrpc":"2.0","method":"RuntimeMachine.getExecutionStatus","params":[],"id":1}
315 *
316 * @par JSON-RPC响应示例
317 * {"id":1,"jsonrpc":"2.0","result":["confirmSafetyParameters","FINISHED"]}
318 *
319 * \endchinese
320 * \english
321 * Get the execution status of time-consuming interfaces (INST), such as
322 * setPersistentParameters
323 *
324 * @return Instruction name, execution status
325 * Execution status: EXECUTING/FINISHED
326 *
327 * @par Python function prototype
328 * getExecutionStatus(self: pyaubo_sdk.RuntimeMachine) -> Tuple[str, str,
329 * int]
330 *
331 * @par Lua function prototype
332 * getExecutionStatus() -> string, string, number
333 *
334 * @par JSON-RPC Request Example
335 * {"jsonrpc":"2.0","method":"RuntimeMachine.getExecutionStatus","params":[],"id":1}
336 *
337 * @par JSON-RPC Response Example
338 * {"id":1,"jsonrpc":"2.0","result":["confirmSafetyParameters","FINISHED"]}
339 *
340 * \endenglish
341 */
342 std::tuple<std::string, std::string> getExecutionStatus();
343 std::tuple<std::string, std::string, int> getExecutionStatus1();
344
345 /**
346 * @ingroup RuntimeMachine
347 * \chinese
348 * 跳转到指定行号
349 *
350 * @param lineno
351 * @return
352 *
353 * @par Python函数原型
354 * gotoLine(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
355 *
356 * @par Lua函数原型
357 * gotoLine(lineno: number) -> number
358 *
359 * @par JSON-RPC请求示例
360 * {"jsonrpc":"2.0","method":"RuntimeMachine.gotoLine","params":[10],"id":1}
361 *
362 * @par JSON-RPC响应示例
363 * {"id":1,"jsonrpc":"2.0","result":0}
364 *
365 * \endchinese
366 * \english
367 * Jump to the specified line number
368 *
369 * @param lineno
370 * @return
371 *
372 * @par Python function prototype
373 * gotoLine(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
374 *
375 * @par Lua function prototype
376 * gotoLine(lineno: number) -> number
377 *
378 * @par JSON-RPC Request Example
379 * {"jsonrpc":"2.0","method":"RuntimeMachine.gotoLine","params":[10],"id":1}
380 *
381 * @par JSON-RPC Response Example
382 * {"id":1,"jsonrpc":"2.0","result":0}
383 *
384 * \endenglish
385 */
386 int gotoLine(int lineno);
387
388 /**
389 * @ingroup RuntimeMachine
390 * \chinese
391 * 获取当前运行上下文
392 *
393 * @param tid 任务编号
394 * 如果指定(不是-1),返回对应任务的运行上下文;如果不指定(是-1),返回正在运行的线程的运行上下文
395 *
396 * @return
397 *
398 * @par Python函数原型
399 * getPlanContext(self: pyaubo_sdk.RuntimeMachine) -> Tuple[int, int, str]
400 *
401 * @par Lua函数原型
402 * getPlanContext() -> number
403 *
404 * @par JSON-RPC请求示例
405 * {"jsonrpc":"2.0","method":"RuntimeMachine.getPlanContext","params":[-1],"id":1}
406 *
407 * @par JSON-RPC响应示例
408 * {"id":1,"jsonrpc":"2.0","result":[-1,0,""]}
409 *
410 * \endchinese
411 * \english
412 * Get the current runtime context
413 *
414 * @param tid Task ID
415 * If specified (not -1), returns the runtime context of the corresponding
416 * task; if not specified (is -1), returns the runtime context of the
417 * currently running thread
418 *
419 * @return
420 *
421 * @par Python function prototype
422 * getPlanContext(self: pyaubo_sdk.RuntimeMachine) -> Tuple[int, int, str]
423 *
424 * @par Lua function prototype
425 * getPlanContext() -> number
426 *
427 * @par JSON-RPC Request Example
428 * {"jsonrpc":"2.0","method":"RuntimeMachine.getPlanContext","params":[-1],"id":1}
429 *
430 * @par JSON-RPC Response Example
431 * {"id":1,"jsonrpc":"2.0","result":[-1,0,""]}
432 *
433 * \endenglish
434 */
435 std::tuple<int, int, std::string> getPlanContext(int tid = -1);
436
437 /**
438 * @ingroup RuntimeMachine
439 * \chinese
440 * 获取提前运行规划器的上下文信息
441 *
442 * @param tid 任务编号
443 * 如果指定(不是-1),返回对应任务运行规划器的上下文信息;如果不指定(是-1),返回正在运行的线程运行规划器的上下文信息
444 *
445 * @return
446 *
447 * @par JSON-RPC请求示例
448 * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePlanContext","params":[-1],"id":1}
449 *
450 * @par JSON-RPC响应示例
451 * {"id":1,"jsonrpc":"2.0","result":[-1,-1,""]}
452 *
453 * \endchinese
454 * \english
455 * Get the context information of the advance planner
456 *
457 * @param tid Task ID
458 * If specified (not -1), returns the context information of the advance
459 * planner for the corresponding task; if not specified (is -1), returns the
460 * context information of the advance planner for the currently running
461 * thread
462 *
463 * @return
464 *
465 * @par JSON-RPC Request Example
466 * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePlanContext","params":[-1],"id":1}
467 *
468 * @par JSON-RPC Response Example
469 * {"id":1,"jsonrpc":"2.0","result":[-1,-1,""]}
470 *
471 * \endenglish
472 */
473 std::tuple<int, int, std::string> getAdvancePlanContext(int tid = -1);
474
475 /**
476 * @ingroup RuntimeMachine
477 * \chinese
478 * 获取AdvanceRun的程序指针
479 *
480 * @return
481 *
482 * @par JSON-RPC请求示例
483 * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePtr","params":[-1],"id":1}
484 *
485 * @par JSON-RPC响应示例
486 * {"id":1,"jsonrpc":"2.0","result":-1}
487 *
488 * \endchinese
489 * \english
490 * Get the program pointer of AdvanceRun
491 *
492 * @return
493 *
494 * @par JSON-RPC Request Example
495 * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePtr","params":[-1],"id":1}
496 *
497 * @par JSON-RPC Response Example
498 * {"id":1,"jsonrpc":"2.0","result":-1}
499 *
500 * \endenglish
501 */
502 int getAdvancePtr(int tid = -1);
503
504 /**
505 * @ingroup RuntimeMachine
506 * \chinese
507 * 获取机器人运动的程序指针
508 *
509 * @param tid 任务编号
510 * 如果指定(不是-1),返回对应任务的程序指针;如果不指定(是-1),返回正在运行线程的程序指针
511 *
512 * @return
513 *
514 * @par JSON-RPC请求示例
515 * {"jsonrpc":"2.0","method":"RuntimeMachine.getMainPtr","params":[-1],"id":1}
516 *
517 * @par JSON-RPC响应示例
518 * {"id":1,"jsonrpc":"2.0","result":-1}
519 *
520 * \endchinese
521 * \english
522 * Get the program pointer of robot motion
523 *
524 * @param tid Task ID
525 * If specified (not -1), returns the program pointer of the corresponding
526 * task; if not specified (is -1), returns the program pointer of the
527 * currently running thread
528 *
529 * @return
530 *
531 * @par JSON-RPC Request Example
532 * {"jsonrpc":"2.0","method":"RuntimeMachine.getMainPtr","params":[-1],"id":1}
533 *
534 * @par JSON-RPC Response Example
535 * {"id":1,"jsonrpc":"2.0","result":-1}
536 *
537 * \endenglish
538 */
539 int getMainPtr(int tid = -1);
540
541 /**
542 * @ingroup RuntimeMachine
543 * \chinese
544 * 获取最近解释过的指令指针
545 *
546 * @param tid
547 * @return
548 *
549 * @par JSON-RPC请求示例
550 * {"jsonrpc":"2.0","method":"RuntimeMachine.getInterpPtr","params":[26],"id":1}
551 *
552 * @par JSON-RPC响应示例
553 * {"id":1,"jsonrpc":"2.0","result":-1}
554 *
555 * \endchinese
556 * \english
557 * Get the pointer of the most recently interpreted instruction
558 *
559 * @param tid
560 * @return
561 *
562 * @par JSON-RPC Request Example
563 * {"jsonrpc":"2.0","method":"RuntimeMachine.getInterpPtr","params":[26],"id":1}
564 *
565 * @par JSON-RPC Response Example
566 * {"id":1,"jsonrpc":"2.0","result":-1}
567 *
568 * \endenglish
569 */
570 int getInterpPtr(int tid);
571
572 /**
573 * @ingroup RuntimeMachine
574 * \chinese
575 * 加载本地工程文件
576 * Lua 脚本,只需要给出文件名字,不需要后缀,需要从 ${ARCS_WS}/program
577 * 目录中查找
578 *
579 * @param program
580 * @return
581 *
582 * @par JSON-RPC请求示例
583 * {"jsonrpc":"2.0","method":"RuntimeMachine.loadProgram","params":["demo"],"id":1}
584 *
585 * @par JSON-RPC响应示例
586 * {"id":1,"jsonrpc":"2.0","result":0}
587 *
588 * \endchinese
589 * \english
590 * Load a local project file.
591 * For Lua scripts, only the file name is required (no extension), and it
592 * will be searched in the ${ARCS_WS}/program directory.
593 *
594 * @param program
595 * @return
596 *
597 * @par JSON-RPC Request Example
598 * {"jsonrpc":"2.0","method":"RuntimeMachine.loadProgram","params":["demo"],"id":1}
599 *
600 * @par JSON-RPC Response Example
601 * {"id":1,"jsonrpc":"2.0","result":0}
602 *
603 * \endenglish
604 */
605 int loadProgram(const std::string &program);
606
607 /**
608 * @ingroup RuntimeMachine
609 * \chinese
610 * 预加载工程文件
611 *
612 * @param index 0~99 工程索引号
613 * @param program 工程名字
614 * @return
615 * \endchinese
616 * \english
617 * Preload project file
618 *
619 * @param index Project index number (0~99)
620 * @param program Project name
621 * @return
622 * \endenglish
623 */
624 int preloadProgram(int index, const std::string &program);
625
626 /**
627 * @ingroup RuntimeMachine
628 * \chinese
629 * 获取预加载工程文件名字,如果没有加载或者超出索引范围则返回空字符串
630 *
631 * @param index 0~99 工程索引号
632 * @return 工程文件名字
633 * \endchinese
634 * \english
635 * Get the name of the preloaded project file. Returns an empty string if
636 * not loaded or index is out of range.
637 *
638 * @param index Project index number (0~99)
639 * @return Project file name
640 * \endenglish
641 */
642 std::string getPreloadProgram(int index);
643
644 /**
645 * @ingroup RuntimeMachine
646 * \chinese
647 * 清除所有已预加载的工程文件
648 * 调用此方法将释放所有通过 preloadProgram
649 * 预加载的工程索引及其关联的工程名称
650 *
651 * @return 成功返回0;
652 * \endchinese
653 * \english
654 * Clear all preloaded project files.
655 * Calling this method will release all project indices and their associated
656 * program names that were previously preloaded via preloadProgram.
657 *
658 * @return Returns 0 on success;
659 * \endenglish
660 */
662
663 /**
664 * @ingroup RuntimeMachine
665 * \chinese
666 * 运行已经加载的工程文件
667 *
668 * @return
669 *
670 * @par JSON-RPC请求示例
671 * {"jsonrpc":"2.0","method":"RuntimeMachine.runProgram","params":[],"id":1}
672 *
673 * @par JSON-RPC响应示例
674 * {"id":1,"jsonrpc":"2.0","result":0}
675 *
676 * \endchinese
677 * \english
678 * Run the already loaded project file
679 *
680 * @return
681 *
682 * @par JSON-RPC Request Example
683 * {"jsonrpc":"2.0","method":"RuntimeMachine.runProgram","params":[],"id":1}
684 *
685 * @par JSON-RPC Response Example
686 * {"id":1,"jsonrpc":"2.0","result":0}
687 *
688 * \endenglish
689 */
691
692 /**
693 * @ingroup RuntimeMachine
694 * \chinese
695 * 开始运行时
696 *
697 * @return
698 *
699 * @par Python函数原型
700 * start(self: pyaubo_sdk.RuntimeMachine) -> int
701 *
702 * @par Lua函数原型
703 * start() -> number
704 *
705 * @par JSON-RPC请求示例
706 * {"jsonrpc":"2.0","method":"RuntimeMachine.start","params":[],"id":1}
707 *
708 * @par JSON-RPC响应示例
709 * {"id":1,"jsonrpc":"2.0","result":0}
710 *
711 * \endchinese
712 * \english
713 * Start the runtime
714 *
715 * @return
716 *
717 * @par Python function prototype
718 * start(self: pyaubo_sdk.RuntimeMachine) -> int
719 *
720 * @par Lua function prototype
721 * start() -> number
722 *
723 * @par JSON-RPC Request Example
724 * {"jsonrpc":"2.0","method":"RuntimeMachine.start","params":[],"id":1}
725 *
726 * @par JSON-RPC Response Example
727 * {"id":1,"jsonrpc":"2.0","result":0}
728 *
729 * \endenglish
730 */
731 int start();
732
733 /**
734 * @ingroup RuntimeMachine
735 * \chinese
736 * 停止运行时即脚本运行,无法停止运行时状态为 Stopped 时的机器人运动
737 *
738 * 如果考虑停止机器人所有运动,可以调用 RuntimeMachine::abort 接口
739 *
740 * @return
741 *
742 * @par Python函数原型
743 * stop(self: pyaubo_sdk.RuntimeMachine) -> int
744 *
745 * @par Lua函数原型
746 * stop() -> number
747 *
748 * @par JSON-RPC请求示例
749 * {"jsonrpc":"2.0","method":"RuntimeMachine.stop","params":[],"id":1}
750 *
751 * @par JSON-RPC响应示例
752 * {"id":1,"jsonrpc":"2.0","result":0}
753 *
754 * \endchinese
755 * \english
756 * Stop the runtime, i.e., stop script execution. Cannot stop robot motion
757 * when the runtime state is Stopped.
758 *
759 * If you want to stop all robot motion, use the RuntimeMachine::abort
760 * interface.
761 *
762 * @return
763 *
764 * @par Python function prototype
765 * stop(self: pyaubo_sdk.RuntimeMachine) -> int
766 *
767 * @par Lua function prototype
768 * stop() -> number
769 *
770 * @par JSON-RPC Request Example
771 * {"jsonrpc":"2.0","method":"RuntimeMachine.stop","params":[],"id":1}
772 *
773 * @par JSON-RPC Response Example
774 * {"id":1,"jsonrpc":"2.0","result":0}
775 *
776 * \endenglish
777 */
778 int stop();
779
780 /**
781 * @ingroup RuntimeMachine
782 * \chinese
783 * 终止机器人运行.
784 *
785 * 如果只是考虑停止运行时,可以调用 RuntimeMachine::stop 接口
786 *
787 * 如果脚本运行时处于 Running 状态,则终止运行时;如果运行时处于 Stopped
788 * 且机器人正在移动,则停止机器人移动;如果此时力控开启了,则机器人停止力控
789 *
790 * @return
791 *
792 * @par Python函数原型
793 * abort(self: pyaubo_sdk.RuntimeMachine) -> int
794 *
795 * @par Lua函数原型
796 * abort() -> number
797 *
798 * @par JSON-RPC请求示例
799 * {"jsonrpc":"2.0","method":"RuntimeMachine.abort","params":[],"id":1}
800 *
801 * @par JSON-RPC响应示例
802 * {"id":1,"jsonrpc":"2.0","result":0}
803 *
804 * \endchinese
805 * \english
806 * Abort robot operation.
807 *
808 * If you only want to stop the runtime, you can call the
809 * RuntimeMachine::stop interface.
810 *
811 * If the script runtime is in the Running state, aborts the runtime; if the
812 * runtime is Stopped and the robot is moving, stops the robot motion; if
813 * force control is enabled, stops force control.
814 *
815 * @return
816 *
817 * @par Python function prototype
818 * abort(self: pyaubo_sdk.RuntimeMachine) -> int
819 *
820 * @par Lua function prototype
821 * abort() -> number
822 *
823 * @par JSON-RPC Request Example
824 * {"jsonrpc":"2.0","method":"RuntimeMachine.abort","params":[],"id":1}
825 *
826 * @par JSON-RPC Response Example
827 * {"id":1,"jsonrpc":"2.0","result":0}
828 *
829 * \endenglish
830 */
831 int abort();
832
833 /**
834 * @ingroup RuntimeMachine
835 * \chinese
836 * 暂停解释器
837 *
838 * @return
839 *
840 * @par Python函数原型
841 * pause(self: pyaubo_sdk.RuntimeMachine) -> int
842 *
843 * @par Lua函数原型
844 * pause() -> number
845 *
846 * @par JSON-RPC请求示例
847 * {"jsonrpc":"2.0","method":"RuntimeMachine.pause","params":[],"id":1}
848 *
849 * @par JSON-RPC响应示例
850 * {"id":1,"jsonrpc":"2.0","result":0}
851 *
852 * \endchinese
853 * \english
854 * Pause the interpreter
855 *
856 * @return
857 *
858 * @par Python function prototype
859 * pause(self: pyaubo_sdk.RuntimeMachine) -> int
860 *
861 * @par Lua function prototype
862 * pause() -> number
863 *
864 * @par JSON-RPC Request Example
865 * {"jsonrpc":"2.0","method":"RuntimeMachine.pause","params":[],"id":1}
866 *
867 * @par JSON-RPC Response Example
868 * {"id":1,"jsonrpc":"2.0","result":0}
869 *
870 * \endenglish
871 */
872 int pause();
873
874 /**
875 * @ingroup RuntimeMachine
876 * \chinese
877 * 单步运行
878 *
879 * @return
880 *
881 * @par Python函数原型
882 * step(self: pyaubo_sdk.RuntimeMachine) -> int
883 *
884 * @par Lua函数原型
885 * step() -> number
886 *
887 * @par JSON-RPC请求示例
888 * {"jsonrpc":"2.0","method":"RuntimeMachine.step","params":[],"id":1}
889 *
890 * @par JSON-RPC响应示例
891 * {"id":1,"jsonrpc":"2.0","result":0}
892 *
893 * \endchinese
894 * \english
895 * Execute a single step
896 *
897 * @return
898 *
899 * @par Python function prototype
900 * step(self: pyaubo_sdk.RuntimeMachine) -> int
901 *
902 * @par Lua function prototype
903 * step() -> number
904 *
905 * @par JSON-RPC Request Example
906 * {"jsonrpc":"2.0","method":"RuntimeMachine.step","params":[],"id":1}
907 *
908 * @par JSON-RPC Response Example
909 * {"id":1,"jsonrpc":"2.0","result":0}
910 *
911 * \endenglish
912 */
913 int step();
914
915 /**
916 * @ingroup RuntimeMachine
917 * \chinese
918 * 恢复解释器
919 *
920 * @return
921 *
922 * @par Python函数原型
923 * resume(self: pyaubo_sdk.RuntimeMachine) -> int
924 *
925 * @par Lua函数原型
926 * resume() -> number
927 *
928 * @par JSON-RPC请求示例
929 * {"jsonrpc":"2.0","method":"RuntimeMachine.resume","params":[],"id":1}
930 *
931 * @par JSON-RPC响应示例
932 * {"id":1,"jsonrpc":"2.0","result":0}
933 *
934 * \endchinese
935 * \english
936 * Resume the interpreter
937 *
938 * @return
939 *
940 * @par Python function prototype
941 * resume(self: pyaubo_sdk.RuntimeMachine) -> int
942 *
943 * @par Lua function prototype
944 * resume() -> number
945 *
946 * @par JSON-RPC Request Example
947 * {"jsonrpc":"2.0","method":"RuntimeMachine.resume","params":[],"id":1}
948 *
949 * @par JSON-RPC Response Example
950 * {"id":1,"jsonrpc":"2.0","result":0}
951 *
952 * \endenglish
953 */
954 int resume();
955
956 /**
957 * @ingroup RuntimeMachine
958 * \chinese
959 * 恢复解释器(不检查当前点和暂停点距离)
960 *
961 * @return
962 *
963 * @par Python函数原型
964 * arbitraryResume(self: pyaubo_sdk.RuntimeMachine) -> int
965 *
966 * @par Lua函数原型
967 * arbitraryResume() -> number
968 *
969 * @par JSON-RPC请求示例
970 * {"jsonrpc":"2.0","method":"RuntimeMachine.arbitraryResume","params":[],"id":1}
971 *
972 * @par JSON-RPC响应示例
973 * {"id":1,"jsonrpc":"2.0","result":0}
974 *
975 * \endchinese
976 * \english
977 * Resume the interpreter
978 *
979 * @return
980 *
981 * @par Python function prototype
982 * arbitraryResume(self: pyaubo_sdk.RuntimeMachine) -> int
983 *
984 * @par Lua function prototype
985 * arbitraryResume() -> number
986 *
987 * @par JSON-RPC Request Example
988 * {"jsonrpc":"2.0","method":"RuntimeMachine.arbitraryResume","params":[],"id":1}
989 *
990 * @par JSON-RPC Response Example
991 * {"id":1,"jsonrpc":"2.0","result":0}
992 *
993 * \endenglish
994 */
996
997 /**
998 * @ingroup RuntimeMachine
999 * \chinese
1000 * 恢复解释器之前等待恢复前之前的序列完成
1001 *
1002 * @param wait
1003 * @return
1004 *
1005 * @par JSON-RPC请求示例
1006 * {"jsonrpc":"2.0","method":"RuntimeMachine.setResumeWait","params":[true],"id":1}
1007 *
1008 * @par JSON-RPC响应示例
1009 * {"id":1,"jsonrpc":"2.0","result":0}
1010 *
1011 * \endchinese
1012 * \english
1013 * Wait for the previous sequence to complete before resuming the
1014 * interpreter
1015 *
1016 * @param wait
1017 * @return
1018 *
1019 * @par JSON-RPC Request Example
1020 * {"jsonrpc":"2.0","method":"RuntimeMachine.setResumeWait","params":[true],"id":1}
1021 *
1022 * @par JSON-RPC Response Example
1023 * {"id":1,"jsonrpc":"2.0","result":0}
1024 *
1025 * \endenglish
1026 */
1027 int setResumeWait(bool wait);
1028
1029 /**
1030 * @ingroup RuntimeMachine
1031 * \chinese
1032 * 进入临界区,abort 命令会被推迟执行,避免临界区内的指令被打断
1033 *
1034 * @param timeout 单位秒,范围 0~5 秒,表示 abort
1035 * 命令最大推迟时间,超过这个时间自动退出临界区并 abort
1036 * @return
1037 *
1038 * @par Python函数原型
1039 * enterCritical(self: pyaubo_sdk.RuntimeMachine, arg0: double) -> int
1040 *
1041 * @par Lua函数原型
1042 * enterCritical(timeout: number) -> number
1043 *
1044 * @par JSON-RPC请求示例
1045 * {"jsonrpc":"2.0","method":"RuntimeMachine.enterCritical","params":[5.0],"id":1}
1046 *
1047 * @par JSON-RPC响应示例
1048 * {"id":1,"jsonrpc":"2.0","result":0}
1049 *
1050 * \endchinese
1051 * \english
1052 * The abort command is deferred during critical sections to avoid
1053 * interrupting internal instructions.
1054 *
1055 * @param timeout (seconds, 0~5): max deferral time for abort. Exceeding it
1056 * forces exit from critical section and triggers abort.
1057 * @return
1058 *
1059 * @par Python function prototype
1060 * enterCritical(self: pyaubo_sdk.RuntimeMachine, arg0: double) -> int
1061 *
1062 * @par Lua function prototype
1063 * enterCritical(timeout: number) -> number
1064 *
1065 * @par JSON-RPC Request Example
1066 * {"jsonrpc":"2.0","method":"RuntimeMachine.enterCritical","params":[5.0],"id":1}
1067 *
1068 * @par JSON-RPC Response Example
1069 * {"id":1,"jsonrpc":"2.0","result":0}
1070 *
1071 * \endenglish
1072 */
1073 int enterCritical(double timeout);
1074
1075 /**
1076 * @ingroup RuntimeMachine
1077 * \chinese
1078 * 退出临界区
1079 *
1080 * @param
1081 * @return
1082 *
1083 * @par Python函数原型
1084 * exitCritical(self: pyaubo_sdk.RuntimeMachine) -> int
1085 *
1086 * @par Lua函数原型
1087 * exitCritical() -> number
1088 *
1089 * @par JSON-RPC请求示例
1090 * {"jsonrpc":"2.0","method":"RuntimeMachine.exitCritical","params":[],"id":1}
1091 *
1092 * @par JSON-RPC响应示例
1093 * {"id":1,"jsonrpc":"2.0","result":0}
1094 *
1095 * \endchinese
1096 * \english
1097 * Exit the critical section
1098 *
1099 * @param
1100 * @return
1101 *
1102 * @par Python function prototype
1103 * exitCritical(self: pyaubo_sdk.RuntimeMachine) -> int
1104 *
1105 * @par Lua function prototype
1106 * exitCritical() -> number
1107 *
1108 * @par JSON-RPC Request Example
1109 * {"jsonrpc":"2.0","method":"RuntimeMachine.exitCritical","params":[],"id":1}
1110 *
1111 * @par JSON-RPC Response Example
1112 * {"id":1,"jsonrpc":"2.0","result":0}
1113 *
1114 * \endenglish
1115 */
1117
1118 /**
1119 * @ingroup RuntimeMachine
1120 * \chinese
1121 * 获取规划器的状态
1122 *
1123 * @return
1124 *
1125 * @par Python函数原型
1126 * getStatus(self: pyaubo_sdk.RuntimeMachine) ->
1127 * arcs::common_interface::RuntimeState
1128 *
1129 * @par Lua函数原型
1130 * getStatus() -> number
1131 *
1132 * @par JSON-RPC请求示例
1133 * {"jsonrpc":"2.0","method":"RuntimeMachine.getStatus","params":[],"id":1}
1134 *
1135 * @par JSON-RPC响应示例
1136 * {"id":1,"jsonrpc":"2.0","result":"Running"}
1137 *
1138 * \endchinese
1139 * \english
1140 * Get the status of the planner
1141 *
1142 * @return
1143 *
1144 * @par Python function prototype
1145 * getStatus(self: pyaubo_sdk.RuntimeMachine) ->
1146 * arcs::common_interface::RuntimeState
1147 *
1148 * @par Lua function prototype
1149 * getStatus() -> number
1150 *
1151 * @par JSON-RPC Request Example
1152 * {"jsonrpc":"2.0","method":"RuntimeMachine.getStatus","params":[],"id":1}
1153 *
1154 * @par JSON-RPC Response Example
1155 * {"id":1,"jsonrpc":"2.0","result":"Running"}
1156 *
1157 * \endenglish
1158 */
1159 ARCS_DEPRECATED RuntimeState getStatus();
1161
1162 /**
1163 * @ingroup RuntimeMachine
1164 * \chinese
1165 * 设置断点
1166 *
1167 * @param lineno
1168 * @return
1169 *
1170 * @par Python函数原型
1171 * setBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
1172 *
1173 * @par Lua函数原型
1174 * setBreakPoint(lineno: number) -> number
1175 *
1176 * @par JSON-RPC请求示例
1177 * {"jsonrpc":"2.0","method":"RuntimeMachine.setBreakPoint","params":[15],"id":1}
1178 *
1179 * @par JSON-RPC响应示例
1180 * {"id":1,"jsonrpc":"2.0","result":0}
1181 *
1182 * \endchinese
1183 * \english
1184 * Set a breakpoint
1185 *
1186 * @param lineno
1187 * @return
1188 *
1189 * @par Python function prototype
1190 * setBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
1191 *
1192 * @par Lua function prototype
1193 * setBreakPoint(lineno: number) -> number
1194 *
1195 * @par JSON-RPC Request Example
1196 * {"jsonrpc":"2.0","method":"RuntimeMachine.setBreakPoint","params":[15],"id":1}
1197 *
1198 * @par JSON-RPC Response Example
1199 * {"id":1,"jsonrpc":"2.0","result":0}
1200 *
1201 * \endenglish
1202 */
1203 int setBreakPoint(int lineno);
1204
1205 /**
1206 * @ingroup RuntimeMachine
1207 * \chinese
1208 * 移除断点
1209 *
1210 * @param lineno
1211 * @return
1212 *
1213 * @par Python函数原型
1214 * removeBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
1215 *
1216 * @par Lua函数原型
1217 * removeBreakPoint(lineno: number) -> number
1218 *
1219 * @par JSON-RPC请求示例
1220 * {"jsonrpc":"2.0","method":"RuntimeMachine.removeBreakPoint","params":[15],"id":1}
1221 *
1222 * @par JSON-RPC响应示例
1223 * {"id":1,"jsonrpc":"2.0","result":0}
1224 *
1225 * \endchinese
1226 * \english
1227 * Remove a breakpoint
1228 *
1229 * @param lineno
1230 * @return
1231 *
1232 * @par Python function prototype
1233 * removeBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
1234 *
1235 * @par Lua function prototype
1236 * removeBreakPoint(lineno: number) -> number
1237 *
1238 * @par JSON-RPC Request Example
1239 * {"jsonrpc":"2.0","method":"RuntimeMachine.removeBreakPoint","params":[15],"id":1}
1240 *
1241 * @par JSON-RPC Response Example
1242 * {"id":1,"jsonrpc":"2.0","result":0}
1243 *
1244 * \endenglish
1245 */
1246 int removeBreakPoint(int lineno);
1247
1248 /**
1249 * @ingroup RuntimeMachine
1250 * \chinese
1251 * 清除所有断点
1252 *
1253 * @return
1254 *
1255 * @par Python函数原型
1256 * clearBreakPoints(self: pyaubo_sdk.RuntimeMachine) -> int
1257 *
1258 * @par Lua函数原型
1259 * clearBreakPoints() -> number
1260 *
1261 * @par JSON-RPC请求示例
1262 * {"jsonrpc":"2.0","method":"RuntimeMachine.clearBreakPoints","params":[],"id":1}
1263 *
1264 * @par JSON-RPC响应示例
1265 * {"id":1,"jsonrpc":"2.0","result":0}
1266 *
1267 * \endchinese
1268 * \english
1269 * Clear all breakpoints
1270 *
1271 * @return
1272 *
1273 * @par Python function prototype
1274 * clearBreakPoints(self: pyaubo_sdk.RuntimeMachine) -> int
1275 *
1276 * @par Lua function prototype
1277 * clearBreakPoints() -> number
1278 *
1279 * @par JSON-RPC Request Example
1280 * {"jsonrpc":"2.0","method":"RuntimeMachine.clearBreakPoints","params":[],"id":1}
1281 *
1282 * @par JSON-RPC Response Example
1283 * {"id":1,"jsonrpc":"2.0","result":0}
1284 *
1285 * \endenglish
1286 */
1288
1289 /**
1290 * @ingroup RuntimeMachine
1291 * \chinese
1292 * 定时器开始
1293 *
1294 * @param name
1295 * @return
1296 *
1297 * @par Python函数原型
1298 * timerStart(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
1299 *
1300 * @par Lua函数原型
1301 * timerStart(name: string) -> nil
1302 *
1303 * @par JSON-RPC请求示例
1304 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStart","params":["timer"],"id":1}
1305 *
1306 * @par JSON-RPC响应示例
1307 * {"id":1,"jsonrpc":"2.0","result":0}
1308 *
1309 * \endchinese
1310 * \english
1311 * Start the timer
1312 *
1313 * @param name
1314 * @return
1315 *
1316 * @par Python function prototype
1317 * timerStart(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
1318 *
1319 * @par Lua function prototype
1320 * timerStart(name: string) -> nil
1321 *
1322 * @par JSON-RPC Request Example
1323 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStart","params":["timer"],"id":1}
1324 *
1325 * @par JSON-RPC Response Example
1326 * {"id":1,"jsonrpc":"2.0","result":0}
1327 *
1328 * \endenglish
1329 */
1330 int timerStart(const std::string &name);
1331
1332 /**
1333 * @ingroup RuntimeMachine
1334 * \chinese
1335 * 定时器结束
1336 *
1337 * @param name
1338 * @return
1339 *
1340 * @par Python函数原型
1341 * timerStop(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
1342 *
1343 * @par Lua函数原型
1344 * timerStop(name: string) -> nil
1345 *
1346 * @par JSON-RPC请求示例
1347 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStop","params":["timer"],"id":1}
1348 *
1349 * @par JSON-RPC响应示例
1350 * {"id":1,"jsonrpc":"2.0","result":0}
1351 *
1352 * \endchinese
1353 * \english
1354 * Stop the timer
1355 *
1356 * @param name
1357 * @return
1358 *
1359 * @par Python function prototype
1360 * timerStop(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
1361 *
1362 * @par Lua function prototype
1363 * timerStop(name: string) -> nil
1364 *
1365 * @par JSON-RPC Request Example
1366 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStop","params":["timer"],"id":1}
1367 *
1368 * @par JSON-RPC Response Example
1369 * {"id":1,"jsonrpc":"2.0","result":0}
1370 *
1371 * \endenglish
1372 */
1373 int timerStop(const std::string &name);
1374
1375 /**
1376 * @ingroup RuntimeMachine
1377 * \chinese
1378 * 定时器重置
1379 *
1380 * @param name
1381 * @return
1382 *
1383 * @par Python函数原型
1384 * timerReset(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
1385 *
1386 * @par Lua函数原型
1387 * timerReset(name: string) -> nil
1388 *
1389 * @par JSON-RPC请求示例
1390 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerReset","params":["timer"],"id":1}
1391 *
1392 * @par JSON-RPC响应示例
1393 * {"id":1,"jsonrpc":"2.0","result":0}
1394 *
1395 * \endchinese
1396 * \english
1397 * Reset the timer
1398 *
1399 * @param name
1400 * @return
1401 *
1402 * @par Python function prototype
1403 * timerReset(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
1404 *
1405 * @par Lua function prototype
1406 * timerReset(name: string) -> nil
1407 *
1408 * @par JSON-RPC Request Example
1409 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerReset","params":["timer"],"id":1}
1410 *
1411 * @par JSON-RPC Response Example
1412 * {"id":1,"jsonrpc":"2.0","result":0}
1413 *
1414 * \endenglish
1415 */
1416 int timerReset(const std::string &name);
1417
1418 /**
1419 * @ingroup RuntimeMachine
1420 * \chinese
1421 * 定时器删除
1422 *
1423 * @param name
1424 * @return
1425 *
1426 * @par Python函数原型
1427 * timerDelete(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
1428 *
1429 * @par Lua函数原型
1430 * timerDelete(name: string) -> nil
1431 *
1432 * @par JSON-RPC请求示例
1433 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerDelete","params":["timer"],"id":1}
1434 *
1435 * @par JSON-RPC响应示例
1436 * {"id":1,"jsonrpc":"2.0","result":0}
1437 *
1438 * \endchinese
1439 * \english
1440 * Delete the timer
1441 *
1442 * @param name
1443 * @return
1444 *
1445 * @par Python function prototype
1446 * timerDelete(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
1447 *
1448 * @par Lua function prototype
1449 * timerDelete(name: string) -> nil
1450 *
1451 * @par JSON-RPC Request Example
1452 * {"jsonrpc":"2.0","method":"RuntimeMachine.timerDelete","params":["timer"],"id":1}
1453 *
1454 * @par JSON-RPC Response Example
1455 * {"id":1,"jsonrpc":"2.0","result":0}
1456 *
1457 * \endenglish
1458 */
1459 int timerDelete(const std::string &name);
1460
1461 /**
1462 * @ingroup RuntimeMachine
1463 * \chinese
1464 * 获取定时器数值
1465 *
1466 * @param name
1467 * @return
1468 *
1469 * @par Python函数原型
1470 * getTimer(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> float
1471 *
1472 * @par Lua函数原型
1473 * getTimer(name: string) -> number
1474 *
1475 * @par JSON-RPC请求示例
1476 * {"jsonrpc":"2.0","method":"RuntimeMachine.getTimer","params":["timer"],"id":1}
1477 *
1478 * @par JSON-RPC响应示例
1479 * {"id":1,"jsonrpc":"2.0","result":25.409769612}
1480 *
1481 * \endchinese
1482 * \english
1483 * Get the timer value
1484 *
1485 * @param name
1486 * @return
1487 *
1488 * @par Python function prototype
1489 * getTimer(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> float
1490 *
1491 * @par Lua function prototype
1492 * getTimer(name: string) -> number
1493 *
1494 * @par JSON-RPC Request Example
1495 * {"jsonrpc":"2.0","method":"RuntimeMachine.getTimer","params":["timer"],"id":1}
1496 *
1497 * @par JSON-RPC Response Example
1498 * {"id":1,"jsonrpc":"2.0","result":25.409769612}
1499 *
1500 * \endenglish
1501 */
1502 double getTimer(const std::string &name);
1503
1504 /**
1505 * @ingroup RuntimeMachine
1506 * \chinese
1507 * 开始配置触发
1508 *
1509 * @param distance
1510 * @param delay
1511 * @return
1512 *
1513 * @par JSON-RPC请求示例
1514 * {"jsonrpc":"2.0","method":"RuntimeMachine.triggBegin","params":[],"id":1}
1515 *
1516 * @par JSON-RPC响应示例
1517 * {"id":1,"jsonrpc":"2.0","result":0}
1518 *
1519 * \endchinese
1520 * \english
1521 * Start configuring trigger
1522 *
1523 * @param distance
1524 * @param delay
1525 * @return
1526 *
1527 * @par JSON-RPC Request Example
1528 * {"jsonrpc":"2.0","method":"RuntimeMachine.triggBegin","params":[],"id":1}
1529 *
1530 * @par JSON-RPC Response Example
1531 * {"id":1,"jsonrpc":"2.0","result":0}
1532 *
1533 * \endenglish
1534 */
1535 int triggBegin(double distance, double delay);
1536
1537 /**
1538 * @ingroup RuntimeMachine
1539 * \chinese
1540 * 终止配置触发
1541 *
1542 * @return
1543 *
1544 * @par JSON-RPC请求示例
1545 * {"jsonrpc":"2.0","method":"RuntimeMachine.triggEnd","params":[],"id":1}
1546 *
1547 * @par JSON-RPC响应示例
1548 * {"id":1,"jsonrpc":"2.0","result":0}
1549 *
1550 * \endchinese
1551 * \english
1552 * End configuring trigger
1553 *
1554 * @return
1555 *
1556 * @par JSON-RPC Request Example
1557 * {"jsonrpc":"2.0","method":"RuntimeMachine.triggEnd","params":[],"id":1}
1558 *
1559 * @par JSON-RPC Response Example
1560 * {"id":1,"jsonrpc":"2.0","result":0}
1561 *
1562 * \endenglish
1563 */
1565
1566 /**
1567 * @ingroup RuntimeMachine
1568 * \chinese
1569 * 返回自动分配的中断号
1570 *
1571 * @param distance
1572 * @param delay
1573 * @param intnum
1574 * @return
1575 * \endchinese
1576 * \english
1577 * Returns the automatically assigned interrupt number
1578 *
1579 * @param distance
1580 * @param delay
1581 * @param intnum
1582 * @return
1583 * \endenglish
1584 */
1585 int triggInterrupt(double distance, double delay);
1586
1587 /**
1588 * @ingroup RuntimeMachine
1589 * \chinese
1590 * 获取所有的中断号列表
1591 *
1592 * @return
1593 *
1594 * @par JSON-RPC请求示例
1595 * {"jsonrpc":"2.0","method":"RuntimeMachine.getTriggInterrupts","params":[],"id":1}
1596 *
1597 * @par JSON-RPC响应示例
1598 * {"id":1,"jsonrpc":"2.0","result":[]}
1599 *
1600 * \endchinese
1601 * \english
1602 * Get the list of all interrupt numbers
1603 *
1604 * @return
1605 *
1606 * @par JSON-RPC Request Example
1607 * {"jsonrpc":"2.0","method":"RuntimeMachine.getTriggInterrupts","params":[],"id":1}
1608 *
1609 * @par JSON-RPC Response Example
1610 * {"id":1,"jsonrpc":"2.0","result":[]}
1611 *
1612 * \endenglish
1613 */
1614 std::vector<int> getTriggInterrupts();
1615
1616protected:
1617 void *d_;
1618};
1619
1620using RuntimeMachinePtr = std::shared_ptr<RuntimeMachine>;
1621
1622} // namespace common_interface
1623} // namespace arcs
1624#endif // AUBO_SDK_RUNTIME_MACHINE_H
std::tuple< std::string, std::string, int > getExecutionStatus1()
int exitCritical()
Exit the critical section
int enterCritical(double timeout)
The abort command is deferred during critical sections to avoid interrupting internal instructions.
int arbitraryResume()
Resume the interpreter
int timerStop(const std::string &name)
Stop the timer
int preloadProgram(int index, const std::string &program)
Preload project file
double getTimer(const std::string &name)
Get the timer value
int switchTask(int tid)
Switch the current thread.
std::tuple< int, int, std::string > getPlanContext(int tid=-1)
Get the current runtime context
int resume()
Resume the interpreter
int abort()
Abort robot operation.
std::string getPreloadProgram(int index)
Get the name of the preloaded project file.
int gotoLine(int lineno)
Jump to the specified line number
int detachTask(int tid)
Wait for the task to finish naturally
int runProgram()
Run the already loaded project file
int timerReset(const std::string &name)
Reset the timer
std::tuple< int, int, std::string > getAdvancePlanContext(int tid=-1)
Get the context information of the advance planner
ARCS_DEPRECATED int setPlanContext(int tid, int lineno, const std::string &comment)
Add a comment to the aubo_control log Use setLabel instead
int triggBegin(double distance, double delay)
Start configuring trigger
int getAdvancePtr(int tid=-1)
Get the program pointer of AdvanceRun
int triggEnd()
End configuring trigger
int removeBreakPoint(int lineno)
Remove a breakpoint
int clearBreakPoints()
Clear all breakpoints
int setBreakPoint(int lineno)
Set a breakpoint
int setResumeWait(bool wait)
Wait for the previous sequence to complete before resuming the interpreter
int loadProgram(const std::string &program)
Load a local project file.
ARCS_DEPRECATED RuntimeState getStatus()
Get the status of the planner
int getInterpPtr(int tid)
Get the pointer of the most recently interpreted instruction
int clearPreloadPrograms()
Clear all preloaded project files.
int getTaskQueueSize(int tid)
Get the number of cached instructions in the task
std::vector< int > getTriggInterrupts()
Get the list of all interrupt numbers
int deleteTask(int tid)
Delete a task, which will terminate any ongoing motion.
int newTask(bool daemon=false)
Returns the task_id
int triggInterrupt(double distance, double delay)
Returns the automatically assigned interrupt number
int timerDelete(const std::string &name)
Delete the timer
int getMainPtr(int tid=-1)
Get the program pointer of robot motion
int pause()
Pause the interpreter
int step()
Execute a single step
int timerStart(const std::string &name)
Start the timer
std::tuple< std::string, std::string > getExecutionStatus()
Get the execution status of time-consuming interfaces (INST), such as setPersistentParameters
bool isTaskAlive(int tid)
Check if the task is alive
int setLabel(int lineno, const std::string &comment)
Mark the line number and comment of the recorded instruction
int stop()
Stop the runtime, i.e., stop script execution.
std::shared_ptr< RuntimeMachine > RuntimeMachinePtr
enum type definitions