Add camera, change to arcade drive, front chooser only, minor driving fixes
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / DriveTrain.java
index eeac4900e1b9a5f44b8ca2e1951012c9b3b55376..f1daa63772ded83dc26599c42a098148c79129a3 100644 (file)
@@ -12,7 +12,9 @@ import edu.wpi.first.wpilibj.RobotDrive;
 import edu.wpi.first.wpilibj.command.PIDSubsystem;
 
 public class DriveTrain extends PIDSubsystem {
+  // Determines if the "front" of the robot has been reversed
   private boolean outputFlipped = false;
+
   private static double pidOutput = 0;
 
   private Encoder leftEncoder, rightEncoder;
@@ -191,14 +193,12 @@ public class DriveTrain extends PIDSubsystem {
     return getAvgEncoderDistance();
   }
 
-  public void joystickDrive(double left, double right) {
-    int type = Constants.DriveTrain.DRIVE_TYPE;
+  public void drive(double left, double right) {
+    // Handle flipping of the "front" of the robot
     double k = (isFlipped() ? -1 : 1);
-    if (type == Constants.DriveTrain.TANK) {
-      robotDrive.tankDrive(-left * k, -right * k);
-    } else if (type == Constants.DriveTrain.ARCADE) {
-      robotDrive.arcadeDrive(left * k, right);
-    }
+
+    // During teleop, leftY is throttle, rightX is twist.
+    robotDrive.arcadeDrive(-left * k, -right * k);
   }
 
   public void setMotorSpeeds(double left, double right) {