rearrange a few more files. realize that adding the auton read from file thing was...
[ozzloy@gmail.com/3501-spark-go] / src / org / usfirst / frc / team3501 / robot / Robot.java
index 67f54e14fcdf1ef00265ff0b25306c193670308e..c7ef783478c8307e5b01d3e5ae714dd192e9b887 100644 (file)
@@ -11,6 +11,7 @@ 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.*;
+import org.usfirst.frc.team3501.util.AutonData;
 
 public class Robot extends IterativeRobot {
 
@@ -22,8 +23,9 @@ public class Robot extends IterativeRobot {
 
        public static OI oi;
 
-       private SendableChooser autoChooser;
+       public static AutonData autonData;
 
+       private SendableChooser autonChooser;
     private Command autonomousCommand;
 
     public void robotInit() {
@@ -35,6 +37,8 @@ public class Robot extends IterativeRobot {
 
                pneumatics = new Pneumatics();
 
+               autonData = new AutonData();
+
                chooseAuto();
     }
 
@@ -45,7 +49,9 @@ public class Robot extends IterativeRobot {
     public void autonomousInit() {
         schedule(new TurnOnCompressor());
 
-        autonomousCommand = (Command) autoChooser.getSelected();
+        autonData.update();
+
+        autonomousCommand = (Command) autonChooser.getSelected();
         autonomousCommand.start();
     }
 
@@ -67,18 +73,14 @@ public class Robot extends IterativeRobot {
         LiveWindow.run();
     }
 
-    public void disabledInit() {
-        schedule(new TurnOffCompressor());
-    }
-
     private void chooseAuto() {
-        autoChooser = new SendableChooser();
+        autonChooser = new SendableChooser();
 
-        autoChooser.addDefault("Pick up container", new ContainerOverStep());
-        autoChooser.addObject("Drive over step",    new DriveOverStep());
-        autoChooser.addObject("Drive past step",    new DrivePastStep());
+        autonChooser.addDefault("Pick up container", new ContainerOverStep());
+        autonChooser.addObject("Drive over step",    new DriveOverStep());
+        autonChooser.addObject("Drive past step",    new DrivePastStep());
 
-        SmartDashboard.putData("Auto Mode", autoChooser);
+        SmartDashboard.putData("Auto Mode", autonChooser);
     }
 
     private void schedule(Command c) {