FixTheRobot Explore Robotics / Localization & SLAM / M2 / M2-L1

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

Localization & SLAM · Mathematical Foundations · M2-L1 · Beginner

Transform Points Between Coordinate Frames

Two robots share a room. Each knows its own pose, each sees the same walls, and neither can use the other’s data until it is expressed in its own frame.

You will implement the algebra that makes sharing possible: pose matrices, inverses, chains, and the exact circular-arc update behind odometry.

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 tests the algebra directly, entry by entry, at poses near the angle wrap. Stage 2 asks for a chain of transforms and is graded by whether the resulting points land on walls that your code never sees. Stage 3 compares your odometry integration with the exact path for coarse steps, where the midpoint rule fails visibly. The simulator keeps the true poses and the room private.

    Theory for this lab

    Mathematical Foundations labs

    1. M2-L1: Transform Points Between Coordinate Frames: this lab.
    2. M2-L2: Diagnose a Pose-Transformation Error
    3. M2-L3: Understand Pose Uncertainty
    4. M2-L4: Match Observations to Landmarks

    Educational simplification: planar SE(2), noise-free commands in stage 3, a noisy 2D scan in stage 2. Production code uses libraries (Eigen, Sophus, tf2) with SE(3) and handles timing and uncertainty (see M2-T2 and Module 7).

    Get the next lab

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