1 package org
.usfirst
.frc
.team3501
.robot
.commands
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
.Defense
;
5 import edu
.wpi
.first
.wpilibj
.command
.CommandGroup
;
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.
11 public class DefaultAutonStrategy
extends CommandGroup
{
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;
19 public DefaultAutonStrategy(int position
, Defense defense
) {
21 // TODO: any variable that is not declared/instantiated are variables that
23 // to be tested for their value
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
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.
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
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
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
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
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
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
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
96 addSequential(new LiftPortcullis());
100 addSequential(new PassSallyPort());
105 new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD
+ 2,
106 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD
+ 2));
111 new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD
+ 2,
112 SPEED_FOR_PASSING_DEFENSE
));
114 case CHEVAL_DE_FRISE
:
116 addSequential(new LowerChevalDeFrise());
120 addSequential(new LowerDrawBridge());
124 addSequential(new DriveForDistance(
125 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD
, SPEED_FOR_PASSING_DEFENSE
));
129 addSequential(new DriveForDistance(
130 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD
, SPEED_FOR_PASSING_DEFENSE
));
134 addSequential(new DriveForDistance(
135 DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD
, SPEED_FOR_PASSING_DEFENSE
));
142 // later put in whatever argument goes inside of aim based on the position
143 // variable that was passed onto the command
145 addSequential(new Aim());
146 addSequential(new Shoot());