AUBO SDK  0.26.0
Loading...
Searching...
No Matches
arcs::common_interface::RuntimeMachine Class Reference

The RuntimeMachine class. More...

#include <runtime_machine.h>

Public Member Functions

 RuntimeMachine ()
virtual ~RuntimeMachine ()
int newTask (bool daemon=false)
 Returns the task_id
int deleteTask (int tid)
 Delete a task, which will terminate any ongoing motion.
int detachTask (int tid)
 Wait for the task to finish naturally
bool isTaskAlive (int tid)
 Check if the task is alive
int getTaskQueueSize (int tid)
 Get the number of cached instructions in the task
int switchTask (int tid)
 Switch the current thread.
int setLabel (int lineno, const std::string &comment)
 Mark the line number and comment of the recorded instruction
ARCS_DEPRECATED int setPlanContext (int tid, int lineno, const std::string &comment)
 Add a comment to the aubo_control log Use setLabel instead
int nop ()
 No operation
std::tuple< std::string, std::string > getExecutionStatus ()
 Get the execution status of time-consuming interfaces (INST), such as setPersistentParameters
std::tuple< std::string, std::string, int > getExecutionStatus1 ()
int gotoLine (int lineno)
 Jump to the specified line number
std::tuple< int, int, std::string > getPlanContext (int tid=-1)
 Get the current runtime context
std::tuple< int, int, std::string > getAdvancePlanContext (int tid=-1)
 Get the context information of the advance planner
int getAdvancePtr (int tid=-1)
 Get the program pointer of AdvanceRun
int getMainPtr (int tid=-1)
 Get the program pointer of robot motion
int getInterpPtr (int tid)
 Get the pointer of the most recently interpreted instruction
int loadProgram (const std::string &program)
 Load a local project file.
int preloadProgram (int index, const std::string &program)
 Preload project file
std::string getPreloadProgram (int index)
 Get the name of the preloaded project file.
int clearPreloadPrograms ()
 Clear all preloaded project files.
int runProgram ()
 Run the already loaded project file
int start ()
 Start the runtime
int stop ()
 Stop the runtime, i.e., stop script execution.
int abort ()
 Abort robot operation.
int pause ()
 Pause the interpreter
int step ()
 Execute a single step
int resume ()
 Resume the interpreter
int arbitraryResume ()
 Resume the interpreter
int setResumeWait (bool wait)
 Wait for the previous sequence to complete before resuming the interpreter
int enterCritical (double timeout)
 The abort command is deferred during critical sections to avoid interrupting internal instructions.
int exitCritical ()
 Exit the critical section
ARCS_DEPRECATED RuntimeState getStatus ()
 Get the status of the planner
RuntimeState getRuntimeState ()
int setBreakPoint (int lineno)
 Set a breakpoint
int removeBreakPoint (int lineno)
 Remove a breakpoint
int clearBreakPoints ()
 Clear all breakpoints
int timerStart (const std::string &name)
 Start the timer
int timerStop (const std::string &name)
 Stop the timer
int timerReset (const std::string &name)
 Reset the timer
int timerDelete (const std::string &name)
 Delete the timer
double getTimer (const std::string &name)
 Get the timer value
int triggBegin (double distance, double delay)
 Start configuring trigger
int triggEnd ()
 End configuring trigger
int triggInterrupt (double distance, double delay)
 Returns the automatically assigned interrupt number
std::vector< int > getTriggInterrupts ()
 Get the list of all interrupt numbers

Protected Attributes

void * d_

Detailed Description

The RuntimeMachine class.

Definition at line 18 of file runtime_machine.h.

Constructor & Destructor Documentation

◆ RuntimeMachine()

arcs::common_interface::RuntimeMachine::RuntimeMachine ( )

◆ ~RuntimeMachine()

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

Member Function Documentation

◆ abort()

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

Abort robot operation.

If you only want to stop the runtime, you can call the RuntimeMachine::stop interface.

If the script runtime is in the Running state, aborts the runtime; if the runtime is Stopped and the robot is moving, stops the robot motion; if force control is enabled, stops force control.

Returns
Python function prototype
abort(self: pyaubo_sdk.RuntimeMachine) -> int
Lua function prototype
abort() -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.abort","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ arbitraryResume()

