Auton changes, and more camera testing (aka plz work)
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / Robot.java
index d10b2c5fdb0ac7ac2541cfb5ea23911d9e94c6d0..fae134f4a4be9a4632a3b2e1e2cb42ffaa371048 100644 (file)
@@ -1,14 +1,15 @@
 package org.usfirst.frc.team3501.robot;
 
+import org.usfirst.frc.team3501.robot.commands.auton.Auton;
 import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear;
-import org.usfirst.frc.team3501.robot.commands.intakearm.MoveIntakeArm;
-import org.usfirst.frc.team3501.robot.commands.shooter.ResetCatapult;
 import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
 import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
 
+import edu.wpi.first.wpilibj.CameraServer;
 import edu.wpi.first.wpilibj.IterativeRobot;
 import edu.wpi.first.wpilibj.command.Scheduler;
+import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
 
 public class Robot extends IterativeRobot {
   public static OI oi;
@@ -16,18 +17,33 @@ public class Robot extends IterativeRobot {
   public static Shooter shooter;
   public static IntakeArm intakeArm;
 
+  // Sendable Choosers send a drop down menu to the Smart Dashboard.
+  private static SendableChooser frontChooser;
+  private static CameraServer camera;
+
   @Override
   public void robotInit() {
     driveTrain = new DriveTrain();
-    oi = new OI();
-
     shooter = new Shooter();
     intakeArm = new IntakeArm();
+
+    oi = new OI();
+
+    camera = CameraServer.getInstance();
+    camera.setQuality(5);
+    camera.startAutomaticCapture("cam0");
   }
 
   @Override
   public void autonomousInit() {
-    Scheduler.getInstance().run();
+    //
+    // Scheduler.getInstance().add(new
+    // MoveIntakeArm(Constants.IntakeArm.RETRACT));
+    // Scheduler.getInstance().add(new TimeDrive(1, .6));
+    // Scheduler.getInstance().add(new WaitCommand(1));
+    // Scheduler.getInstance().add(new
+    // MoveIntakeArm(Constants.IntakeArm.EXTEND));
+    Scheduler.getInstance().add(new Auton());
   }
 
   @Override
@@ -37,13 +53,7 @@ public class Robot extends IterativeRobot {
 
   @Override
   public void teleopInit() {
-    Scheduler.getInstance().add(new SetLowGear()); // Start each match in low
-                                                   // gear
-    Scheduler.getInstance().add(new ResetCatapult()); // Reset catapult at start
-                                                      // of each match.
-
-    Scheduler.getInstance().add(new MoveIntakeArm(Constants.IntakeArm.EXTEND));
-    // Start testing with intake arm extended TODO remove this
+    Scheduler.getInstance().add(new SetLowGear());
   }
 
   @Override