Test 2: Code

Code Used

// Setup motors, go to the gate

motorSpeed(4,20);

goToRelativePosition(-298);

// Stop motors, wait for 7 seconds

motorSpeed(4,0);

goFor(7);

// Go past the gate

motorSpeed(4,20);

goToRelativePosition(-100);

//Stop at gate for 5 seconds

motorSpeed(4, 0);

GoFor(5);

//Return to gate with the caboose

motorSpeed(4,20);

goToRelativePosition(298);

// Stop motors, wait for 7 seconds

motorSpeed(4,0);

goFor(7);

// Go past the gate

motorSpeed(4,20);

goToRelativePosition(100);

//Stop all motors

brake(4);

 

The code for the second performance test builds on the code from the first performance test. Because of the low speed during this test, the amount of sliding is minimal, which in turn simplifies the code. The goToRelativePosition function is important in our control logic because it is was allows our AEV to localize to the accuracy that is expected.