Concepts
How long a command lives
A command to drive is good for half a second. Nothing has to be pressed for a bot to stop: if the commands stop coming, it stops. This page puts the timings from every part in one place, what wins when two commands disagree, and what each part does when another goes quiet. The rules themselves are in the protocol reference, and every way a bot stops is on Safety.
The timings
| Who sends | To | How often | The other side goes quiet for | Then |
|---|---|---|---|---|
| A client driving by hand (a driving page, the driving tool) | the station | at least every 250 ms; the driving tool and the lab’s page send every 100 ms | 500 ms | The station sends the bot a stop itself (its dead-man) |
| 1 s | The client no longer holds the bot: another may take it | |||
| The station | the bot | every 100 ms while it’s driven, each command numbered | 500 ms | The bot stops itself and says timeout_stop (rule 2) |
| A go-to | the station | once | doesn’t apply: the station steers it from the bot’s position | It ends on its own: there, no position for 2 s (lost), not there after 30 s (timeout), or held back for 3 s (blocked) |
| The position service (the overhead camera, or the simulator) | the station, during a go-to | as it sees the bot; the simulator 10 times a second | 0.5 s | The bot holds still until a fresh position comes |
A restarted station numbers its commands from 0 again. That’s fine: a restart takes longer than 500 ms, so the bot has stopped first, and after a stop it takes any number (rule 5).
What wins
- A hand beats a go-to. The client holding the bot driving it by hand cancels its go-to. So do a
stopor areleasefrom the holder. - The e-stop beats everything. While anyone’s e-stop is on, a bot ignores every command, and the station refuses drive requests for it. After the last one is cleared, the bot waits for a fresh command: it doesn’t carry on with an old one.
- A go-to doesn’t wait for the hand that sent it. It’s sent once, and the station drives it from there. Closing the page that sent it doesn’t stop it.
When a part goes quiet
| What goes quiet | Driving by hand | On a go-to |
|---|---|---|
| The page or the driving tool (closed, asleep, off the network) | The station stops the bot within 500 ms | It carries on to its end |
| The station | The bot stops itself within 500 ms of its last command | The same: the station sent its commands too |
| The broker | The bot stops itself within 500 ms | The same |
| The bot’s Wi-Fi | The bot stops itself within 500 ms, and tries to reconnect | The same; the go-to ends offline |
| The bot’s own firmware (a loop that hangs) | The bot restarts after 15 s, and its motor drivers sleep while it does (gl_zero from gl-zero-0.7.0; its watchdog starts once Wi-Fi is up and is off during an over-the-air update, firmware) | The same |
How it’s checked
- In the simulator, on every merge request: the scenario The driver goes quiet drives a bot by hand for a second, then stops sending. It passes only if the bot stops within 0.6 s of its driver’s last command.
- In the firmware’s tests: the bot stops and says
timeout_stop500 ms after its last command. - On a real bot: A real bot on the bench has you stop the station while the wheels turn, and watch them stop.