FixTheRobot Explore Robotics / Navigation / M9 / M9-L1

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

Navigation · Navigation in the Real World · M9-L1 · Advanced

Tune the Inflation Radius

14:20. Facilities has moved a linen cart into the east corridor, which now leaves 0.92 m. The pharmacy door is 0.90 m. The wireless link in that wing is slow, and Scout either brushes the cart, crawls through the door, or weaves down the corridor, depending on who last touched the parameter file.

Nobody remembers why the values are what they are. You will choose four of them, one pair at a time, and then one set that survives the worst corridor in the building.

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

    Tuning is not guessing: each parameter moves a specific check. Inflation radius decides how far the planner feels a wall, and cost scaling decides how strongly. Lookahead decides how stable the controller is against latency, and how much it cuts corners. Top speed decides stopping distance and mission time. The lab shows the cost bands, the planned and driven paths, and which acceptance check each slider moves.

    There is no code to write. Stage 1 tunes the costmap pair for a cart and a door. Stage 2 tunes the controller pair for a straight, a bend and a stop. Stage 3 asks for one set of four values that passes hidden scenarios with a narrower door, a closer cart, higher latency and weaker brakes.

    Parameter names here follow Nav2 (inflation_radius and cost_scaling_factor in the inflation layer, lookahead_dist and desired_linear_vel in the Regulated Pure Pursuit controller). Names and defaults can change between releases, so check the documentation for your distribution before copying anything to a real robot.

    Theory for this lab

    Navigation in the Real World labs

    1. M9-L1: Tune the Inflation Radius: this lab.
    2. M9-L2: Lint a Nav2 Parameter File
    3. M9-L3: Validate a Behavior Tree
    4. M9-L4: Bring Up Nav2 in Simulation

    Educational simplification: the planner is a one-dimensional cross-section search that trades a deviation penalty against the inflation cost; speed near obstacles is scaled by cost; the controller is a pure-pursuit simulation with a fixed command latency; and every threshold (12 cm, 70%, 5 cm, 38 cm, 1.5 m, 54 s) is this lab's own acceptance limit, not a Nav2 constant. Real tuning also has to consider the other critics and parameters of your controller, costmap resolution and sensor noise.

    Get the next lab

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