How arsenialiakseichyk/robot-web-controller works
This is a Raspberry Pi rover controller: a browser connects to the C server, joins as a viewer or PIN-authenticated pilot, and sends driving input that reaches motor control while ultrasonic sensing can block unsafe motion. The same UI exposes camera and system settings, and camera video is delivered to the browser through a documented WebRTC/WHEP pipeline. The graph combines excerpts, SOURCE INDEX references, and README-described capabilities; some subsystem links rely on README documentation because their implementation was not excerpted.
Main entry points: controller.c Motion controller · app.js UI coordinator · main.c Startup and config · routes.c REST settings
Components 24
Runtime and server
- Startup and config
main.c - Environment config
utils/config.c - HTTP server
server/server.c - REST settings
server/routes.c - WS sessions
server/websocket.c - WHEP proxy
server/whep.c - System commands
utils/shell.c
Robot hardware
- Motion controller
hardware/controller.c - Motor stepping
hardware/motors.c - GPIO access
hardware/gpio.c - Ultrasonic safety
hardware/sensors.c - LED status
hardware/leds.c - Tilt receiver
hardware/rpi_tilt_recv.c
Browser interface
- UI coordinator
web/js/app.js - WS connection
web/js/connection.js - Drive controls
web/js/controls.js - Camera UI
web/js/camera.js - System settings UI
web/js/system.js - Tilt UI
web/js/tilt.js - Shared UI state
web/js/state.js
Video delivery
- Camera lifecycle
hardware/camera.c - Camera and encoder
- MediaMTX
Other components
- Viewer / pilot
Connections 35
- Viewer / pilot → UI coordinator: uses
README.md - Startup and config → Environment config: loads
main.c - Startup and config → Motion controller: initializes
main.c - Startup and config → Camera lifecycle: initializes
main.c - Startup and config → HTTP server: starts
main.c - Startup and config → WS sessions: bridges status
main.c - HTTP server → REST settings: routes HTTP
README.md - HTTP server → WS sessions: serves WS
README.md - HTTP server → WHEP proxy: proxies WHEP
README.md - REST settings → Camera lifecycle: updates config
server/routes.c - REST settings → Environment config: persists settings
server/routes.c - REST settings → Motion controller: reads GPIO info
server/routes.c - REST settings → System commands: runs commands
server/routes.c - WS sessions → Motion controller: dispatches drive
README.md - Motion controller → GPIO access: initializes GPIO
hardware/controller.c - Motion controller → Tilt receiver: starts receiver
hardware/controller.c - Motion controller → Motor stepping: drives motors
README.md - Motion controller → Ultrasonic safety: uses safety sensing
README.md - Motion controller → LED status: updates indicators
README.md - Ultrasonic safety → Motor stepping: blocks unsafe motion
README.md - Camera lifecycle → Camera and encoder: starts capture pipeline
README.md - Camera and encoder → MediaMTX: streams RTSP
README.md - MediaMTX → WHEP proxy: serves WebRTC
README.md - WHEP proxy → Viewer / pilot: delivers video
README.md - UI coordinator → WS connection: initializes
web/js/app.js - UI coordinator → Drive controls: initializes
web/js/app.js - UI coordinator → Camera UI: initializes
web/js/app.js - UI coordinator → System settings UI: initializes
web/js/app.js - UI coordinator → Tilt UI: initializes
web/js/app.js - UI coordinator → Shared UI state: reads state
web/js/app.js - Drive controls → WS connection: sends commands
web/js/controls.js - Camera UI → Shared UI state: reads state
web/js/camera.js - System settings UI → WS connection: reconnects via
web/js/system.js - System settings UI → Shared UI state: reads state
web/js/system.js - Tilt UI → Shared UI state: updates state
web/js/tilt.js