ARCS SDK API  0.24.0
Public 成员函数 | Protected 属性 | 所有成员列表
arcs::common_interface::RuntimeMachine类 参考

The RuntimeMachine class. 更多...

#include <runtime_machine.h>

Public 成员函数

 RuntimeMachine ()
 
virtual ~RuntimeMachine ()
 
int newTask (bool daemon=false)
 返回 task_id 更多...
 
int deleteTask (int tid)
 删除 task,会终止正在执行的运动 更多...
 
int detachTask (int tid)
 等待 task 自然结束 更多...
 
bool isTaskAlive (int tid)
 判断任务是否存活 更多...
 
int switchTask (int tid)
 切换当前线程,切换之后接下来的指令将被插入切换后的线程中 更多...
 
int setLabel (int lineno, const std::string &comment)
 标记记下来的指令的行号和注释 更多...
 
ARCS_DEPRECATED int setPlanContext (int tid, int lineno, const std::string &comment)
 向aubo_control日志中添加注释 使用 setLabel 替换 更多...
 
int nop ()
 空操作 更多...
 
std::tuple< std::string, std::string > getExecutionStatus ()
 获取耗时的接口(INST)执行状态, 如 setPersistentParameters 更多...
 
std::tuple< std::string, std::string, int > getExecutionStatus1 ()
 
int gotoLine (int lineno)
 跳转到指定行号 更多...
 
std::tuple< int, int, std::string > getPlanContext (int tid=-1)
 获取当前运行上下文 更多...
 
std::tuple< int, int, std::string > getAdvancePlanContext (int tid=-1)
 获取提前运行规划器的上下文信息 更多...
 
int getAdvancePtr (int tid=-1)
 获取AdvanceRun的程序指针 更多...
 
int getMainPtr (int tid=-1)
 获取机器人运动的程序指针 更多...
 
int getInterpPtr (int tid)
 获取最近解释过的指令指针 更多...
 
int loadProgram (const std::string &program)
 加载本地工程文件 Lua 脚本,只需要给出文件名字,不需要后缀,需要从 ${ARCS_WS}/program 目录中查找 更多...
 
int runProgram ()
 运行已经加载的工程文件 更多...
 
int start ()
 开始运行时 更多...
 
int stop ()
 停止运行时即脚本运行,无法停止运行时状态为 Stopped 时的机器人运动 更多...
 
int abort ()
 终止机器人运行. 更多...
 
int pause ()
 暂停解释器 更多...
 
int step ()
 单步运行 更多...
 
int resume ()
 恢复解释器 更多...
 
int setResumeWait (bool wait)
 恢复解释器之前等待恢复前之前的序列完成 更多...
 
ARCS_DEPRECATED RuntimeState getStatus ()
 获取规划器的状态 更多...
 
RuntimeState getRuntimeState ()
 
int setBreakPoint (int lineno)
 设置断点 更多...
 
int removeBreakPoint (int lineno)
 移除断点 更多...
 
int clearBreakPoints ()
 清除所有断点 更多...
 
int timerStart (const std::string &name)
 定时器开始 更多...
 
int timerStop (const std::string &name)
 定时器结束 更多...
 
int timerReset (const std::string &name)
 定时器重置 更多...
 
int timerDelete (const std::string &name)
 定时器删除 更多...
 
double getTimer (const std::string &name)
 获取定时器数值 更多...
 
int triggBegin (double distance, double delay)
 开始配置触发 更多...
 
int triggEnd ()
 终止配置触发 更多...
 
int triggInterrupt (double distance, double delay)
 返回自动分配的中断号 更多...
 
std::vector< int > getTriggInterrupts ()
 获取所有的中断号列表 更多...
 

Protected 属性

void * d_
 

详细描述

The RuntimeMachine class.

在文件 runtime_machine.h18 行定义.

构造及析构函数说明

arcs::common_interface::RuntimeMachine::RuntimeMachine ( )
virtual arcs::common_interface::RuntimeMachine::~RuntimeMachine ( )
virtual

成员函数说明

int arcs::common_interface::RuntimeMachine::abort ( )

终止机器人运行.

如果只是考虑停止运行时,可以调用 RuntimeMachine::stop 接口

如果脚本运行时处于 Running 状态,则终止运行时;如果运行时处于 Stopped 且机器人正在移动,则停止机器人移动;如果此时力控开启了,则机器人停止力控