int arcs::common_interface::RuntimeMachine::arbitraryResume ( )

Resume the interpreter

Returns
Python function prototype
arbitraryResume(self: pyaubo_sdk.RuntimeMachine) -> int
Lua function prototype
arbitraryResume() -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.arbitraryResume","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ clearBreakPoints()

int arcs::common_interface::RuntimeMachine::clearBreakPoints ( )

Clear all breakpoints

Returns
Python function prototype
clearBreakPoints(self: pyaubo_sdk.RuntimeMachine) -> int
Lua function prototype
clearBreakPoints() -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.clearBreakPoints","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ clearPreloadPrograms()

int arcs::common_interface::RuntimeMachine::clearPreloadPrograms ( )

Clear all preloaded project files.

Calling this method will release all project indices and their associated program names that were previously preloaded via preloadProgram.

Returns
Returns 0 on success;

◆ deleteTask()

int arcs::common_interface::RuntimeMachine::deleteTask ( int tid)

Delete a task, which will terminate any ongoing motion.

JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.deleteTask","params":[26],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ detachTask()

int arcs::common_interface::RuntimeMachine::detachTask ( int tid)

Wait for the task to finish naturally

Parameters
tid
Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.detachTask","params":[26],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ enterCritical()

int arcs::common_interface::RuntimeMachine::enterCritical ( double timeout)

The abort command is deferred during critical sections to avoid interrupting internal instructions.

Parameters
timeout(seconds, 0~5): max deferral time for abort. Exceeding it forces exit from critical section and triggers abort.
Returns
Python function prototype
enterCritical(self: pyaubo_sdk.RuntimeMachine, arg0: double) -> int
Lua function prototype
enterCritical(timeout: number) -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.enterCritical","params":[5.0],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ exitCritical()

int arcs::common_interface::RuntimeMachine::exitCritical ( )

Exit the critical section

Parameters

return

Python function prototype
exitCritical(self: pyaubo_sdk.RuntimeMachine) -> int
Lua function prototype
exitCritical() -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.exitCritical","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ getAdvancePlanContext()

std::tuple< int, int, std::string > arcs::common_interface::RuntimeMachine::getAdvancePlanContext ( int tid = -1)

Get the context information of the advance planner

Parameters
tidTask ID If specified (not -1), returns the context information of the advance planner for the corresponding task; if not specified (is -1), returns the context information of the advance planner for the currently running thread
Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePlanContext","params":[-1],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":[-1,-1,""]}

◆ getAdvancePtr()

int arcs::common_interface::RuntimeMachine::getAdvancePtr ( int tid = -1)

Get the program pointer of AdvanceRun

Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePtr","params":[-1],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":-1}

◆ getExecutionStatus()

std::tuple< std::string, std::string > arcs::common_interface::RuntimeMachine::getExecutionStatus ( )

Get the execution status of time-consuming interfaces (INST), such as setPersistentParameters

Returns
Instruction name, execution status Execution status: EXECUTING/FINISHED
Python function prototype
getExecutionStatus(self: pyaubo_sdk.RuntimeMachine) -> Tuple[str, str, int]
Lua function prototype
getExecutionStatus() -> string, string, number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.getExecutionStatus","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":["confirmSafetyParameters","FINISHED"]}

◆ getExecutionStatus1()

std::tuple< std::string, std::string, int > arcs::common_interface::RuntimeMachine::getExecutionStatus1 ( )

◆ getInterpPtr()

int arcs::common_interface::RuntimeMachine::getInterpPtr ( int tid)

Get the pointer of the most recently interpreted instruction

Parameters
tid
Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.getInterpPtr","params":[26],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":-1}

◆ getMainPtr()

int arcs::common_interface::RuntimeMachine::getMainPtr ( int tid = -1)

Get the program pointer of robot motion

Parameters
tidTask ID If specified (not -1), returns the program pointer of the corresponding task; if not specified (is -1), returns the program pointer of the currently running thread
Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.getMainPtr","params":[-1],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":-1}

◆ getPlanContext()

std::tuple< int, int, std::string > arcs::common_interface::RuntimeMachine::getPlanContext ( int tid = -1)

Get the current runtime context

