conform to all command based
[3501/3501-spark-go] / src / org / usfirst / frc / team3501 / robot / Robot.java
index 23a43b7812daab2e2bfe1d188ebfcb025f998b7c..67f54e14fcdf1ef00265ff0b25306c193670308e 100644 (file)
@@ -9,6 +9,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
 import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
 
 import org.usfirst.frc.team3501.robot.autons.*;
+import org.usfirst.frc.team3501.robot.commands.*;
 import org.usfirst.frc.team3501.robot.subsystems.*;
 
 public class Robot extends IterativeRobot {
@@ -42,7 +43,7 @@ public class Robot extends IterativeRobot {
        }
 
     public void autonomousInit() {
-        pneumatics.start();
+        schedule(new TurnOnCompressor());
 
         autonomousCommand = (Command) autoChooser.getSelected();
         autonomousCommand.start();
@@ -53,7 +54,7 @@ public class Robot extends IterativeRobot {
     }
 
     public void teleopInit() {
-        pneumatics.start();
+        schedule(new TurnOnCompressor());
 
         autonomousCommand.cancel();
     }
@@ -67,15 +68,20 @@ public class Robot extends IterativeRobot {
     }
 
     public void disabledInit() {
-        pneumatics.stop();
+        schedule(new TurnOffCompressor());
     }
 
     private void chooseAuto() {
         autoChooser = new SendableChooser();
 
-        autoChooser.addDefault("Drive over step", new DriveOverStep());
-        autoChooser.addObject("Drive past step",  new DrivePastStep());
+        autoChooser.addDefault("Pick up container", new ContainerOverStep());
+        autoChooser.addObject("Drive over step",    new DriveOverStep());
+        autoChooser.addObject("Drive past step",    new DrivePastStep());
 
         SmartDashboard.putData("Auto Mode", autoChooser);
     }
+
+    private void schedule(Command c) {
+        Scheduler.getInstance().add(c);
+    }
 }