X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fauton%2FPassLowBar.java;h=9ee3e6eeaff831dfadd8f25d2a639f528930e3cf;hb=ca325a5866b4f601b171b02ac767393bd996d44a;hp=5a7ef5b4208e8552e5c9df539e1fd63d3ea4bf1b;hpb=ab4ae5b83fe8b2dc02c20ad76aab2ac3fa800d63;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 5a7ef5b4..9ee3e6ee --- 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,14 +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() { - 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)); + } } }