FixTheRobot Explore Robotics / Navigation / M1 / M1-L3

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

Navigation · Navigation Foundations · M1-L3 · Beginner

Score a Navigation Run

09:40. The weekly report says Scout's success rate is 100%. The ward manager says it scraped a pillar on Tuesday, a nurse says it lurches when it stops, and the planner team says its routes are "basically optimal". All four statements can be true at once, because success measures none of those things.

You will write the three scoring functions that tell them apart: path efficiency, clearance and comfort. Then you decide which of two successful runs you would trust in a ward.

Your task

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

    Plain Python with math and heapq. 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 Success weighted by Path Length. The obvious implementation divides by the distance driven, and it scores above 1 whenever the odometry says the robot drove slightly less than the shortest path. You add the max and make failures count as zero. Stage 2 measures clearance edge to edge: the common mistake is to forget that the robot has a body. Stage 3 computes RMS jerk by differentiating a speed profile twice, and ends with a judgement question about a run that succeeds with a near miss.

    Grading is result-based: each function is run on the practice example and on freshly generated hidden runs, paths and speed profiles, and compared with the exact answer. A feedback line names the usual mistake when it recognises it.

    Theory for this lab

    Navigation Foundations labs

    1. M1-L1: Read a Failed Run
    2. M1-L2: Drive the Robot: Unicycle and Car-Like Models
    3. M1-L3: Score a Navigation Run: this lab.

    Educational simplification: a round robot and round obstacles, positions sampled along the run, and speed sampled at a fixed rate. Real evaluations also log time to goal, replans and emergency stops, and measure clearance against the actual footprint (lesson M1-T6).

    Get the next lab

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