Parameters
tidTask ID If specified (not -1), returns the runtime context of the corresponding task; if not specified (is -1), returns the runtime context of the currently running thread
Returns
Python function prototype
getPlanContext(self: pyaubo_sdk.RuntimeMachine) -> Tuple[int, int, str]
Lua function prototype
getPlanContext() -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.getPlanContext","params":[-1],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":[-1,0,""]}

◆ getPreloadProgram()

std::string arcs::common_interface::RuntimeMachine::getPreloadProgram ( int index)

Get the name of the preloaded project file.

Returns an empty string if not loaded or index is out of range.

Parameters
indexProject index number (0~99)
Returns
Project file name

◆ getRuntimeState()

RuntimeState arcs::common_interface::RuntimeMachine::getRuntimeState ( )

◆ getStatus()

ARCS_DEPRECATED RuntimeState arcs::common_interface::RuntimeMachine::getStatus ( )

Get the status of the planner

Returns
Python function prototype
getStatus(self: pyaubo_sdk.RuntimeMachine) -> arcs::common_interface::RuntimeState
Lua function prototype
getStatus() -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.getStatus","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":"Running"}

◆ getTaskQueueSize()

int arcs::common_interface::RuntimeMachine::getTaskQueueSize ( int tid)

Get the number of cached instructions in the task

Parameters
tid
Returns

◆ getTimer()

double arcs::common_interface::RuntimeMachine::getTimer ( const std::string & name)

Get the timer value

Parameters
name
Returns
Python function prototype
getTimer(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> float
Lua function prototype
getTimer(name: string) -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.getTimer","params":["timer"],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":25.409769612}

◆ getTriggInterrupts()

std::vector< int > arcs::common_interface::RuntimeMachine::getTriggInterrupts ( )

Get the list of all interrupt numbers

Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.getTriggInterrupts","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":[]}

◆ gotoLine()

int arcs::common_interface::RuntimeMachine::gotoLine ( int lineno)

Jump to the specified line number

Parameters
lineno
Returns
Python function prototype
gotoLine(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
Lua function prototype
gotoLine(lineno: number) -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.gotoLine","params":[10],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ isTaskAlive()

bool arcs::common_interface::RuntimeMachine::isTaskAlive ( int tid)

Check if the task is alive

Parameters
tid
Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.isTaskAlive","params":[26],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":true}

◆ loadProgram()

int arcs::common_interface::RuntimeMachine::loadProgram ( const std::string & program)

Load a local project file.

For Lua scripts, only the file name is required (no extension), and it will be searched in the ${ARCS_WS}/program directory.

Parameters
program
Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.loadProgram","params":["demo"],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ newTask()

int arcs::common_interface::RuntimeMachine::newTask ( bool daemon = false)

Returns the task_id

JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.newTask","params":[false],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":26}

◆ nop()

int arcs::common_interface::RuntimeMachine::nop ( )

No operation

Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.nop","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ pause()

int arcs::common_interface::RuntimeMachine::pause ( )

Pause the interpreter

Returns
Python function prototype
pause(self: pyaubo_sdk.RuntimeMachine) -> int
Lua function prototype
pause() -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.pause","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ preloadProgram()

int arcs::common_interface::RuntimeMachine::preloadProgram ( int index,
const std::string & program )

Preload project file

Parameters
indexProject index number (0~99)
programProject name
Returns

◆ removeBreakPoint()

int arcs::common_interface::RuntimeMachine::removeBreakPoint ( int lineno)

Remove a breakpoint

Parameters
lineno
Returns
Python function prototype
removeBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
Lua function prototype
removeBreakPoint(lineno: number) -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.removeBreakPoint","params":[15],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ resume()

int arcs::common_interface::RuntimeMachine::resume ( )

Resume the interpreter

Returns
Python function prototype
resume(self: pyaubo_sdk.RuntimeMachine) -> int
Lua function prototype
resume() -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.resume","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ runProgram()

int arcs::common_interface::RuntimeMachine::runProgram ( )

Run the already loaded project file

Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.runProgram","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ setBreakPoint()

int arcs::common_interface::RuntimeMachine::setBreakPoint ( int lineno)

Set a breakpoint

