X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fautons%2FDrivePastStep.java;fp=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fautons%2FDrivePastStep.java;h=d3105f849a0eab994acf68d5682116a8baac07b1;hb=3e4790a8551e2a7c20db705dea86cb59f3c84696;hp=0000000000000000000000000000000000000000;hpb=b449387d8a410c4d224b9ebca4cbe6b6689ff26b;p=3501%2F3501-spark-go diff --git a/src/org/usfirst/frc/team3501/robot/autons/DrivePastStep.java b/src/org/usfirst/frc/team3501/robot/autons/DrivePastStep.java new file mode 100644 index 0000000..d3105f8 --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/autons/DrivePastStep.java @@ -0,0 +1,29 @@ +package org.usfirst.frc.team3501.robot.autons; + +import org.usfirst.frc.team3501.robot.RobotMap; +import org.usfirst.frc.team3501.robot.commands.CommandBase; + +public class DrivePastStep extends CommandBase { + + private double speed; + + public DrivePastStep() { + super("DrivePastStep"); + requires(drivetrain); + + setTimeout(RobotMap.PAST_STEP_TIME); + this.speed = RobotMap.PAST_STEP_SPEED; + } + + protected void execute() { + drivetrain.goForward(speed); + } + + protected boolean isFinished() { + return isTimedOut(); + } + + protected void end() { + drivetrain.stop(); + } +}