X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fauton%2FPassMoat.java;h=b0f2b8426a00ba1b42155a83430ec5fbcc743f74;hp=7178aa1fceaa215c71f530b83eff8a534f1ae20a;hb=ca325a5866b4f601b171b02ac767393bd996d44a;hpb=6bb7f8ac8eca89a8e0b308720f7e15178eef43ea diff --git a/src/org/usfirst/frc/team3501/robot/commands/auton/PassMoat.java b/src/org/usfirst/frc/team3501/robot/commands/auton/PassMoat.java index 7178aa1f..b0f2b842 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassMoat.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassMoat.java @@ -1,10 +1,21 @@ package org.usfirst.frc.team3501.robot.commands.auton; -import edu.wpi.first.wpilibj.command.Command; +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 moat. * + * The code drives the robot for a specific time at a specific speed up the ramp + * to the defense then drive over the defense at a different speed and time. + * + * dependency on subsystem: drivetrain + * + * dependency on other commands: DriveForTime + * * pre-condition: robot is flush against the ramp of the outerworks in front of * the moat * @@ -13,30 +24,18 @@ import edu.wpi.first.wpilibj.command.Command; * @author Meryem and Avi * */ -public class PassMoat extends Command { - public PassMoat() { - - } +public class PassMoat extends CommandGroup { - @Override - protected void initialize() { - } - - @Override - protected void execute() { - } - - @Override - protected boolean isFinished() { - return false; - } - - @Override - protected void end() { - } + public PassMoat() { + if (Constants.Auton.isUsingTime) { + addSequential(new DriveForTime(Constants.Auton.passMoatTime, + Constants.Auton.passMoatSpeed)); + } + else { + addSequential(new DriveDistance(Constants.Auton.passMoatDistance, + Constants.DriveTrain.PASS_DEFENSE_TIMEOUT)); + } - @Override - protected void interrupted() { } }