misc cleanup
[ozzloy@gmail.com/3501-spark-go] / src / org / usfirst / frc / team3501 / robot / subsystems / Drivetrain.java
index 5285956a4b78898b4ff296e3459fd47c2dded9cd..1267f2c914935d5e18c4787f6a353d2f80feb17f 100644 (file)
@@ -1,6 +1,7 @@
 package org.usfirst.frc.team3501.robot.subsystems;
 
 import org.usfirst.frc.team3501.robot.RobotMap;
+import org.usfirst.frc.team3501.robot.commands.DriveWithJoysticks;
 
 import edu.wpi.first.wpilibj.CANJaguar;
 import edu.wpi.first.wpilibj.RobotDrive;
@@ -8,7 +9,7 @@ import edu.wpi.first.wpilibj.command.Subsystem;
 
 public class Drivetrain extends Subsystem {
 
-    RobotDrive robotDrive;
+    private RobotDrive robotDrive;
 
     public Drivetrain() {
         CANJaguar frontLeft  = new CANJaguar(RobotMap.FRONT_LEFT_ADDRESS);
@@ -24,7 +25,7 @@ public class Drivetrain extends Subsystem {
     public void drive(double forward, double twist) {
         if (Math.abs(forward) < RobotMap.MIN_DRIVE_JOYSTICK_INPUT)
             forward = 0;
-        if (Math.abs(twist) < RobotMap.MIN_DRIVE_JOYSTICK_INPUT)
+        if (Math.abs(twist)   < RobotMap.MIN_DRIVE_JOYSTICK_INPUT)
             twist = 0;
 
         robotDrive.arcadeDrive(
@@ -33,6 +34,10 @@ public class Drivetrain extends Subsystem {
                 false);
     }
 
+    public void driveRaw(double forward, double twist) {
+        robotDrive.arcadeDrive(forward, twist, false);
+    }
+
     public void goForward(double speed) {
         robotDrive.arcadeDrive(speed, 0);
     }
@@ -46,6 +51,7 @@ public class Drivetrain extends Subsystem {
         return (x + Math.signum(x) * Math.sqrt(Math.abs(x))) / 2;
     }
 
-    public void initDefaultCommand() {}
+    public void initDefaultCommand() {
+        setDefaultCommand(new DriveWithJoysticks());
+    }
 }
-