package org.usfirst.frc.team3501.robot.commands.auton;
+import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
+import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
+
import edu.wpi.first.wpilibj.command.CommandGroup;
/***
* This command will drive the robot through the low bar.
*
+ * dependency on sensors: encoders
+ * dependency on subsystems: drivetrain
+ * dependency on other commands: DriveForDist
+ *
* pre-condition: robot is flush against the ramp of the outerworks in front of
* the low bar
*
public class PassLowBar extends CommandGroup {
- private final double DISTANCE = 4.0;
- private final double DEFAULT_SPEED = 0.5;
-
public PassLowBar() {
- addSequential(new DriveForDistance(DISTANCE, DEFAULT_SPEED));
- }
-
- public PassLowBar(double speed) {
- addSequential(new DriveForDistance(DISTANCE, speed));
+ if (Constants.Auton.isUsingTime) {
+ addSequential(new DriveForTime(Constants.Auton.passLowBarTime,
+ Constants.Auton.passLowBarSpeed));
+ }
+ else {
+ addSequential(new DriveDistance(
+ Constants.Auton.passLowBarDistance,
+ Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
+ }
}
}