Parameters
lineno
Returns
Python function prototype
setBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int
Lua function prototype
setBreakPoint(lineno: number) -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.setBreakPoint","params":[15],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ setLabel()

int arcs::common_interface::RuntimeMachine::setLabel ( int lineno,
const std::string & comment )

Mark the line number and comment of the recorded instruction

Parameters
lineno
comment
Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.setLabel","params":[5,"moveJoint"],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ setPlanContext()

ARCS_DEPRECATED int arcs::common_interface::RuntimeMachine::setPlanContext ( int tid,
int lineno,
const std::string & comment )

Add a comment to the aubo_control log Use setLabel instead

Parameters
tidThread ID of the instruction
linenoLine number
commentComment
Returns
Python function prototype
setPlanContext(self: pyaubo_sdk.RuntimeMachine, arg0: int, arg1: int, arg2: str) -> int
Lua function prototype
setPlanContext(tid: number, lineno: number, comment: string) -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.setPlanContext","params":[26,3,"moveJoint"],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ setResumeWait()

int arcs::common_interface::RuntimeMachine::setResumeWait ( bool wait)

Wait for the previous sequence to complete before resuming the interpreter

Parameters
wait
Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.setResumeWait","params":[true],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ start()

int arcs::common_interface::RuntimeMachine::start ( )

Start the runtime

Returns
Python function prototype
start(self: pyaubo_sdk.RuntimeMachine) -> int
Lua function prototype
start() -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.start","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ step()

int arcs::common_interface::RuntimeMachine::step ( )

Execute a single step

Returns
Python function prototype
step(self: pyaubo_sdk.RuntimeMachine) -> int
Lua function prototype
step() -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.step","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ stop()

int arcs::common_interface::RuntimeMachine::stop ( )

Stop the runtime, i.e., stop script execution.

Cannot stop robot motion when the runtime state is Stopped.

If you want to stop all robot motion, use the RuntimeMachine::abort interface.

Returns
Python function prototype
stop(self: pyaubo_sdk.RuntimeMachine) -> int
Lua function prototype
stop() -> number
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.stop","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ switchTask()

int arcs::common_interface::RuntimeMachine::switchTask ( int tid)

Switch the current thread.

After switching, subsequent instructions will be inserted into the switched thread.

Parameters
tid
Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.switchTask","params":[26],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ timerDelete()

int arcs::common_interface::RuntimeMachine::timerDelete ( const std::string & name)

Delete the timer

Parameters
name
Returns
Python function prototype
timerDelete(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
Lua function prototype
timerDelete(name: string) -> nil
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.timerDelete","params":["timer"],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ timerReset()

int arcs::common_interface::RuntimeMachine::timerReset ( const std::string & name)

Reset the timer

Parameters
name
Returns
Python function prototype
timerReset(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
Lua function prototype
timerReset(name: string) -> nil
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.timerReset","params":["timer"],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ timerStart()

int arcs::common_interface::RuntimeMachine::timerStart ( const std::string & name)

Start the timer

Parameters
name
Returns
Python function prototype
timerStart(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
Lua function prototype
timerStart(name: string) -> nil
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.timerStart","params":["timer"],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ timerStop()

int arcs::common_interface::RuntimeMachine::timerStop ( const std::string & name)

Stop the timer

Parameters
name
Returns
Python function prototype
timerStop(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int
Lua function prototype
timerStop(name: string) -> nil
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.timerStop","params":["timer"],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ triggBegin()

int arcs::common_interface::RuntimeMachine::triggBegin ( double distance,
double delay )

Start configuring trigger

Parameters
distance
delay
Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.triggBegin","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ triggEnd()

int arcs::common_interface::RuntimeMachine::triggEnd ( )

End configuring trigger

Returns
JSON-RPC Request Example
{"jsonrpc":"2.0","method":"RuntimeMachine.triggEnd","params":[],"id":1}
JSON-RPC Response Example
{"id":1,"jsonrpc":"2.0","result":0}

◆ triggInterrupt()

int arcs::common_interface::RuntimeMachine::triggInterrupt ( double distance,
double delay )

Returns the automatically assigned interrupt number

Parameters
distance
delay
intnum
Returns

Member Data Documentation

◆ d_

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

Definition at line 1572 of file runtime_machine.h.


The documentation for this class was generated from the following file: