The course consists of several immobile walls and movable obstacles that the robot must navigate around. In both cases, the sonar sensor is precise enough to prevent collisions while keeping the robot on an efficient path from the start to the end.
Pseudocode
As the robot starts the program, it drives forward until an object comes within a preset threshold, and then stops. The robot turns left, records the distance to the next obstacle, turns right, and records the distance again. If there is more distance on the left than the right, the robot turns back to the left and begins moving forward again; otherwise, it continues on to the right.
We found that our sensor settings were reversed for our right motor.
Unchecking one box was the key to our success.