Skip to main content
Module 5 · Pathfinding Around Obstacles

Lesson 5-8 · Building Experience — Knowledge Checks

Name Date
  1. In navigate_with_detection(), what makes the while loop finally stop?

    1. A.A fixed number of iterations
    2. B.The for loop over the path finishes without a single reroute, so rerouted stays False and arrived becomes True
    3. C.The rangefinder returns 0
    4. D.compute_bfs_path returns the same path twice

    Answer Why?

  2. Why does the function return the pose (position and heading), not just the step counts?

    1. A.Python requires functions to return at least two values
    2. B.So the next trip can be planned from where the robot actually ended up, facing the way it actually faces
    3. C.To reset them to (0, 0) and 0
    4. D.For the print statement only

    Answer Why?

  3. Why does the robot navigate better on Run 2?

    1. A.It learns a smarter algorithm
    2. B.The algorithm is identical — but the blocked list starts with obstacles learned in Run 1, so paths are planned around them from the start
    3. C.Its motors get faster
    4. D.It skips destinations

    Answer Why?

  4. Run 1 finishes and prints [(1,2), (2,2)]. What has to happen for Run 2 to start out knowing about those two obstacles?

    1. A.Nothing — the robot remembers them automatically
    2. B.That list has to be handed to add_blocked() again at the start of Run 2, because a variable does not survive the program ending
    3. C.Run 2 has to drive the same route as Run 1
    4. D.compute_bfs_path has to be rewritten

    Answer Why?

  5. Run 1 took 12 steps with 3 reroutes; Run 2 took 8 steps with 0 reroutes. Why the change?

    1. A.The battery was fuller
    2. B.Run 2 started already knowing the obstacles, so it planned around them and never had to reroute
    3. C.The grid got smaller
    4. D.Random luck

    Answer Why?

  6. Can Run 2 discover an obstacle Run 1 never found?

    1. A.No — Run 2 knows everything already
    2. B.Yes — Run 2 may take a different route and encounter obstacles Run 1 never drove past
    3. C.No — obstacles never change
    4. D.Only if the grid grows

    Answer Why?

  7. What is 'convergence' in this context?

    1. A.The robot running out of battery
    2. B.After enough runs the robot knows all relevant obstacles, so its paths are right from the start and no more reroutes happen
    3. C.Two robots meeting at an intersection
    4. D.The grid shrinking over time

    Answer Why?