How does the Navigator control the robot's motors?
- A.It creates its own DifferentialDrive
- B.It delegates to its LineTrack object, which controls the motors
- C.It sets motor power directly
- D.It doesn't move the robot at all
Answer Why?
Why does desired_heading() use self.position instead of a 'current' parameter?
- A.To save memory
- B.The Navigator object already knows its own position — that's the advantage of a class
- C.Because parameters are not allowed in methods
- D.It doesn't need the current position at all
Answer Why?
Why drive straight(8) before track_until_cross() only when going straight ahead?
- A.To speed the robot up
- B.To clear the current intersection, so track_until_cross() finds the NEXT cross, not the one it's sitting on
- C.To turn the robot around
- D.To recharge the battery
Answer Why?
The path from Manhattan is [(1,0),(2,0),(2,1)]. How many times does drive_path call track_until_cross()?
- A.Once
- B.Three times — once per intersection in the path
- C.Four times — including the start
- D.It depends on the turns
Answer Why?