e3d64dde31246f1030c8ae80830e33b87b239650
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / auton / PassRoughTerrain.java
1 package org.usfirst.frc.team3501.robot.commands.auton;
2
3 import org.usfirst.frc.team3501.robot.Constants;
4 import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
5 import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
6
7 import edu.wpi.first.wpilibj.command.CommandGroup;
8
9 /***
10 * This command will drive the robot through the rough terrain.
11 *
12 * dependency on subsytems: drivetrain
13 *
14 * dependency on other commands: DriveForTime
15 *
16 * pre-condition: robot is flush against the ramp of the outerworks in front of
17 * the rough terrain
18 *
19 * post-condition: the robot has passed the rough terrain and is in the next
20 * zone
21 *
22 * @author Meryem and Avi
23 *
24 */
25 public class PassRoughTerrain extends CommandGroup {
26
27 public PassRoughTerrain() {
28
29 if (Constants.Auton.isUsingTimeToPassDefense) {
30 addSequential(new DriveForTime(Constants.Auton.passRockWallTime,
31 Constants.Auton.passRockWallSpeed));
32 }
33 else {
34 addSequential(new DriveDistance(
35 Constants.Auton.passRoughTerrainDistance,
36 Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
37 }
38
39 }
40 }