X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fauton%2FPassLowBar.java;h=49b085d09e6a8ecf11ecd47cd325da75dd5267b3;hb=f11e620060e9ff7062b4409bbc4f14bb5bcf2e9d;hp=c03ce143465c5b9a58ba08ece9f6cb3cfc556719;hpb=dcc47c448a6f2643206a84ff89eedea360ae0d66;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 c03ce143..49b085d0 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java @@ -1,5 +1,9 @@ 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; /*** @@ -8,7 +12,7 @@ import edu.wpi.first.wpilibj.command.CommandGroup; * 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 * @@ -20,15 +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.DeadReckoning.isUsingTimeToPassDefense) { + addSequential(new DriveForTime(Constants.DeadReckoning.passLowBarTime, + Constants.DeadReckoning.passLowBarSpeed)); + } + else { + addSequential(new DriveDistance( + Constants.DeadReckoning.passLowBarDistance, + Constants.DriveTrain.PASS_DEFENSE_TIMEOUT)); + } } }