refactor isUsingTimeToPassDefense to isUsingTime
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / auton / PassLowBar.java
CommitLineData
6bb7f8ac 1package org.usfirst.frc.team3501.robot.commands.auton;
d607dcbb 2
9d518a5c 3import org.usfirst.frc.team3501.robot.Constants;
dfcc1b21 4import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
9d518a5c 5import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
dfcc1b21 6
ab4ae5b8 7import edu.wpi.first.wpilibj.command.CommandGroup;
d607dcbb
ME
8
9/***
10 * This command will drive the robot through the low bar.
11 *
dcc47c44
ME
12 * dependency on sensors: encoders
13 * dependency on subsystems: drivetrain
14 * dependency on other commands: DriveForDist
dfcc1b21 15 *
d607dcbb
ME
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 */
d607dcbb 24
dba0b9ad 25public class PassLowBar extends CommandGroup {
54c525f6 26
dba0b9ad 27 public PassLowBar() {
ca325a58 28 if (Constants.Auton.isUsingTime) {
600a1a1c
KZ
29 addSequential(new DriveForTime(Constants.Auton.passLowBarTime,
30 Constants.Auton.passLowBarSpeed));
9d518a5c
CZ
31 }
32 else {
33 addSequential(new DriveDistance(
600a1a1c 34 Constants.Auton.passLowBarDistance,
9d518a5c
CZ
35 Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
36 }
d607dcbb
ME
37 }
38}