fix bugs
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / driving / DriveDistance.java
index b569958fafa4cb432d120f85a4b9981fed390e80..2b77348e781bf917e5755b9464b9b2bb168edee7 100755 (executable)
@@ -35,6 +35,20 @@ public class DriveDistance extends Command {
     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.maxTimeOut = maxTimeOut;
+    this.target = distance;
+
     this.driveP = driveTrain.driveP;
     this.driveI = driveTrain.driveI;
     this.driveD = driveTrain.driveD;
@@ -76,6 +90,14 @@ public class DriveDistance extends Command {
     this.driveTrain.setMotorValues(leftDrive, rightDrive);
 
     driveTrain.printEncoderOutput();
+    // System.out.println("turn: " + xVal);
+    double leftDrive = yVal - xVal;
+    double rightDrive = yVal + xVal;
+
+    this.driveTrain.setMotorValues(leftDrive, rightDrive);
+
+    driveTrain.printEncoderOutput();
+    // System.out.println("motorval: " + yVal);
   }
 
   @Override