Aesl Program
Functions | Variables
Queue

A motion queue with program counter, used by Motion and Odometry. More...

Functions

 motor ()
 
 motion_add (integer Qid, integer Qtime, integer QspL, integer QspR)
 Subroutine to add a task to the queue. More...
 
 motion_cancel (integer Qid)
 Subroutine to cancel a task from the queue. More...
 

Variables

integer[QUEUEQid = { 0,0,0,0 }
 [out] task id
 
integer[QUEUEQtime = { 0,0,0,0 }
 [out] remaining time
 
integer[QUEUEQspL = { 0,0,0,0 }
 [out] motor speed L
 
integer[QUEUEQspR = { 0,0,0,0 }
 [out] motor speed R
 
integer[1] Qpc = {0}
 [out] program counter
 
integer[1] Qnx = {0}
 [out] next pc
 

Detailed Description

A motion queue with program counter, used by Motion and Odometry.

Every 100 Hz tick from motion event, run the motion queue and update the odometry. If the motion task at Qpc is active, turn the motors at the speeds QspL and QspR and decrement the Qtime count. Otherwise, look for a next task to perform. The active task is the Qid entry whose value is negative. The button LEDs show the values of Qpc qnd Qnx. The subroutines motion_add and motion cancel are called from the Q_* events in Motion.

Function Documentation

motion_add ( integer  Qid,
integer  Qtime,
integer  QspL,
integer  QspR 
)
inlineprivate

Subroutine to add a task to the queue.

Parameters
Qidtask id
Qtimetime in 100ths
QspLleft motor speed
QspRright motor speed
motion_cancel ( integer  Qid)
inlineprivate

Subroutine to cancel a task from the queue.

Parameters
Qidtask id