X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fauton%2FPassLowBar.java;h=be002264643edb554842d88bba54b94137f24b3b;hb=0f3df681ca44dc9f5c77f61326e1d7b0143ca2b9;hp=9d9184d8d337de60362daa38b7059c8829ecb447;hpb=b332ad0d4dc703f34de13335b98864ed690eaa0e;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java b/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java old mode 100755 new mode 100644 index 9d9184d8..be002264 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java @@ -1,10 +1,18 @@ 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 * @@ -16,16 +24,15 @@ import edu.wpi.first.wpilibj.command.CommandGroup; public class PassLowBar extends CommandGroup { - private final double DISTANCE = 4.0; - private final double DEFAULT_SPEED = 0.5; - public PassLowBar() { - // TODO: need to add sequential for retracting the arms and shooting hood - // once those commands are made - addSequential(new DriveForDistance(DISTANCE, DEFAULT_SPEED)); - } - - public PassLowBar(double speed) { - addSequential(new DriveForDistance(DISTANCE, speed)); + if (Constants.Auton.IS_USING_TIME) { + addSequential(new DriveForTime(Constants.Auton.PASS_LOW_BAR_TIME, + Constants.Auton.PASS_LOW_BAR_SPEED)); + } + else { + addSequential(new DriveDistance( + Constants.Auton.PASS_LOW_BAR_DIST, + Constants.DriveTrain.PASS_DEFENSE_TIMEOUT)); + } } }