Skip to main content
Module 5 · Pathfinding Around Obstacles

Lesson 5-9 · Capstone Project — Knowledge ChecksAnswer key

Correct answers are marked and the explanation follows each question.

  1. What is the main challenge of the capstone?

    1. A.Inventing a new pathfinding algorithm
    2. B.Integrating components you already built so they work together as one system✓
    3. C.Building a new robot from parts
    4. D.Rewriting BFS from scratch

    Every component already exists and was tested in earlier lessons. The capstone is about connecting them correctly: integration, not new algorithms.

  2. What single data structure connects the start of the run, pathfinding, detection, and what you carry into the next run?

    1. A.The distance dictionary
    2. B.The blocked list — filled at the start, planned from, added to on detection, then printed at the end✓
    3. C.The to_visit list
    4. D.The heading number

    BLOCKED flows through every stage: start → planner → detection → the next run. If it doesn't flow correctly, the whole system breaks.

  3. Why can the program print the plan for leg 1 before the button, but not for legs 2 to 4?

    1. A.compute_bfs_path only works once per program
    2. B.Later legs are planned from wherever leg 1 actually ends, with whatever obstacles were found on the way — neither is known yet✓
    3. C.Printing more than one path would overflow the screen
    4. D.The button only allows one print

    Each leg is planned when it starts, from the robot's real position and the current BLOCKED list. Only leg 1's inputs are known before the robot moves.

  4. A team's robot drives leg 1 correctly, then on leg 2 turns the wrong way and tracks off the grid. The most likely cause?

    1. A.The rangefinder threshold is too low
    2. B.They called navigate_with_detection() without assigning its returned position and heading, so leg 2 was planned from the starting point✓
    3. C.BFS found a non-shortest path
    4. D.The destinations list is too long

    If position and heading aren't updated from the return value, the planner thinks the robot is still at (0, 0) facing north. Its path is right for that spot and wrong for where the robot is.

  5. Which is a classic capstone integration bug to watch for?

    1. A.Using too few comments
    2. B.Resetting the blocked list between destinations, so the robot forgets obstacles mid-run✓
    3. C.Naming the robot
    4. D.Printing the path

    BLOCKED must persist across all destinations in a run. Clearing it each leg throws away everything learned so far. (Also common: not assigning position and heading from navigate_with_detection's return value.)

  6. In the demo, what evidence shows the robot 'learned'?

    1. A.It drives faster
    2. B.Run 2 has fewer reroutes and/or fewer steps than Run 1, because it started out knowing where the obstacles were✓
    3. C.It makes a sound at each intersection
    4. D.Run 2 visits fewer destinations

    The measured improvement from Run 1 to Run 2 (fewer reroutes and steps) is the evidence. Same algorithm, better data to start from.