more photogate incorporation edits
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / Robot.java
index be19f16163ac021691fe7124b934a3142db7da0c..30926c7af8a9e6b0168b2fa1181e4b59bda65ba0 100644 (file)
@@ -1,8 +1,10 @@
 package org.usfirst.frc.team3501.robot;
 
+import org.usfirst.frc.team3501.robot.Constants.Auton;
 import org.usfirst.frc.team3501.robot.Constants.Defense;
 import org.usfirst.frc.team3501.robot.commands.auton.ChooseStrategy;
-import org.usfirst.frc.team3501.robot.commands.driving.SetHighGear;
+import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear;
+import org.usfirst.frc.team3501.robot.commands.intakearm.Photogate;
 import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
 import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
@@ -17,6 +19,7 @@ public class Robot extends IterativeRobot {
   public static DriveTrain driveTrain;
   public static Shooter shooter;
   public static IntakeArm intakeArm;
+  public static Photogate photogate;
 
   // Sendable Choosers send a drop down menu to the Smart Dashboard.
   SendableChooser positionChooser;
@@ -30,6 +33,7 @@ public class Robot extends IterativeRobot {
     intakeArm = new IntakeArm();
 
     oi = new OI();
+    photogate = new Photogate();
 
     initializeSendableChoosers();
     addPositionChooserOptions();
@@ -47,7 +51,8 @@ public class Robot extends IterativeRobot {
   }
 
   private void addPositionChooserOptions() {
-    positionChooser.addDefault("Position 1", 1);
+    positionChooser.addDefault("None", 0);
+    positionChooser.addObject("Position 1", 1);
     positionChooser.addObject("Position 2", 2);
     positionChooser.addObject("Position 3", 3);
     positionChooser.addObject("Position 4", 4);
@@ -65,29 +70,24 @@ public class Robot extends IterativeRobot {
   private void addDefenseOptions(SendableChooser chooser) {
     chooser.addDefault("Portcullis", Defense.PORTCULLIS);
     chooser.addObject("Sally Port", Defense.SALLY_PORT);
-    chooser.addObject("Rough Terrain", Defense.ROUGH_TERRAIN);
-    chooser.addObject("Low Bar", Defense.LOW_BAR);
+    chooser.addObject("Rough Terrain" + Auton.ROUGH_TERRAIN_SPEED + " "
+        + Auton.ROUGH_TERRAIN_TIME, Defense.ROUGH_TERRAIN);
+    chooser.addObject("Low Bar" + " Will probably work...", Defense.LOW_BAR);
     chooser.addObject("Chival De Frise", Defense.CHIVAL_DE_FRISE);
     chooser.addObject("Drawbridge", Defense.DRAWBRIDGE);
-    chooser.addObject("Moat", Defense.MOAT);
-    chooser.addObject("Rock Wall", Defense.ROCK_WALL);
+    chooser.addObject("Moat" + Auton.MOAT_SPEED + " " + Auton.MOAT_TIME,
+        Defense.MOAT);
+    chooser.addObject("Rock Wall" + Auton.ROCK_WALL_SPEED + " "
+        + Auton.ROCK_WALL_TIME, Defense.ROCK_WALL);
   }
 
   private void sendSendableChoosersToSmartDashboard() {
     SmartDashboard.putData("PositionChooser", positionChooser);
-    SmartDashboard.putData("Position One Defense Chooser", positionOneDefense);
-    SmartDashboard.putData("Position Two Defense Chooser", positionTwoDefense);
-    SmartDashboard.putData("Position Three Defense Chooser",
-        positionThreeDefense);
-    SmartDashboard
-        .putData("Position Four Defense Chooser", positionFourDefense);
-    SmartDashboard
-        .putData("Position Five Defense Chooser", positionFiveDefense);
-
-    SmartDashboard
-        .putData("Position Four Defense Chooser", positionFourDefense);
-    SmartDashboard
-        .putData("Position Five Defense Chooser", positionFiveDefense);
+    SmartDashboard.putData("Position 1 Defense Chooser", positionOneDefense);
+    SmartDashboard.putData("Position 2 Defense Chooser", positionTwoDefense);
+    SmartDashboard.putData("Position 3 Defense Chooser", positionThreeDefense);
+    SmartDashboard.putData("Position 4 Defense Chooser", positionFourDefense);
+    SmartDashboard.putData("Position 5 Defense Chooser", positionFiveDefense);
 
   }
 
@@ -108,8 +108,11 @@ public class Robot extends IterativeRobot {
     else if (chosenPosition == 5)
       chosenDefense = (Defense) positionFiveDefense.getSelected();
 
-    Scheduler.getInstance().add(
-        new ChooseStrategy(chosenPosition, chosenDefense));
+    if (chosenPosition != 0)
+      Scheduler.getInstance().add(
+          new ChooseStrategy(chosenPosition, chosenDefense));
+
+    // Scheduler.getInstance().add(new TimeDrive(.6, 4));
   }
 
   @Override
@@ -119,7 +122,7 @@ public class Robot extends IterativeRobot {
 
   @Override
   public void teleopInit() {
-    Scheduler.getInstance().add(new SetHighGear());
+    Scheduler.getInstance().add(new SetLowGear());
   }
 
   @Override