Commit | Line | Data |
---|---|---|
6bb7f8ac | 1 | package org.usfirst.frc.team3501.robot.commands.auton; |
d607dcbb | 2 | |
9d518a5c CZ |
3 | import org.usfirst.frc.team3501.robot.Constants; |
4 | import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance; | |
1fb6ed96 ME |
5 | import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime; |
6 | ||
fe726c3c | 7 | import 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 | 28 | public class PassMoat extends CommandGroup { |
d607dcbb | 29 | |
dba0b9ad | 30 | public PassMoat() { |
f11e6200 | 31 | if (Constants.DeadReckoning.isUsingTimeToPassDefense) { |
9d518a5c CZ |
32 | addSequential(new DriveForTime(Constants.DeadReckoning.passMoatTime, |
33 | Constants.DeadReckoning.passMoatSpeed)); | |
34 | } | |
35 | else { | |
36 | addSequential(new DriveDistance(Constants.DeadReckoning.passMoatDistance, | |
37 | Constants.DriveTrain.PASS_DEFENSE_TIMEOUT)); | |
38 | } | |
d607dcbb | 39 | |
d607dcbb ME |
40 | } |
41 | } |