listener.rs — Incoming Packet Handler
run_listener() is the main receive loop. It runs for the lifetime of the app as a spawned async task. On every received UDP datagram it:
- Decodes the raw bytes as a
PbEnvelopeusing prost - Extracts the inner payload variant
- Checks a per-payload throttle — events are forwarded to the frontend at most once every 100ms per payload type, regardless of how fast the rover sends
- Emits a Tauri event to the frontend with the decoded message as the payload
Throttling
Each payload type has its own independent Throttle instance. This prevents high-frequency streams (e.g. IMU at 50Hz) from flooding the frontend with more updates than it can usefully render.
Tauri events emitted
These are the event names the frontend can listen to with listen():
Event name | Payload type | Typical source |
|
| IMU sensor |
|
| GPS sensor |
|
| pH sensor |
|
| Arm controller |
|
| Arm board |
|
| Arm movement |
|
| Arm position |
|
| Arm target |
|
| Arm safety |
|
| Drive board |
|
| Drive motors |
|
| Drive progress |
|
| Sensor board |
|
| Rover control mode |
|
| Mission system |
|
| Vision system |
|
| Vision system |
|
| Load cell (rock weight) |
|
| Pressure sensor |
|
| Science task |
|
| Science task |
|
| Navigation |
|
| GStreamer health watcher |