remove potentially unnecessary method
[3501/3501-spark-go] / src / org / usfirst / frc / team3501 / robot / Robot.java
index b5ac5b7a98a13dd563a37dfbe2e9e504cd165755..b99f059d9aaa77085ca6381d27fd609061d0d9fb 100644 (file)
@@ -9,13 +9,16 @@ 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 {
 
-       public static final Drivetrain drivetrain = new Drivetrain();
-       public static final Arm               arm = new Arm();
-       public static final Claw             claw = new Claw();
+       public static Drivetrain drivetrain;
+       public static Arm arm;
+       public static Claw claw;
+
+       public static Pneumatics pneumatics;
 
        public static OI oi;
 
@@ -26,6 +29,12 @@ public class Robot extends IterativeRobot {
     public void robotInit() {
                oi = new OI();
 
+               drivetrain = new Drivetrain();
+               arm        = new Arm();
+               claw       = new Claw();
+
+               pneumatics = new Pneumatics();
+
                chooseAuto();
     }
 
@@ -34,6 +43,8 @@ public class Robot extends IterativeRobot {
        }
 
     public void autonomousInit() {
+        schedule(new TurnOnCompressor());
+
         autonomousCommand = (Command) autoChooser.getSelected();
         autonomousCommand.start();
     }
@@ -43,6 +54,8 @@ public class Robot extends IterativeRobot {
     }
 
     public void teleopInit() {
+        schedule(new TurnOnCompressor());
+
         autonomousCommand.cancel();
     }
 
@@ -57,9 +70,14 @@ public class Robot extends IterativeRobot {
     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);
+    }
 }