change location of base files
[ozzloy@gmail.com/3501-spark-go] / src / org / usfirst / frc / team3501 / robot / commands / DriveWithJoysticks.java
index cda6cdd7f35cd96a9d6d3592a0f63c33d7634aac..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.getForwardR(), oi.getTwistR());
+        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() {