🛰️ Interactive Monte Carlo Localization

A robot wanders a known landmark map, sensing only noisy ranges to nearby beacons. A cloud of particles — hypothesis poses — starts spread over the whole map (global localization, no initial pose) and collapses onto the truth as measurements arrive. Hit Kidnap robot to teleport it and watch the belief re-spread and re-converge — the reason a nonparametric particle filter beats a single Gaussian. Runs live in your browser (no libraries). From sensor-fusion-lab.

Controls

★landmarks (known map)
particles (belief), brighter = heavier
true robot & range rings
weighted-mean estimate
Starting…

How it works. Each step: (1) motion update — push every particle through the noisy unicycle model; (2) measurement update — weight each particle by how well its predicted ranges match the sensor (Gaussian likelihood); (3) resample — low-variance/systematic resampling keeps heavy particles and drops light ones, with a small roughening floor so the cloud never fully depletes; (4) estimate — the weighted mean pose. Honest caveats: a single range fixes only a ring of possible positions, so range-only belief is genuinely multimodal early on — you'll see several particle clumps before they resolve. More particles = better coverage of a kidnap but linearly more compute. On a real kidnapping the filter can't know it was moved; here Reset/Kidnap re-seed the cloud map-wide (equivalent to random particle injection) so the recovery is visible every time. Synthetic demo — no real robot or data.