FixTheRobot Explore Robotics / Localization & SLAM / M3 / M3-L2

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

Localization & SLAM · Mapping and State Estimation · M3-L2 · Intermediate

Fix a Misaligned Map

Two robots, or one robot on two days, mapped the same hall. Their maps agree on what is there but not on where: overlay them and every landmark has a little arrow pointing to its twin.

Before you correct anything, the arrows tell you what kind of error you have. Then you estimate the correction, and make it work when some of the matches are simply wrong.

Your task

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

    Plain Python with math and, for matrices, slamkit (matmul, transpose, solve, inverse, identity). The data arrive as the dictionary D. There is no NumPy, random, json or copy in the browser runtime. Your code runs locally and never leaves this page.

    Hints

    What this lab teaches

    Stage 1 trains the diagnostic habit of M3-L2 for any alignment: look at the residual pattern. Stage 2 estimates the shift, rotation and scale in closed form and is graded on four hidden cases, one of each error and one mixed. Stage 3 adds wrong correspondences and asks for a robust fit. The true transform stays in the simulator; your code sees only the two lists of points.

    Theory for this lab

    Mapping and State Estimation labs

    1. M3-L1: Build a 2D Occupancy Grid
    2. M3-L2: Fix a Misaligned Map: this lab.
    3. M3-L3: Diagnose Scan-Matching Failure
    4. M3-L4: Explore Particle-Filter Localization
    5. M3-L5: Implement a Simplified EKF-SLAM

    Educational simplification: 2D landmark maps with known correspondences, a similarity transform and Gaussian noise, with outliers injected by hand. Real map merging must also find the correspondences (feature matching, RANSAC, branch-and-bound), work in 3D and respect uncertainty.

    Get the next lab

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