added negative signs to fix reversed driving
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / driving / JoystickDrive.java
index 5d8ff9c9fee2930869a2a48af3244a0d92b66289..579942f5796f67ec8c43910052a8c30c0eba1313 100644 (file)
@@ -6,8 +6,7 @@ import edu.wpi.first.wpilibj.command.Command;
 
 /**
  * Runs throughout teleop and listens for joystick inputs and drives the
- * driveTrain
- * Never finishes until teleop ends
+ * driveTrain Never finishes until teleop ends
  */
 public class JoystickDrive extends Command {
 
@@ -21,10 +20,10 @@ public class JoystickDrive extends Command {
 
   @Override
   protected void execute() {
-    // IDK why but the joystick gives positive values for pulling backwards
-    double left = -Robot.oi.leftJoystick.getY();
-    double right = -Robot.oi.rightJoystick.getY();
-    Robot.driveTrain.drive(left, right);
+    double thrust = Robot.oi.leftJoystick.getY();
+    double twist = Robot.oi.leftJoystick.getTwist();
+
+    Robot.driveTrain.joystickDrive(-thrust, -twist);
   }
 
   @Override