change name of LowerChevalDeFrise to PassChevalDeFrise and add pre and post condition...
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / DefaultAutonStrategy.java
1 package org.usfirst.frc.team3501.robot.commands;
2
3 import org.usfirst.frc.team3501.robot.Constants.Defense;
4
5 import edu.wpi.first.wpilibj.command.CommandGroup;
6
7 /**
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.
10 */
11 public class DefaultAutonStrategy extends CommandGroup {
12 // in feet
13 // distance along a platform
14 final double DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD = 4.0;
15
16 // number from -1 to 1
17 final double SPEED_FOR_PASSING_DEFENSE = 0.5;
18
19 public DefaultAutonStrategy(int position, Defense defense) {
20
21 switch (defense) {
22
23 case PORTCULLIS:
24
25 addSequential(new LiftPortcullis());
26
27 case SALLY_PORT:
28
29 addSequential(new PassSallyPort());
30
31 case ROUGH_TERRAIN:
32
33 addSequential(
34 new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
35 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2));
36
37 case LOW_BAR:
38
39 addSequential(
40 new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
41 SPEED_FOR_PASSING_DEFENSE));
42
43 case CHEVAL_DE_FRISE:
44
45 addSequential(new PassChevalDeFrise());
46
47 case DRAWBRIDGE:
48
49 addSequential(new LowerDrawBridge());
50
51 case MOAT:
52
53 addSequential(new DriveForDistance(
54 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
55
56 case ROCK_WALL:
57
58 addSequential(new DriveForDistance(
59 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
60
61 case RAMPART:
62
63 addSequential(new DriveForDistance(
64 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
65
66 default:
67 break;
68 }
69
70 // TODO: put in the argument that goes inside of aim, based on the position
71 // variable that was passed into the command group
72 addSequential(new Aim());
73 addSequential(new Shoot());
74
75 }
76
77 }