Skip to main content
Module 4 · Manhattan Navigation

Lesson 8 · Implementing the Navigator Class — Knowledge Checks

Name Date
  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

    Answer Why?

  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

    Answer Why?

  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

    Answer Why?

  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

    Answer Why?