Rescuer Learn 3: Following a Wall
This is the third challenge within the Robotics with GoPiGo and Python Curriculum.
Your task is to design a robot program that can navigate through the maze-like jungle without trampling over any plants or getting stuck in any dead ends.
Learn how to use the Distance Sensor and practice using the left-hand rule of maze-solving.
3. This code does the following:
- repeatedly drives a small distance (sampling_distance_cm)
- measures the distance from the wall on the left.
- When the distance measured is large (greater than large_distance_cm) we
- turn 90 degrees anti-clockwise,
- drive a distance (left_turn_drive_cm) around the corner,
- reach a point where we have a wall on the left once again,
- resume the drive & measure loop.
Note that your original sensor reading code is required to take an initial reading from the distance_left sensor, both before you start and after the robot has completed turning each corner. This is needed for the while loop that follows (while left_values[-1] < large_distance_cm).