Autonomous Robot Vacuum

Interactive WebAssembly statechart demo powered by lavi-wasm

An autonomous vacuum sweeping a living room floor. Try this: click Spot Clean then Bump Furniture to watch it dodge an obstacle and resume Spot Clean via History (H), or click Low Battery (14%) to see an always guard route it home to dock.

Living Room Floor Sweep up the crumbs!
Click anywhere on the floor:
State moving.cleaning.patrol
Battery 85%
Wheels Driving Forward
Vacuum Suction Standard
Side Brushes Spinning
Try Triggering an Event
Why statecharts shine here: While in Patrol, the robot sweeps the room. Because Moving wraps all driving modes with a single exit: stopAllMotors rule, pausing or hitting the stairs is guaranteed to shut off the wheels and vacuum.
Statechart
Click any highlighted transition arrow or internal event in the diagram to trigger it.