FixTheRobot Explore Robotics / Probability for Robotics / M9 / M9-L1

This lab works on phones, but writing code is much easier on a laptop.

Probability for Robotics · Particle Filters and Monte Carlo Localization · M9-L1 · Advanced

Monte Carlo Localization

Bench log · Rover in the teaching lab

11:30. Rover is carried into a room with four beacons and switched on. It has no idea where it is. A first particle filter localised it on the bench, but in the room it collapses onto the wrong corner, and when a technician lifts it and puts it down at the other side, it never finds itself again.

You will find the settings that keep the filter healthy, write the weighting and the resampling that make it work, and add the one idea that rescues it from a kidnapping: a few random particles whenever the readings stop making sense.

Your task

    Simulation
    solution.pyLoading Python…
    Ctrl+Enter runs
    What Python can I use?

    Plain Python with math and the course library robotprob (for example from robotprob import Rng, mean, gaussian_pdf). NumPy is not available in the browser. Your code runs in a background worker: an endless loop is stopped after a few seconds and the page stays usable. It runs in your browser and is never sent anywhere.

    Hints

    What this lab teaches

    Stage 1 is about two numbers: the number of particles, and the sensor noise the filter assumes. Too sharp a model collapses the effective sample size; too few particles may never start near the truth. Stage 2 implements the weights from four independent range readings: likelihoods multiply. Stage 3 implements low-variance resampling, whose pointers may skip several light particles. Stage 4 builds the whole filter with augmented MCL: a slow and a fast average of the particle likelihood detect that the belief is wrong and inject random particles.

    Grading is exact for the weights and the resampling counts, and behavioural for the filter: the localisation error before and after the kidnapping on hidden runs.

    Theory for this lab

    Particle Filters and Monte Carlo Localization labs

    1. M9-L1: Monte Carlo Localization: this lab.

    Educational simplification: a 10 m by 8 m room with four beacons at known places, ranges with Gaussian noise, a known step with small noise, and a position-only state. Real MCL localises a full pose from a laser scan against a map.

    Get the next lab

    Get notified when new robotics labs are released. One email per new lab, nothing else.