change location of base files
[ozzloy@gmail.com/3501-spark-go] / src / org / usfirst / frc / team3501 / robot / commands / DriveWithJoysticks.java
index 500bad953e33000ad9c29fa9a890c64d29ed0f86..5e935c97e0c99294eb9c32411107883a3a2fcc18 100644 (file)
@@ -1,6 +1,8 @@
 package org.usfirst.frc.team3501.robot.commands;
 
-public class DriveWithJoysticks extends CommandBase {
+import org.usfirst.frc.team3501.bases.Command;
+
+public class DriveWithJoysticks extends Command {
 
     public DriveWithJoysticks() {
         super("DriveWithJoysticks");
@@ -8,7 +10,14 @@ public class DriveWithJoysticks extends CommandBase {
     }
 
     protected void execute() {
-        drivetrain.drive(oi.getForward(), oi.getTwist());
+        double forward = oi.getForwardR();
+        double twist   = oi.getTwistR();
+
+        // option to lock twist for alignment
+        if (oi.getRightPressed(3, 4, 5, 6))
+            twist = 0;
+
+        drivetrain.drive(forward, twist);
     }
 
     protected boolean isFinished() {