finish transferring code
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / driving / DriveDistance.java
index 47fc46ea0303ed6689b3c2a03b6c918b30407c8f..76bc52fef569641a5b3c7a2d1c8d9cc592602505 100755 (executable)
@@ -31,6 +31,20 @@ public class DriveDistance extends Command {
   private double driveI;
   private double driveD;
 
+  public DriveDistance(double distance, double maxTimeOut) {
+    requires(driveTrain);
+    this.maxTimeOut = maxTimeOut;
+    this.target = distance;
+
+  private double target;
+  private double gyroP;
+  private double gyroI;
+  private double gyroD;
+
+  private double driveP;
+  private double driveI;
+  private double driveD;
+
   public DriveDistance(double distance, double motorVal) {
     requires(driveTrain);
     this.driveP = driveTrain.driveP;
@@ -68,6 +82,12 @@ public class DriveDistance extends Command {
       xVal = -this.gyroController
           .calcPID(this.driveTrain.getAngle() - this.driveTrain.getZeroAngle());
     }
+    double leftDrive = yVal - xVal;
+    double rightDrive = yVal + xVal;
+
+    this.driveTrain.setMotorValues(leftDrive, rightDrive);
+
+    driveTrain.printEncoderOutput();
     // System.out.println("turn: " + xVal);
     double leftDrive = MathLib.calcLeftTankDrive(-xVal, yVal);
     double rightDrive = MathLib.calcRightTankDrive(xVal, -yVal);