Skip to main content
Module 4 · Manhattan Navigation

Lesson 8 · Implementing the Navigator Class — Knowledge ChecksAnswer key

Correct answers are marked and the explanation follows each question.

  1. How does the Navigator control the robot's motors?

    1. A.It creates its own DifferentialDrive
    2. B.It delegates to its LineTrack object, which controls the motors
    3. C.It sets motor power directly
    4. D.It doesn't move the robot at all

    The Navigator asks LineTrack to turn and follow lines; LineTrack (built in Module 2) owns the DifferentialDrive. That's delegation — reusing code you already wrote.

  2. Why does desired_heading() use self.position instead of a 'current' parameter?

    1. A.To save memory
    2. B.The Navigator object already knows its own position — that's the advantage of a class
    3. C.Because parameters are not allowed in methods
    4. D.It doesn't need the current position at all

    A class bundles data with behavior. The Navigator stores its position, so its methods can read it directly instead of having it passed in every time.

  3. Why drive straight(8) before track_until_cross() only when going straight ahead?

    1. A.To speed the robot up
    2. B.To clear the current intersection, so track_until_cross() finds the NEXT cross, not the one it's sitting on
    3. C.To turn the robot around
    4. D.To recharge the battery

    When turning, turn_right() already moves off the cross. Going straight, the robot is parked on the cross — without clearing it, the sensors detect it immediately and stop early.

  4. The path from Manhattan is [(1,0),(2,0),(2,1)]. How many times does drive_path call track_until_cross()?

    1. A.Once
    2. B.Three times — once per intersection in the path
    3. C.Four times — including the start
    4. D.It depends on the turns

    drive_path loops once per element in the path, and each pass ends with a track_until_cross() to reach that intersection. Three elements → three calls. The start isn't in the path.