added negative signs to fix reversed driving
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / driving / JoystickDrive.java
index 3db4388046fa4e532f5471c5da3b19f096585286..579942f5796f67ec8c43910052a8c30c0eba1313 100644 (file)
@@ -1,6 +1,5 @@
 package org.usfirst.frc.team3501.robot.commands.driving;
 
-import org.usfirst.frc.team3501.robot.OI;
 import org.usfirst.frc.team3501.robot.Robot;
 
 import edu.wpi.first.wpilibj.command.Command;
@@ -21,11 +20,10 @@ public class JoystickDrive extends Command {
 
   @Override
   protected void execute() {
-    double k = (Robot.driveTrain.isFlipped() ? -1 : 1);
-    // IDK why but the joystick gives positive values for pulling backwards
-    double left = -OI.leftJoystick.getY();
-    double right = -OI.rightJoystick.getY();
-    Robot.driveTrain.drive(left * k, right * k);
+    double thrust = Robot.oi.leftJoystick.getY();
+    double twist = Robot.oi.leftJoystick.getTwist();
+
+    Robot.driveTrain.joystickDrive(-thrust, -twist);
   }
 
   @Override