update code
authorEric Sandoval <harpnart@gmail.com>
Sun, 19 Feb 2017 22:21:26 +0000 (14:21 -0800)
committerEric Sandoval <harpnart@gmail.com>
Sun, 19 Feb 2017 22:21:26 +0000 (14:21 -0800)
src/org/usfirst/frc/team3501/robot/Robot.java
src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java

index 6388d0a171251eeebe101070816315715c7be208..16b2884f1bf1b4a5c1e5dd6d4893132892f05914 100644 (file)
@@ -58,7 +58,7 @@ public class Robot extends IterativeRobot {
   public void autonomousInit() {
     driveTrain.setHighGear();
 
-    double driveP = SmartDashboard.getNumber(driveTrain.DRIVE_D_Val,
+    double driveP = SmartDashboard.getNumber(driveTrain.DRIVE_P_Val,
         driveTrain.PID_ERROR);
     double driveI = SmartDashboard.getNumber(driveTrain.DRIVE_I_Val,
         driveTrain.PID_ERROR);
index cb8227f16017bdde5ef8c0c04c54ed645faad3a6..ccefba03f9197d799a8aef89a4773592507769a1 100755 (executable)
@@ -17,7 +17,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
  */
 public class DriveDistance extends Command {
   private DriveTrain driveTrain = Robot.getDriveTrain();
-  private double maxTimeOut = 10;
+  private double maxTimeOut;
   private double target;
   private double zeroAngle;
   private Preferences prefs;
@@ -28,12 +28,13 @@ public class DriveDistance extends Command {
   public DriveDistance(double distance, double maxTimeOut) {
     requires(driveTrain);
     this.target = distance;
+    this.maxTimeOut = maxTimeOut;
     driveStraightGyroP = SmartDashboard.getNumber(driveTrain.DRIVE_GYRO_P_Val,
         driveTrain.PID_ERROR);
 
     this.driveController = driveTrain.getDriveController();
     this.driveController.setDoneRange(0.5);
-    this.driveController.setMaxOutput(1.1);
+    this.driveController.setMaxOutput(1.0);
     this.driveController.setMinDoneCycles(5);
   }