546d5e69678f3836ed9ae8606db7c444ccf57cfc
[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 variables that
22 // need
23 // to be tested for their value
24
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
92 switch (defense) {
93
94 case PORTCULLIS:
95
96 addSequential(new LiftPortcullis());
97
98 case SALLY_PORT:
99
100 addSequential(new PassSallyPort());
101
102 case ROUGH_TERRAIN:
103
104 addSequential(
105 new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
106 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2));
107
108 case LOW_BAR:
109
110 addSequential(
111 new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
112 SPEED_FOR_PASSING_DEFENSE));
113
114 case CHEVAL_DE_FRISE:
115
116 addSequential(new LowerChevalDeFrise());
117
118 case DRAWBRIDGE:
119
120 addSequential(new LowerDrawBridge());
121
122 case MOAT:
123
124 addSequential(new DriveForDistance(
125 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
126
127 case ROCK_WALL:
128
129 addSequential(new DriveForDistance(
130 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
131
132 case RAMPART:
133
134 addSequential(new DriveForDistance(
135 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
136
137 default:
138 break;
139 }
140
141 // aim towards goal
142 // later put in whatever argument goes inside of aim based on the position
143 // variable that was passed onto the command
144 // group
145 addSequential(new Aim());
146 addSequential(new Shoot());
147
148 }
149
150 }