| 1 | package org.usfirst.frc.team3501.robot.commands.auton; |
| 2 | |
| 3 | import org.usfirst.frc.team3501.robot.Constants; |
| 4 | import org.usfirst.frc.team3501.robot.Constants.Defense; |
| 5 | import org.usfirst.frc.team3501.robot.commands.shooter.Shoot; |
| 6 | |
| 7 | import edu.wpi.first.wpilibj.command.CommandGroup; |
| 8 | import edu.wpi.first.wpilibj.command.WaitCommand; |
| 9 | |
| 10 | /** |
| 11 | * The default autonomous strategy involves passing the defense that is in front |
| 12 | * of it, aiming the robot/ shooter towards the goal, and shooting. |
| 13 | */ |
| 14 | |
| 15 | public class DefaultAutonStrategy extends CommandGroup { |
| 16 | |
| 17 | public DefaultAutonStrategy(int position, Defense defense) { |
| 18 | |
| 19 | if (defense == Constants.Defense.PORTCULLIS) |
| 20 | addSequential(new LiftPortcullis()); |
| 21 | |
| 22 | else if (defense == Constants.Defense.SALLY_PORT) |
| 23 | addSequential(new PassSallyPort()); |
| 24 | |
| 25 | else if (defense == Constants.Defense.ROUGH_TERRAIN) |
| 26 | addSequential(new PassRoughTerrain()); |
| 27 | |
| 28 | else if (defense == Constants.Defense.LOW_BAR) |
| 29 | addSequential(new PassLowBar()); |
| 30 | |
| 31 | else if (defense == Constants.Defense.CHEVAL_DE_FRISE) |
| 32 | addSequential(new PassChevalDeFrise()); |
| 33 | |
| 34 | else if (defense == Constants.Defense.DRAWBRIDGE) |
| 35 | addSequential(new PassDrawBridge()); |
| 36 | |
| 37 | else if (defense == Constants.Defense.MOAT) |
| 38 | addSequential(new PassMoat()); |
| 39 | |
| 40 | else if (defense == Constants.Defense.ROCK_WALL) |
| 41 | addSequential(new PassRockWall()); |
| 42 | |
| 43 | else if (defense == Constants.Defense.RAMPART) |
| 44 | addSequential(new PassRampart()); |
| 45 | |
| 46 | addSequential(new AlignToScore(position)); |
| 47 | // TODO: test for how long robot should wait |
| 48 | addSequential(new WaitCommand(5.0)); |
| 49 | addSequential(new Shoot()); |
| 50 | |
| 51 | } |
| 52 | |
| 53 | } |