Individual Competition


        setFuel();

        moveForward(HIGH_FORWARD, 10);
        moveToY(22.5);

        turnRight(-75);
        turnTo(358);

        moveForward(HIGH_FORWARD, 17);
        moveToX(25.5);


        pressButton(isBlue());

        moveForward(HIGH_FORWARD, 13);
        //moveToX(16);

        turnRight(-35);
        //turnTo(240);



        //THE WRENCH


        wrenchServo.SetDegree(140);         // Set the servos

        moveForward(50, 10);
        moveToY(18.5);
        showInfo();
        Sleep(FULL_SECOND);                 // Line up with wrench

        turnRight(30);
        turnTo(180);
        showInfo();
        Sleep(FULL_SECOND);                 // Turn towards wrench

        moveForward(LOW_FORWARD, 17);
        showInfo();
                         // Approach wrench

        wrenchServo.SetDegree(40);
        Sleep(HALF_SECOND);

        moveForward(-50, 6);
        showInfo();
                         // Back off from wrench

        turnRight(-66);
        showInfo();
                        // Turn to approach jack

        moveForward(50, 12);
        moveToY(11);
        showInfo();
                         // Approach jack area

        turnRight(-92);
        showInfo();
                         // Turn to jack

        moveForward(50, 10);
        showInfo();
                         // Push the jack

        moveForward(-50, 5);
        showInfo();
                        // Back off

        turnRight(85);
        showInfo();
                      // Turn to ramp

        moveForward(-50, 15);
        moveToY(21);
        showInfo();
                         // Move to ramp

        turnRight(-42);
        turnTo(315);
        showInfo();
                        // Adjust on ramp

        moveForward(-50, 10);
        moveToX(4);
        showInfo();
                         // Move to ramp

        turnRight(35);
        turnTo(274);
        showInfo();
                        // Adjust on ramp

        bool deadzone;
        deadzone = (RPS.IsDeadzoneActive() != 2);


        // UP TOP

        moveForward(-1 * HIGH_FORWARD, 52);
        if(!deadzone) {
            moveToY(48);
        }

        turnRight(43);
        if(!deadzone) {
            turnTo(226);
        }

        moveForward(-1 * HIGH_FORWARD, 20);
        if(!deadzone) {
            turnTo(226);
        }
        moveForward(-1 * HIGH_FORWARD, 20);
        if(!deadzone) {
            turnTo(226);
        }
        moveForward(-1 * HIGH_FORWARD, 10);
        turnFuel();                         // FUEL STUFF

        moveForward(HIGH_FORWARD, 17);
        if(!deadzone) {
            moveToX(17);
        }

        turnRight(80);
        moveForward(HIGH_FORWARD, 25);
        wrenchServo.SetDegree(150);         // Place wrench in garage
        Sleep(FULL_SECOND);
        moveForward(-1 * FAST, 45);         // Go to the ramp again
        wrenchServo.SetDegree(40);
        turnRight(47);                      // Turn to ramp
        moveForward(-1 * FAST, 17);         // Down we go
        turnRight(105);
        moveForward(-1 * HIGH_FORWARD, 20);
        turnRight(105);
        moveForward(-1 * HIGH_FORWARD, 30);

        break;

Algorithm for Individual Competition

  1. Check fuel direction, and turn the fuel servo accordingly
  2. Move forward, then correct the Y position
  3. Turn left, then correct heading
  4. Move forward, then correct the X position
  5. Read the color of the light and press the corresponding button
  6. Move forward
  7. Turn right
  8. Lower wrench servo
  9. Move forward, then correct Y position
  10. Turn right, then correct heading
  11. Move forward at a low speed
  12. Raise wrench servo
  13. Move backwards
  14. Turn left
  15. Move forward, then correct Y position
  16. Turn left
  17. Move forward, pushing jack
  18. Move backwards
  19. Turn right
  20. Move backwards, then correct Y position
  21. Turn left, then correct heading
  22. Move backwards, then correct X position
  23. Turn right, then correct heading
  24. Store whether or not the deadzone is active
  25. If the deadzone is active, ignore all RPS checks on the upper level
  26. Move backwards, then correct Y position
  27. Turn right, the correct heading
  28. Move backwards, correcting heading during movement
  29. Turn the fuel crank in the correct direction
  30. Move forward, then correct X position
  31. Turn right
  32. Move forward
  33. Lower wrench servo
  34. Move backwards
  35. Raise wrench servo
  36. Turn right
  37. Move backwards down the ramp
  38. Turn right
  39. Move backwards
  40. Turn right
  41. Move backwards into final button