refactor isUsingTimeToPassDefense to isUsingTime
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / auton / PassLowBar.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 low bar.
11 *
12 * dependency on sensors: encoders
13 * dependency on subsystems: drivetrain
14 * dependency on other commands: DriveForDist
15 *
16 * pre-condition: robot is flush against the ramp of the outerworks in front of
17 * the low bar
18 *
19 * post-condition: the robot has passed the low bar and is in the next zone
20 *
21 * @author Meryem and Avi
22 *
23 */
24
25 public class PassLowBar extends CommandGroup {
26
27 public PassLowBar() {
28 if (Constants.Auton.isUsingTime) {
29 addSequential(new DriveForTime(Constants.Auton.passLowBarTime,
30 Constants.Auton.passLowBarSpeed));
31 }
32 else {
33 addSequential(new DriveDistance(
34 Constants.Auton.passLowBarDistance,
35 Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
36 }
37 }
38 }