FixTheRobot Explore Robotics / Navigation / M8 / M8-L2

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

Navigation · Missions, Coverage and Fleets · M8-L2 · Intermediate

Cover the Floor

22:10. Scout has been given the night mopping job for the Ward 4 floor. In the morning the cleaners find dry stripes behind the beds, and the log says "coverage 100%".

You will build the lane-by-lane sweep, make it survive furniture, and then write the report that would have caught the dry stripes: the missed cells, the overlap and the turns.

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 the boustrophedon path on an empty floor, where each lane starts where the last one ended. Stage 2 adds furniture: the row sweep is broken into runs and the gaps are bridged with shortest paths through free cells. Stage 3 is the report: coverage is counted in different cells, overlap in repeated visits, and turns in changes of heading.

    Grading is result-based: your functions are run on the practice example and on freshly generated hidden floors. Coverage must be complete and the walk must be no longer than the reference sweep.

    Theory for this lab

    Missions, Coverage and Fleets labs

    1. M8-L1: Order the Stops
    2. M8-L2: Cover the Floor: this lab.
    3. M8-L3: Explore by Frontiers
    4. M8-L4: Break the Deadlock

    Educational simplification: the floor is a grid of tool-width cells, moves go to 4-neighbour cells, the sweep is made of rows rather than a true cell decomposition, and a turn is any change of heading. Real coverage planners work in continuous space with a tool footprint and curved turns.

    Get the next lab

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