A motion queue with program counter, used by Motion and Odometry.
More...
|
| 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...
|
|
|
integer[QUEUE] | Qid = { 0,0,0,0 } |
| [out] task id
|
|
integer[QUEUE] | Qtime = { 0,0,0,0 } |
| [out] remaining time
|
|
integer[QUEUE] | QspL = { 0,0,0,0 } |
| [out] motor speed L
|
|
integer[QUEUE] | QspR = { 0,0,0,0 } |
| [out] motor speed R
|
|
integer[1] | Qpc = {0} |
| [out] program counter
|
|
integer[1] | Qnx = {0} |
| [out] next pc
|
|
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.
motion_add |
( |
integer |
Qid, |
|
|
integer |
Qtime, |
|
|
integer |
QspL, |
|
|
integer |
QspR |
|
) |
| |
|
inlineprivate |
Subroutine to add a task to the queue.
- Parameters
-
Qid | task id |
Qtime | time in 100ths |
QspL | left motor speed |
QspR | right motor speed |
motion_cancel |
( |
integer |
Qid | ) |
|
|
inlineprivate |
Subroutine to cancel a task from the queue.
- Parameters
-