A generic robot vacuum maps a flat with lidar, plans a snake-like cleaning path, avoids obstacles and watches its battery.
Educational model with generic parameters. Not a product guide and not affiliated with any robot brand. A floor plan of a home is personal data: here it never leaves your browser.
Each strategy cleans the same empty room with the same robot; the table shows time, coverage, repeated area and energy.
The science
Differential drive. Wheel speeds vL, vR with wheel base L = 0.23 m give v = (vR+vL)/2, ω = (vR−vL)/L, ẋ = v cosθ, ẏ = v sinθ, θ̇ = ω, integrated with semi-implicit Euler at 60 Hz and wheel acceleration limited to 0.5 m/s². A steady turn has radius R = (L/2)(vR+vL)/(vR−vL).
Lidar and occupancy grid. 90 rays (4° step, 6 m range, 1 cm noise) are traced through a 5 cm grid by a DDA walk. Each crossed cell gets l ← l − 0.4 (free) and the hit cell l ← l + 0.85 (occupied) in log-odds l = ln(p/(1−p)); the robot treats l > 1 as occupied and l < −1 as free. Pose is taken as known (no SLAM drift): this is mapping, not full SLAM. A hidden floor cable is not visible to the lidar, which is why the robot can get stuck on it once.
Frontier exploration. The nearest reachable free cell next to unknown cells is visited until no frontier remains.
Coverage planning. Boustrophedon: parallel lanes with spacing 0.95·wc (wc = 0.30 m effective cleaning width including side brushes, an assumption), the number of lanes follows N = ⌈(W − 2r)/(0.95 wc)⌉ + 1; lane parts interrupted by obstacles are separate runs joined by A* (8-connected, octile heuristic, obstacles inflated by the robot radius 0.165 m, string-pulling smoothing). Spiral follows concentric contours inward. Random bounce needs no map. Cell-decomposition (Morse / trapezoidal) would reduce detours around furniture and is not implemented.
Dust removal. A cell under the cleaning head loses dust as d ← d·exp(−κ ηs (Psuction/25 W) Δt) with κ = 4 s⁻¹ and ηs = 1 on parquet, 0.6 on the rug (model values). Initial dust is 0.5 g/m² plus three 3 g/m² stains.
Energy. P = 5 W + m g Crr v / ηd + Psuction (+4 W mop pump) with m = 3.5 kg, Crr = 0.02 (parquet) or 0.05 (rug), ηd = 0.6; battery 75 Wh (about 5.2 Ah at 14.4 V). The robot returns when charge < 20 % or when it could not reach the dock; charging is shown as a ×20 time-lapse. Mopping uses 3 mL/m² from a 200 mL tank.
Simplifications. 2-D motion, no wheel slip, no real airflow, no sensor drift, simple bumper model (1.5 cm travel), constants are typical round numbers. Real products differ. Models built with Blender, scene by Three.js. Source types: Siegwart et al. "Introduction to Autonomous Mobile Robots", Thrun et al. "Probabilistic Robotics", Choset (coverage path planning survey).