Delete PID stuff that somehow got into master
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / DriveTrain.java
index fd8f612278c760f5760c3ebcf9b20b04b601ea15..6969ed1d961de1130ef7f9658578a770b4a09662 100644 (file)
@@ -12,17 +12,6 @@ public class DriveTrain extends Subsystem {
   private Encoder leftEncoder, rightEncoder;
   private CANTalon frontLeft, frontRight, rearLeft, rearRight;
 
-  // Drivetrain specific constants that relate to the inches per pulse value for
-  // the encoders
-  private final static double WHEEL_DIAMETER = 6.0; // in inches
-  private final static double PULSES_PER_ROTATION = 256;
-  private final static double OUTPUT_SPROCKET_DIAMETER = 2.0;
-  private final static double WHEEL_SPROCKET_DIAMETER = 3.5;
-
-  public final static double INCHES_PER_PULSE = (((Math.PI)
-      * OUTPUT_SPROCKET_DIAMETER / PULSES_PER_ROTATION) / WHEEL_SPROCKET_DIAMETER)
-      * WHEEL_DIAMETER;
-
   public DriveTrain() {
     frontLeft = new CANTalon(Constants.DriveTrain.FRONT_LEFT);
     frontRight = new CANTalon(Constants.DriveTrain.FRONT_RIGHT);
@@ -33,8 +22,8 @@ public class DriveTrain extends Subsystem {
         Constants.DriveTrain.ENCODER_LEFT_B, false, EncodingType.k4X);
     rightEncoder = new Encoder(Constants.DriveTrain.ENCODER_RIGHT_A,
         Constants.DriveTrain.ENCODER_RIGHT_B, false, EncodingType.k4X);
-    leftEncoder.setDistancePerPulse(INCHES_PER_PULSE);
-    rightEncoder.setDistancePerPulse(INCHES_PER_PULSE);
+    leftEncoder.setDistancePerPulse(Constants.DriveTrain.INCHES_PER_PULSE);
+    rightEncoder.setDistancePerPulse(Constants.DriveTrain.INCHES_PER_PULSE);
   }
 
   @Override
@@ -46,31 +35,28 @@ public class DriveTrain extends Subsystem {
     rightEncoder.reset();
   }
 
-  // Returns inches per second
   public double getRightSpeed() {
-    return rightEncoder.getRate();
+    return rightEncoder.getRate(); // in inches per second
   }
 
   public double getLeftSpeed() {
-    return leftEncoder.getRate();
+    return leftEncoder.getRate(); // in inches per second
   }
 
   public double getSpeed() {
-    return (getLeftSpeed() + getRightSpeed()) / 2.0;
+    return (getLeftSpeed() + getRightSpeed()) / 2.0; // in inches per second
   }
 
-  // Returns distance in in
   public double getRightDistance() {
-    return rightEncoder.getDistance();
+    return rightEncoder.getDistance(); // in inches
   }
 
-  // Returns distance in in
   public double getLeftDistance() {
-    return leftEncoder.getDistance();
+    return leftEncoder.getDistance(); // in inches
   }
 
   public double getDistance() {
-    return (getRightDistance() + getLeftDistance()) / 2.0;
+    return (getRightDistance() + getLeftDistance()) / 2.0; // in inches
   }
 
   public void stop() {
@@ -85,5 +71,4 @@ public class DriveTrain extends Subsystem {
     this.rearLeft.set(leftSpeed);
     this.rearRight.set(-rightSpeed);
   }
-
 }