Lesson 5-8 · Building Experience — Knowledge ChecksAnswer key
In navigate_with_detection(), what makes the while loop finally stop?
Each pass plans a path and tries to follow it. A wall breaks the for loop with rerouted = True, and the while plans again from the new position. Only a complete pass sets arrived.
Why does the function return the pose (position and heading), not just the step counts?
The pose (position and heading) is local to the function. The caller learns the new pose only if the function hands it back, and Lesson 5-9 needs it to chain destinations.
Why does the robot navigate better on Run 2?
Same BFS, better data. With Run 1's discoveries pre-loaded, Run 2 plans around them at once instead of rediscovering them.
Run 1 finishes and prints [(1,2), (2,2)]. What has to happen for Run 2 to start out knowing about those two obstacles?
A list lives only while the program runs, and Run 2 knows only what it is handed. So you print the list at the end of one run and type it into KNOWN_OBSTACLES at the start of the next.
Run 1 took 12 steps with 3 reroutes; Run 2 took 8 steps with 0 reroutes. Why the change?
With obstacles pre-loaded, Run 2's first path already avoids them: no surprises, so zero reroutes and fewer steps.
Can Run 2 discover an obstacle Run 1 never found?
The robot only discovers obstacles it drives toward. A new route can reach intersections Run 1 skipped, so Run 2 can still find something new, and Run 3 gets even better data.
What is 'convergence' in this context?
Each run can add knowledge until there's nothing new to learn. Then paths are right immediately: the robot's map has converged.