Make methods to convert DegreesPerSecond to Degrees
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / DriveTrain.java
index 7c27d12e3d3e99a7bf60f6e8efcf3c96630f3576..3d70d006f9e8c9948879df9b397d4bf219b2fa93 100644 (file)
@@ -34,8 +34,19 @@ public class DriveTrain extends Subsystem {
           / (WHEEL_SPROCKET_DIAMETER) * WHEEL_DIAMETER;
 
   public AnalogInput channel;
+
+  // Gyro stuff
+  private final static double NANOSECONDS_PER_SECOND = 1000000000;
+  short rawValue;
   public FirebotGyro gyro;
 
+  double initialSpeedNanoseconds;
+  double finalSpeedNanoseconds;
+  double initialSpeedSeconds;
+  double finalSpeedSeconds;
+  double deltaSpeed;
+  double degrees;
+
   public DriveTrain() {
     frontLeft = new CANTalon(Constants.DriveTrain.FRONT_LEFT);
     frontRight = new CANTalon(Constants.DriveTrain.FRONT_RIGHT);
@@ -53,7 +64,7 @@ public class DriveTrain extends Subsystem {
     rightEncoder.setDistancePerPulse(INCHES_PER_PULSE);
 
     gyro = new FirebotGyro(I2C.Port.kOnboard, (byte) 0x68);
-
+    gyro.initialize();
   }
 
   @Override
@@ -105,5 +116,4 @@ public class DriveTrain extends Subsystem {
     this.rearLeft.set(leftSpeed);
     this.rearRight.set(-rightSpeed);
   }
-
 }