Skip to main content

dummy.rs — Development Simulator

The simulator generates realistic fake rover data so the UI can be developed and tested without physical hardware. It is started via the start_dummy_streams or start_dummy_imu_stream commands and stopped with stop_dummy_streams.

Stream table

Each stream has an independent send interval and a generator function that produces time-varying data:

Stream

Interval

Notes

IMU

20ms (50Hz)

Sinusoidal accelerometer, gyro, magnetometer

GPS

200ms

Slow position drift around a fixed coordinate (52.2297°N, 6.8978°E)

pH

500ms

pH value oscillating around 7.0

Arm control signals

50ms

Simulated joint control inputs

Arm diagnostics

500ms

6 motors with dummy RPM/voltage

Arm feedback

100ms

Occasionally simulates an obstruction error

Arm positions

50ms

All joint angles oscillating

Arm target

200ms

Target XYZ + jaw state

Arm obstructions

300ms


Drive diagnostics

500ms

6 drive + 4 steering motors

Drive motor

50ms

Distance to go, turning radius

Drive progress

100ms

Countdown from 10m

Sensor board diagnostics

500ms

Composite board health snapshot

Network simulation

The simulator can optionally apply jitter (random delay up to jitter_ms) and packet loss (random drop with probability packet_loss) to simulate real wireless conditions. The full simulator uses 30ms jitter and 2% packet loss; the IMU-only simulator uses no jitter or loss.

Record / Replay mode

The simulator supports recording a session to a binary file and replaying it later. Packets are written as [4-byte little-endian length][protobuf bytes]. Replay sends packets from the file at a fixed 20ms pace. This is useful for reproducing specific scenarios during UI development.

To use replay mode: set record_path in SimulatorConfig during a live or simulated session, then use replay_path in a subsequent run.