Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @Author:Will
* */

//85 pts auto
//possible 85 pts auto
public class DefaultAuto extends DefaultAutoMode {
@Override
public void init() {
Expand All @@ -17,63 +17,70 @@ public void init() {
@Override
public void loop() {
switch (state){

case 0: //grab glyph, lower arm and get pictogram
case 0:
hardware.lift.closeAll();
hardware.jewelArm.setPosition(JEWEL_ARM_DOWN_POS);
nextState(getPictogram());
nextState(pause(0.5));
break;

case 1: // raise glyph
nextState(setGlyphLiftPos(5,1));
break;
hardware.lift.closeAll();

nextState(raiseGlyph());
break;
case 2: //get jewel
nextState(getJewel());
hardware.lift.closeAll();
nextState(/*getJewel()*/true);
break;


case 3: // drive forward 24 + 2 (to get off balancing stone)
nextState(autoDrive(new XY(0,26),1));
case 3: //drive forward or backward 24 + 2(to get off balancing stone)
hardware.lift.closeAll();
switch (allianceColor){
case RED:
nextState(autoDrive(new XY(0,26),1));
break;

case BLUE:
nextState(autoDrive(new XY(0,-26),1));
break;
}
break;

case 4: //turn based on position
case 4: // turn based on color
hardware.lift.closeAll();
nextState(driveTurn());
break;

case 5: //drive forward 12
nextState(autoDrive(new XY(0,12),1));
case 5: // drive to safezone
hardware.lift.closeAll();
nextState(safeZoneDrive());
break;

case 6: //2nd turn based on position
case 6: // turn at cryptobox
hardware.lift.closeAll();
nextState(cryptoBoxTurn());
break;

case 7: // move to the correct cryptobox slot
nextState(pictogramDrive(pictogram));
break;

case 8: // drive into crypto box slot slowly
nextState(autoDrive(new XY(0,12),0.25));
case 7: //input glyph
hardware.lift.closeAll();
nextState(autoDrive(new XY(0,6),1));
break;

case 9: // lower glyph
nextState(setGlyphLiftPos(-5,1));
case 8: // lower glyph
hardware.lift.closeAll();
nextState(lowerGlyph());
break;

case 10: //release glyph
case 9: //release glyph
hardware.lift.openAll();
nextState(pause(1));
break;

case 11: // back away from glyph
case 10: //back away
nextState(autoDrive(new XY(0,-2),1));
break;

case 12: // telemetry
case 11 : //Telemetry
telemetry.addData("INFO",LSA);
break;

}
}
}
Loading