big refactor of command/commandbase/commandgroup. also add auton read from file.
[3501/3501-spark-go] / src / org / usfirst / frc / team3501 / robot / commands / DriveWithJoysticks.java
index 500bad953e33000ad9c29fa9a890c64d29ed0f86..cf5446ad825a7fa3307e632d7243ec45759fcc7d 100644 (file)
@@ -1,6 +1,6 @@
 package org.usfirst.frc.team3501.robot.commands;
 
-public class DriveWithJoysticks extends CommandBase {
+public class DriveWithJoysticks extends Command {
 
     public DriveWithJoysticks() {
         super("DriveWithJoysticks");
@@ -8,7 +8,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() {