refactor isUsingTimeToPassDefense to isUsingTime
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / auton / PassMoat.java
CommitLineData
6bb7f8ac 1package org.usfirst.frc.team3501.robot.commands.auton;
d607dcbb 2
9d518a5c
CZ
3import org.usfirst.frc.team3501.robot.Constants;
4import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
1fb6ed96
ME
5import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
6
fe726c3c 7import edu.wpi.first.wpilibj.command.CommandGroup;
d607dcbb
ME
8
9/***
10 * This command will drive the robot through the moat.
11 *
1fb6ed96
ME
12 * The code drives the robot for a specific time at a specific speed up the ramp
13 * to the defense then drive over the defense at a different speed and time.
14 *
15 * dependency on subsystem: drivetrain
16 *
17 * dependency on other commands: DriveForTime
18 *
d607dcbb
ME
19 * pre-condition: robot is flush against the ramp of the outerworks in front of
20 * the moat
21 *
22 * post-condition: the robot has passed the moat and is in the next zone
23 *
24 * @author Meryem and Avi
25 *
26 */
d607dcbb 27
dba0b9ad 28public class PassMoat extends CommandGroup {
d607dcbb 29
dba0b9ad 30 public PassMoat() {
ca325a58 31 if (Constants.Auton.isUsingTime) {
600a1a1c
KZ
32 addSequential(new DriveForTime(Constants.Auton.passMoatTime,
33 Constants.Auton.passMoatSpeed));
9d518a5c
CZ
34 }
35 else {
600a1a1c 36 addSequential(new DriveDistance(Constants.Auton.passMoatDistance,
9d518a5c
CZ
37 Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
38 }
d607dcbb 39
d607dcbb
ME
40 }
41}