make constants for distance between neutral zone and courtyard and for speed
[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
13 // in feet
14 // distance along a platform
15 final double DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD = 4.0;
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 // TODO: any variable that is not declared/instantiated are vars that need
22 // to be tested for their value
23
24 // pass the defense
25 switch (defense) {
26
27 case PORTCULLIS:
28 // we are assuming that LiftPortcullis() includes moving the defense arm
29 // and driving forward
30
31 addSequential(new LiftPortcullis());
32
33 case SALLY_PORT:
34
35 // addSequential();
36
37 case ROUGH_TERRAIN:
38
39 addSequential(
40 new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
41 SPEED_FOR_PASSING_DEFENSE));
42
43 case LOW_BAR:
44
45 addSequential(
46 new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
47 SPEED_FOR_PASSING_DEFENSE));
48
49 case CHEVAL_DE_FRISE:
50
51 addSequential(new LowerChevalDeFrise());
52
53 case DRAWBRIDGE:
54
55 addSequential(new LowerDrawBridge());
56
57 case MOAT:
58
59 addSequential(new DriveForDistance(
60 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
61
62 case ROCK_WALL:
63
64 addSequential(new DriveForDistance(
65 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
66
67 case RAMPART:
68
69 addSequential(new DriveForDistance(
70 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
71
72 default:
73 break;
74 }
75
76 // aim towards goal
77
78 // shoot
79
80 //
81
82 }
83
84 }