X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fdriving%2FDriveDistance.java;h=582cd80b69abb799a89a7b3afdcd56432d22a738;hb=c726d04ade36dead56cd4b2f1b91a341ce90bdb6;hp=b82e7d62df1aae12e22fe8ebb0a7478430f2afa4;hpb=35527abe487a3d3cee1ddb10b5c4debc2a2780e4;p=3501%2F2017steamworks diff --git a/src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java b/src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java index b82e7d6..582cd80 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java +++ b/src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java @@ -27,18 +27,17 @@ public class DriveDistance extends Command { private double driveD; private double gyroP; - public DriveDistance(double distance, double motorVal) { + public DriveDistance(double distance, double maxTimeOut) { requires(driveTrain); this.maxTimeOut = maxTimeOut; this.target = distance; - this.zeroAngle = driveTrain.getAngle(); this.driveP = driveTrain.driveP; this.driveI = driveTrain.driveI; this.driveD = driveTrain.driveD; this.gyroP = driveTrain.driveStraightGyroP; this.driveController = new PIDController(driveP, driveI, driveD); - this.driveController.setDoneRange(0.5); + this.driveController.setDoneRange(1.0); this.driveController.setMaxOutput(1.0); this.driveController.setMinDoneCycles(5); } @@ -47,6 +46,7 @@ public class DriveDistance extends Command { protected void initialize() { this.driveTrain.resetEncoders(); this.driveController.setSetPoint(this.target); + this.zeroAngle = driveTrain.getAngle(); } @Override