返回
Python函数原型
abort(self: pyaubo_sdk.RuntimeMachine) -> int
Lua函数原型
abort() -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.abort","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::clearBreakPoints ( )

清除所有断点

返回
Python函数原型
clearBreakPoints(self: pyaubo_sdk.RuntimeMachine) -> int
Lua函数原型
clearBreakPoints() -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.clearBreakPoints","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::deleteTask ( int  tid)

删除 task,会终止正在执行的运动

JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.deleteTask","params":[26],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::detachTask ( int  tid)

等待 task 自然结束

参数
tid
返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.detachTask","params":[26],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
std::tuple<int, int, std::string> arcs::common_interface::RuntimeMachine::getAdvancePlanContext ( int  tid = -1)

获取提前运行规划器的上下文信息

参数
tid任务编号 如果指定(不是-1),返回对应任务运行规划器的上下文信息;如果不指定(是-1),返回正在运行的线程运行规划器的上下文信息
返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePlanContext","params":[-1],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":[-1,-1,""]}
int arcs::common_interface::RuntimeMachine::getAdvancePtr ( int  tid = -1)

获取AdvanceRun的程序指针

返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePtr","params":[-1],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":-1}
std::tuple<std::string, std::string> arcs::common_interface::RuntimeMachine::getExecutionStatus ( )

获取耗时的接口(INST)执行状态, 如 setPersistentParameters

返回
指令名字, 执行状态 执行状态: EXECUTING/FINISHED
Python函数原型
getExecutionStatus(self: pyaubo_sdk.RuntimeMachine) -> Tuple[str, str, int]
Lua函数原型
getExecutionStatus() -> string, string, number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.getExecutionStatus","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":["confirmSafetyParameters","FINISHED"]}
std::tuple<std::string, std::string, int> arcs::common_interface::RuntimeMachine::getExecutionStatus1 ( )
int arcs::common_interface::RuntimeMachine::getInterpPtr ( int  tid)

获取最近解释过的指令指针

参数
tid
返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.getInterpPtr","params":[26],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":-1}
int arcs::common_interface::RuntimeMachine::getMainPtr ( int  tid = -1)

获取机器人运动的程序指针

参数
tid任务编号 如果指定(不是-1),返回对应任务的程序指针;如果不指定(是-1),返回正在运行线程的程序指针
返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.getMainPtr","params":[-1],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":-1}
std::tuple<int, int, std::string> arcs::common_interface::RuntimeMachine::getPlanContext ( int  tid = -1)

获取当前运行上下文

参数
tid任务编号 如果指定(不是-1),返回对应任务的运行上下文;如果不指定(是-1),返回正在运行的线程的运行上下文
返回
Python函数原型
getPlanContext(self: pyaubo_sdk.RuntimeMachine) -> Tuple[int, int, str]
Lua函数原型
getPlanContext() -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.getPlanContext","params":[-1],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":[-1,0,""]}
RuntimeState arcs::common_interface::RuntimeMachine::getRuntimeState ( )
ARCS_DEPRECATED RuntimeState arcs::common_interface::RuntimeMachine::getStatus ( )

获取规划器的状态

返回
Python函数原型
getStatus(self: pyaubo_sdk.RuntimeMachine) -> arcs::common_interface::RuntimeState
Lua函数原型
getStatus() -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.getStatus","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":"Running"}
double arcs::common_interface::RuntimeMachine::getTimer ( const std::string &  name)

获取定时器数值

参数
name
返回
Python函数原型
getTimer(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> float
Lua函数原型
getTimer(name: string) -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.getTimer","params":["timer"],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":25.409769612}
std::vector<int> arcs::common_interface::RuntimeMachine::getTriggInterrupts ( )

获取所有的中断号列表

返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.getTriggInterrupts","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":[]}
int arcs::common_interface::RuntimeMachine::gotoLine ( int  lineno)

跳转到指定行号

参数
lineno
返回
Python函数原型
gotoLine(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
Lua函数原型
gotoLine(lineno: number) -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.gotoLine","params":[10],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
bool arcs::common_interface::RuntimeMachine::isTaskAlive ( int  tid)

判断任务是否存活

参数
tid
返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.isTaskAlive","params":[26],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":true}
int arcs::common_interface::RuntimeMachine::loadProgram ( const std::string &  program)

加载本地工程文件 Lua 脚本,只需要给出文件名字,不需要后缀,需要从 ${ARCS_WS}/program 目录中查找

