FixTheRobot Explore Robotics / Linear Algebra / M9 / M9-L1

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

Linear Algebra · Covariance and State Estimation · M9-L1 · Advanced

Robot Localization with Uncertainty

Robot scenario

Scout has to know where it is, and it knows only a rough guess and a few noisy distances to beacons on the walls. A good estimate is not a single point: it is a point and an ellipse that says how far off it might be.

You will place beacons to shape that ellipse, find out why a filter that trusts its sensor too much stops listening, and then write the Kalman update and a full localiser that rejects a bad range, graded on scenarios you have not seen.

Your task

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

    Plain Python with math and lakit (import lakit as la: vectors, matmul, solve, qr, svd, eigh, lstsq, pinv and more; 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 hands-on: two draggable beacons and the information matrix Σ h hᵀ/σ² make the geometry of observation visible as an ellipse. Stage 2 is the diagnosis: an overconfident noise model shows up as a large normalised innovation squared. Stage 3 is the first fix you write: fuse is the Kalman update with the Joseph covariance. Stage 4 uses it in localize: sequential linearised range updates with a chi-square gate.

    Grading is result-based. Your functions run on the example and on freshly generated hidden scenarios with correlated priors and a reflected range, and are compared with exact results to 10⁻⁶ (positions to 10⁻⁵). The covariance must also be symmetric positive definite.

    You can use plain Python, math, and the small linear algebra library lakit (import lakit as la): la.matmul, la.inv, la.madd, la.transpose, la.matvec and more. It runs in your browser; NumPy is not available there.

    Theory for this lab

    Covariance and State Estimation labs

    1. M9-L1: Robot Localization with Uncertainty: this lab.

    Educational simplification: a static 2D position, Gaussian range noise of a known size, known beacon positions and the linearised range model. Real localisers add motion, heading and data association around exactly these updates.

    Get the next lab

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