add pre and post conditions for the LiftPortcullis command
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / DefaultAutonStrategy.java
CommitLineData
78d476cc
ME
1package org.usfirst.frc.team3501.robot.commands;
2
dd794a4e
ME
3import org.usfirst.frc.team3501.robot.Constants.Defense;
4
78d476cc
ME
5import 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 */
11public class DefaultAutonStrategy extends CommandGroup {
78d476cc 12
ab237853
ME
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
dd794a4e 19 public DefaultAutonStrategy(int position, Defense defense) {
78d476cc 20
f1bf6cb2
A
21 // TODO: any variable that is not declared/instantiated are variables that
22 // need
3c259ed2
ME
23 // to be tested for their value
24
f1bf6cb2
A
25 /*
26 * Portcullis: Robot is in front of the portcullis in whatever position 1-5.
27 * addSequential(new LiftPortcullis()); lifting the portcullis.
28 * addSequential(new DriveForDistance(distance, speed)); drive through the
29 * portcullis however neccesary. change direction to drive towards the
30 * designated shooting spot, go to that spot. shoot
31 */
32
33 /*
34 * Sally Port: Robot is in front of the sally port in whatever position 1-5.
35 * Do whatever is needed in order to cross sally port. addSequential(new
36 * DriveForDistance(distance, speed));//drive through the sally port. change
37 * direction to drive towards the designated shooting spot, go to that spot.
38 * shoot
39 */
40
41 /*
42 * Rough Terrain: Robot is in front of the sally port in whatever postion
43 * 1-5. Do whatever adaptive technique is required to pass rough terrain
44 * addSequential(new DriveForDistance(distance, speed)); go through the
45 * rough terrain change direction to drive towards the designated shooting
46 * spot, go to that spot. shoot
47 */
48
49 /*
50 * Low Bar: Robot is in front of low bar in whatever position 1-5.
51 * addSequential(new DriveForDistance(distance, speed));//drive through the
52 * low bar change direction to drive towards the designated shooting spot,
53 * go to that spot. shoot
54 */
55
56 /*
57 * Cheval de Frise: Robot is in front of cheval de frise in whatever
58 * position 1-5. do whatever to make all pieces facing down toward robot
59 * addSequential(new DriveForDistance(distance, speed));//drive to pass
60 * cheval de frise change direction to drive towards the designated shooting
61 * spot, go to that spot. shoot
62 */
63
64 /*
65 * Drawbridge: Robot is in front of drawbridge in whatever position 1-5.
66 * lift the drawbridge in whatever way it is to be lifted. addSequential(new
67 * DriveForDistance(distance, speed));//pass the drawbridge change direction
68 * to drive towards the designated shooting spot, go to that spot. shoot
69 */
70
71 /*
72 * Moat: Robot is in front of moat in whatever position 1-5. do whatever is
73 * adaptable to cross the moat. addSequential(new DriveForDistance(distance,
74 * speed));//cross the moat change direction to drive towards the designated
75 * shooting spot, go to that spot. shoot
76 */
77
78 /*
79 * Rockwall: Robot is in front of moat in whatever position 1-5. do whatever
80 * function is neccesary to cross the rock wall. addSequential(new
81 * DriveForDistance(distance, speed));//cross the rockwall change direction
82 * to drive towards the designated shooting spot, go to that spot. shoot
83 */
84
85 /*
86 * Rampart: Robot is in front of moat in whatever position 1-5. do whatever
87 * function is neccesary to cross the rockwall addSequential(new
88 * DriveForDistance(distance, speed));//cross the rockwall change direction
89 * to drive towards the designated shooting spot, go to that spot. shoot
90 */
91
53d61b3e 92 switch (defense) {
ab237853 93
dd794a4e 94 case PORTCULLIS:
ab237853 95
3c259ed2 96 addSequential(new LiftPortcullis());
ab237853 97
dd794a4e 98 case SALLY_PORT:
ab237853 99
f1bf6cb2
A
100 addSequential(
101 new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
102 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2));
ab237853 103
dd794a4e 104 case ROUGH_TERRAIN:
3c259ed2 105
ab237853
ME
106 addSequential(
107 new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
f1bf6cb2 108 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2));
3c259ed2 109
dd794a4e 110 case LOW_BAR:
3c259ed2 111
ab237853
ME
112 addSequential(
113 new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
114 SPEED_FOR_PASSING_DEFENSE));
3c259ed2 115
dd794a4e 116 case CHEVAL_DE_FRISE:
3c259ed2
ME
117
118 addSequential(new LowerChevalDeFrise());
119
dd794a4e 120 case DRAWBRIDGE:
3c259ed2
ME
121
122 addSequential(new LowerDrawBridge());
123
dd794a4e 124 case MOAT:
3c259ed2 125
ab237853
ME
126 addSequential(new DriveForDistance(
127 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
3c259ed2 128
dd794a4e 129 case ROCK_WALL:
3c259ed2 130
ab237853
ME
131 addSequential(new DriveForDistance(
132 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
3c259ed2 133
dd794a4e 134 case RAMPART:
3c259ed2 135
ab237853
ME
136 addSequential(new DriveForDistance(
137 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
3c259ed2 138
dd794a4e
ME
139 default:
140 break;
78d476cc 141 }
53d61b3e 142
ab237853 143 // aim towards goal
a697f2ff
A
144 // later put in whatever argument goes inside of aim based on the position
145 // variable that was passed onto the command
146 // group
147 addSequential(new Aim());
148 addSequential(new Shoot());
ab237853 149
53d61b3e
ME
150 }
151
78d476cc 152}