参数
program
返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.loadProgram","params":["demo"],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::newTask ( bool  daemon = false)

返回 task_id

JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.newTask","params":[false],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":26}
int arcs::common_interface::RuntimeMachine::nop ( )

空操作

返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.nop","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::pause ( )

暂停解释器

返回
Python函数原型
pause(self: pyaubo_sdk.RuntimeMachine) -> int
Lua函数原型
pause() -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.pause","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::removeBreakPoint ( int  lineno)

移除断点

参数
lineno
返回
Python函数原型
removeBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
Lua函数原型
removeBreakPoint(lineno: number) -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.removeBreakPoint","params":[15],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::resume ( )

恢复解释器

返回
Python函数原型
resume(self: pyaubo_sdk.RuntimeMachine) -> int
Lua函数原型
resume() -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.resume","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::runProgram ( )

运行已经加载的工程文件

返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.runProgram","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::setBreakPoint ( int  lineno)

设置断点

参数
lineno
返回
Python函数原型
setBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
Lua函数原型
setBreakPoint(lineno: number) -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.setBreakPoint","params":[15],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::setLabel ( int  lineno,
const std::string &  comment 
)

标记记下来的指令的行号和注释

参数
lineno
comment
返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.setLabel","params":[5,"moveJoint"],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
ARCS_DEPRECATED int arcs::common_interface::RuntimeMachine::setPlanContext ( int  tid,
int  lineno,
const std::string &  comment 
)

向aubo_control日志中添加注释 使用 setLabel 替换

参数
tid指令的线程ID
lineno行号
comment注释
返回
Python函数原型
setPlanContext(self: pyaubo_sdk.RuntimeMachine, arg0: int, arg1: int, arg2: str) -> int
Lua函数原型
setPlanContext(tid: number, lineno: number, comment: string) -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.setPlanContext","params":[26,3,"moveJoint"],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::setResumeWait ( bool  wait)

恢复解释器之前等待恢复前之前的序列完成

参数
wait
返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.setResumeWait","params":[true],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::start ( )

开始运行时

返回
Python函数原型
start(self: pyaubo_sdk.RuntimeMachine) -> int
Lua函数原型
start() -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.start","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::step ( )

单步运行

返回
Python函数原型
step(self: pyaubo_sdk.RuntimeMachine) -> int
Lua函数原型
step() -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.step","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::stop ( )

停止运行时即脚本运行,无法停止运行时状态为 Stopped 时的机器人运动

如果考虑停止机器人所有运动,可以调用 RuntimeMachine::abort 接口

返回
Python函数原型
stop(self: pyaubo_sdk.RuntimeMachine) -> int
Lua函数原型
stop() -> number
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.stop","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::switchTask ( int  tid)

切换当前线程,切换之后接下来的指令将被插入切换后的线程中

参数
tid
返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.switchTask","params":[26],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::timerDelete ( const std::string &  name)

定时器删除

参数
name
返回
Python函数原型
timerDelete(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
Lua函数原型
timerDelete(name: string) -> nil
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.timerDelete","params":["timer"],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::timerReset ( const std::string &  name)

定时器重置

参数
name
返回
Python函数原型
timerReset(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
Lua函数原型
timerReset(name: string) -> nil
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.timerReset","params":["timer"],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::timerStart ( const std::string &  name)

定时器开始

参数
name
返回
Python函数原型
timerStart(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
Lua函数原型
timerStart(name: string) -> nil
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.timerStart","params":["timer"],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::timerStop ( const std::string &  name)

定时器结束

参数
name
返回
Python函数原型
timerStop(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
Lua函数原型
timerStop(name: string) -> nil
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.timerStop","params":["timer"],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::triggBegin ( double  distance,
double  delay 
)

开始配置触发

参数
distance
delay
返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.triggBegin","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::triggEnd ( )

终止配置触发

返回
JSON-RPC请求示例
{"jsonrpc":"2.0","method":"RuntimeMachine.triggEnd","params":[],"id":1}
JSON-RPC响应示例
{"id":1,"jsonrpc":"2.0","result":0}
int arcs::common_interface::RuntimeMachine::triggInterrupt ( double  distance,
double  delay 
)

返回自动分配的中断号

参数
distance
delay
intnum
返回

类成员变量说明

void* arcs::common_interface::RuntimeMachine::d_
protected

在文件 runtime_machine.h696 行定义.


该类的文档由以下文件生成: