Code

reverse(4); //reverses direction of motors
celerate(4,0,36,1); //accelerates AEV with 36% motor power
motorSpeed(4,36);
goToAbsolutePosition(-129);
motorSpeed(4,44); //increases motor power to 44% at 129 marks from start
goToAbsolutePosition(-253);
brake(4); //brakes AEV motors at 253 marks from start
reverse(4);
motorSpeed(4,30);
goFor(1.5); //brakes AEV with 30% motor power in opposite direction for 1.5 seconds
brake(4);
goFor(7); //At Gate, AEV waits 7 seconds for gate to open
reverse(4);
celerate(4,0,40,1); //Leaving Gate with 40% motor power
goToAbsolutePosition(-422);
brake(4);
motorSpeed(4,9); //lightly pushes AEV downhill toward cargo with 9% motor power
goToAbsolutePosition(-532); //Brakes pushing at 532 marks
brake(4);
goToAbsolutePosition(-623);
goFor(6); //Waits for 6 seconds at cargo (~623 marks)
reverse(4);
celerate(4,0,43,2);  //Pulls Cargo with 43% motor power over 2 seconds
goToAbsolutePosition(-411); //AEV motors stop at 411 marks
brake(4);
goToAbsolutePosition(-410);
reverse(4);
motorSpeed(4,59.25); //AEV motors brake in opposite direction at 59.25% motor power and stop at 365 marks.
goToAbsolutePosition(-365);
brake(4);
reverse(4);
goToAbsolutePosition(-360); //AEV reaches gate at ~360 marks and waits 7 seconds
goFor(7);
celerate(4,0,60,1.5); //AEV accelerates out of gate with 60% motor power
goToAbsolutePosition(-287); //AEV brakes motors at top of hill, going down
brake(4);
goToAbsolutePosition(-41);
reverse(4);
motorSpeed(4,74.5); //AEV power brakes its motors in opposite directions with 74.5% motor power at 41 marks
goToAbsolutePosition(-10);
brake(4); //power brake and AEV routine end at 10 marks, AEV coasts to ending zone