PDR Code

The code below allows the AEV to travel half of the track:

reverse(4); // Reverse all motors

motorSpeed(4,35); // Run all motors at 35% power

goToRelativePosition(-122); // The AEV will move to about 5 feet

reverse(4); // Reverse all motors

motorSpeed(4,25); // Run all motors at 25% power

goFor(2); // Run the previous command for 2 seconds

brake(4); // Brake all motors

goFor(2); // Run the previous command for 2 seconds

motorSpeed(4,22); // Run all motors at 22% power

goToRelativePosition(460); //  The AEV will move about to 19 feet

reverse(4); // Reverse all motors

motorSpeed(4,23); // Run all motors at 23% power

goFor(2); // Run the previous command for 2 seconds

brake(4); // Brake all motors

goFor(2); // Run the previous command for 2 seconds

reverse(4); // Reverse all motors

motorSpeed(4,30); // Run all motors at 30% power

goToRelativePosition(183); // The AEV will move to about 7 feet

reverse(4); // Reverse all motors

motorSpeed(4,23); // Run all motors at 23% power

goFor(2); // Run the previous command for 2 seconds

brake(4); // Brake all motors

reverse(4);  // Reverse all motors