Commit | Line | Data |
---|---|---|
78d476cc ME |
1 | package org.usfirst.frc.team3501.robot.commands; |
2 | ||
dd794a4e ME |
3 | import org.usfirst.frc.team3501.robot.Constants.Defense; |
4 | ||
78d476cc ME |
5 | import edu.wpi.first.wpilibj.command.CommandGroup; |
6 | ||
7 | /** | |
53d61b3e ME |
8 | * The default autonomous strategy involves passing the defense that is in front |
9 | * of it, aiming the robot/ shooter towards the goal, and shooting. | |
78d476cc ME |
10 | */ |
11 | public class DefaultAutonStrategy extends CommandGroup { | |
ab237853 ME |
12 | // in feet |
13 | // distance along a platform | |
14 | final double DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD = 4.0; | |
e4f7b3a7 | 15 | |
ab237853 ME |
16 | // number from -1 to 1 |
17 | final double SPEED_FOR_PASSING_DEFENSE = 0.5; | |
18 | ||
dd794a4e | 19 | public DefaultAutonStrategy(int position, Defense defense) { |
78d476cc | 20 | |
53d61b3e | 21 | switch (defense) { |
ab237853 | 22 | |
dd794a4e | 23 | case PORTCULLIS: |
ab237853 | 24 | |
3c259ed2 | 25 | addSequential(new LiftPortcullis()); |
ab237853 | 26 | |
dd794a4e | 27 | case SALLY_PORT: |
ab237853 | 28 | |
86e1c4cc | 29 | addSequential(new PassSallyPort()); |
ab237853 | 30 | |
dd794a4e | 31 | case ROUGH_TERRAIN: |
3c259ed2 | 32 | |
ab237853 ME |
33 | addSequential( |
34 | new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2, | |
f1bf6cb2 | 35 | DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2)); |
3c259ed2 | 36 | |
dd794a4e | 37 | case LOW_BAR: |
3c259ed2 | 38 | |
ab237853 ME |
39 | addSequential( |
40 | new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2, | |
41 | SPEED_FOR_PASSING_DEFENSE)); | |
3c259ed2 | 42 | |
dd794a4e | 43 | case CHEVAL_DE_FRISE: |
3c259ed2 | 44 | |
af236b4e | 45 | addSequential(new PassChevalDeFrise()); |
3c259ed2 | 46 | |
dd794a4e | 47 | case DRAWBRIDGE: |
3c259ed2 ME |
48 | |
49 | addSequential(new LowerDrawBridge()); | |
50 | ||
dd794a4e | 51 | case MOAT: |
3c259ed2 | 52 | |
ab237853 ME |
53 | addSequential(new DriveForDistance( |
54 | DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE)); | |
3c259ed2 | 55 | |
dd794a4e | 56 | case ROCK_WALL: |
3c259ed2 | 57 | |
ab237853 ME |
58 | addSequential(new DriveForDistance( |
59 | DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE)); | |
3c259ed2 | 60 | |
dd794a4e | 61 | case RAMPART: |
3c259ed2 | 62 | |
ab237853 ME |
63 | addSequential(new DriveForDistance( |
64 | DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE)); | |
3c259ed2 | 65 | |
dd794a4e ME |
66 | default: |
67 | break; | |
78d476cc | 68 | } |
53d61b3e | 69 | |
e4f7b3a7 ME |
70 | // TODO: put in the argument that goes inside of aim, based on the position |
71 | // variable that was passed into the command group | |
a697f2ff A |
72 | addSequential(new Aim()); |
73 | addSequential(new Shoot()); | |
ab237853 | 74 | |
53d61b3e ME |
75 | } |
76 | ||
78d476cc | 77 | } |