Files
MultiRoombaRover/outline.md
T
2025-11-07 00:34:41 -05:00

111 lines
3.6 KiB
Markdown

# notes and ideas
the multi-roombarover.
control multiple roombas through a web UI. On each roomba is an esp32 and an IP camera.
telepresence style. low latency, even sometimes over consistency.
# STARTING OUT
command the roomba directly from the web UI
web UI (socket.io) -> server
server (rover link websocket) -> esp32 on the roomba
- esp32 websocket firmware
- the esp32 will connect to the roomba's OI
- the esp32 will connect to wifi
- the esp32 will connect to the websocket server
- the esp32 will listen for drive and mode commands from the server
- the esp32 will tell the roomba to start a stream of all sensors
- the esp32 will pulse the roombas BRC pin for 1 second every minute to keep it awake
- on each loop in the firmware
- run commands on the roomba from what websocket is telling the rover to do (this NEEDS to be unblockable, high priority, and very low latency from web UI keypress to roomba moving)
- decode ONE full set of sensors from the stream and sends it to the server over websockets
- simple server for testing
- rover link websocket server
- express web server
- with socket.io for communicating with web clients
- the web client socket.io server and the rover link websocket server are COMPLETELY SEPERATE, even put the rover websocket server on a different port just to make sure
- follow the module structure outlined below
- simple web client for testing
- plain html for now. minimal css.
- buttons in web client to start out with
- start OI
- safe mode
- full mode
- seek dock
- start sensor stream
- stop sensor stream
## esp32 firmware
defined in platformio.ini:
rover's name
server's IP address
wifi connection info
enable / disable for each motor
- main brush
- side brush
- vacuum
camera IP address
battery info (for different battery behaviors):
- full number (2068)
- warn number (1700)
- urgent number (1650)
esp32-s3 firmware, platformio
UART hooked up to the roomba's OI port
one more GPIO on the roomba's BRC pin
- pulsing low for one second every minute to keep the roomba awake
## esp-server comms
the ESP will report to the server when it connects:
rover's name
enable / disable for each motor
- main brush
- side brush
- vacuum
camera IP address
battery info (for different battery behaviors):
- full number (2068)
- warn number (1700)
- urgent number (1650)
the ESP will poll the roomba for ALL sensors, decode them, and send them to the server, which will forward it to clients over socket.io
## server
nodejs server, ES6 imports and exports
one entrypoint file, the only thing in this file should be a bunch of imports for our "modules", imported in the right order
modules should NOT be intertwined within the entrypoint file
all of the modules will import what they need from the other modules
all of the modules will export what they need other modules to know
create global express, websocket, and socket.io instances for all of the modules to share. modules will add their own listeners / senders
## frontend
javascript is ES6, same module style as the server.
UI is made in HTML with CDN tailwind. NO BUNDLERS.
each frontend module will have a JSON state update over socket.io
each module will export a function to update it's state
use these functions to update all modules on connect, from a UI init state event.
this event will be sent all of the module data at once, in JSON
split each JSON element to the UI element functions
one single system for loading and saving user settings to cookies / browser storage
the UI:
- WASD rover movement controls
- buttons to enable OI, enter safe mode, full mode, and seek dock