Build a Self Driving Car With the GoPiGo3

8. Take a Test Drive: Drive From John's to Nicole's

In this step, we'll take our first practical journey. We will drive from John's House on the Map, to Nicole's House.

Map Out Our Turns

If we look at the map, we want the robot to start and do the following:

  1. Drive straight from John's to the first intersection.
  2. Turn left.
  3. Drive straight to the next intersection.
  4. Turn right.
  5. Drive straight to the next intersection.
  6. Drive straight until the road ends.

Let's look at this in code.

  1. GoToTurn
  2. Turn 90 Degrees LEFT
  3. GoToTurn
  4. Turn 90 Degrees Right
  5. GoToTurn
  6. Drive until the line follower has no more line (reads all white!)
We've mapped these out on the map: the directions we want to go are yellow arrows, and each step above is a number in red on the map.

You can download the code, attached as a bloxter file.