5#ifndef AUBO_SDK_RUNTIME_MACHINE_INTERFACE_H
6#define AUBO_SDK_RUNTIME_MACHINE_INTERFACE_H
9#include <aubo/global_config.h>
13namespace common_interface {
107 int setLabel(
int lineno,
const std::string &comment);
133 const std::string &comment);
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)
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)
获取当前运行上下文
virtual ~RuntimeMachine()
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 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
RuntimeState getRuntimeState()
bool isTaskAlive(int tid)
判断任务是否存活
int setLabel(int lineno, const std::string &comment)
标记记下来的指令的行号和注释
int stop()
停止运行时即脚本运行,无法停止运行时状态为 Stopped 时的机器人运动
std::shared_ptr< RuntimeMachine > RuntimeMachinePtr