Navigation · Maps and Costmaps · M2-L2 · Intermediate
Compute a Distance Field
11:20. The pharmacy corridor has two doors, a narrow one on the straight line and a wide one a few metres away. Scout takes the narrow one every time and scrapes the frame. Facilities want the robot to prefer wide doors when it costs little.
For that, the planner needs to know how far every cell is from the nearest wall. You will compute that field with a two-pass sweep, use it to find the widest route, and then turn it into a direction that nudges the robot away from obstacles.
Your task
Lab complete: post-mortem
You have passed every stage. Now connect it back to the theory and move on:
Output
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.