Prepare for intake arm test
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / Robot.java
index 905844120d2bba3ebfbae9ace7670b060c4b0a83..a060c88e8c0a42745edfc61b7aae67fb374b3f6b 100644 (file)
@@ -1,15 +1,12 @@
 package org.usfirst.frc.team3501.robot;
 
 import org.usfirst.frc.team3501.robot.Constants.Defense;
-import org.usfirst.frc.team3501.robot.sensors.GyroLib;
-import org.usfirst.frc.team3501.robot.sensors.Photogate;
 import org.usfirst.frc.team3501.robot.subsystems.DefenseArm;
 import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
 import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
 import org.usfirst.frc.team3501.robot.subsystems.Scaler;
 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
 
-import edu.wpi.first.wpilibj.I2C;
 import edu.wpi.first.wpilibj.IterativeRobot;
 import edu.wpi.first.wpilibj.command.Scheduler;
 import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
@@ -25,30 +22,24 @@ public class Robot extends IterativeRobot {
   public static IntakeArm intakeArm;
   public static DefenseArm defenseArm;
 
-  public static Photogate photogate;
-
   // Sendable Choosers send a drop down menu to the Smart Dashboard.
   SendableChooser positionChooser;
   SendableChooser positionOneDefense, positionTwoDefense, positionThreeDefense,
       positionFourDefense, positionFiveDefense;
 
-  // Gyro stuff
-  public GyroLib gyro;
-
   @Override
   public void robotInit() {
     driveTrain = new DriveTrain();
     oi = new OI();
-    gyro = new GyroLib(I2C.Port.kOnboard, false);
 
     shooter = new Shooter();
     scaler = new Scaler();
     intakeArm = new IntakeArm();
 
-    initializeSendableChoosers();
-    addPositionChooserOptions();
-    addDefensesToAllDefenseSendableChoosers();
-    sendSendableChoosersToSmartDashboard();
+    // initializeSendableChoosers();
+    // addPositionChooserOptions();
+    // addDefensesToAllDefenseSendableChoosers();
+    // sendSendableChoosersToSmartDashboard();
 
   }
 
@@ -94,17 +85,15 @@ public class Robot extends IterativeRobot {
     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 Four Defense Chooser",
-        positionFourDefense);
-    SmartDashboard.putData("Position Five Defense Chooser",
-        positionFiveDefense);
-
-    shooter = new Shooter();
+    SmartDashboard
+        .putData("Position Four Defense Chooser", positionFourDefense);
+    SmartDashboard
+        .putData("Position Five Defense Chooser", positionFiveDefense);
 
   }
 
@@ -112,23 +101,23 @@ public class Robot extends IterativeRobot {
   public void autonomousInit() {
     Scheduler.getInstance().run();
 
-    // get options chosen from drop down menu
-    Integer chosenPosition = (Integer) positionChooser.getSelected();
-    Integer chosenDefense = 0;
-
-    if (chosenPosition == 1)
-      chosenDefense = (Integer) positionOneDefense.getSelected();
-    else if (chosenPosition == 2)
-      chosenDefense = (Integer) positionTwoDefense.getSelected();
-    else if (chosenPosition == 3)
-      chosenDefense = (Integer) positionThreeDefense.getSelected();
-    else if (chosenPosition == 4)
-      chosenDefense = (Integer) positionFourDefense.getSelected();
-    else if (chosenPosition == 5)
-      chosenDefense = (Integer) positionFiveDefense.getSelected();
-
-    System.out.println("Chosen Position: " + chosenPosition);
-    System.out.println("Chosen Defense: " + chosenDefense);
+    // // get options chosen from drop down menu
+    // Integer chosenPosition = (Integer) positionChooser.getSelected();
+    // Integer chosenDefense = 0;
+    //
+    // if (chosenPosition == 1)
+    // chosenDefense = (Integer) positionOneDefense.getSelected();
+    // else if (chosenPosition == 2)
+    // chosenDefense = (Integer) positionTwoDefense.getSelected();
+    // else if (chosenPosition == 3)
+    // chosenDefense = (Integer) positionThreeDefense.getSelected();
+    // else if (chosenPosition == 4)
+    // chosenDefense = (Integer) positionFourDefense.getSelected();
+    // else if (chosenPosition == 5)
+    // chosenDefense = (Integer) positionFiveDefense.getSelected();
+    //
+    // System.out.println("Chosen Position: " + chosenPosition);
+    // System.out.println("Chosen Defense: " + chosenDefense);
   }
 
   @Override
@@ -138,17 +127,23 @@ public class Robot extends IterativeRobot {
 
   @Override
   public void teleopInit() {
-
-    gyro.start();
-
+    Robot.driveTrain.setLowGear();
+    Robot.shooter.raiseHood();
   }
 
   @Override
   public void teleopPeriodic() {
     Scheduler.getInstance().run();
-
-    System.out.println("Degrees: " + gyro.getRotationZ().getAngle());
-
+    if (OI.rightJoystick.getTrigger()) {
+      Robot.shooter.setSpeed(.8);
+    } else {
+      Robot.shooter.setSpeed(0);
+    }
+    if (OI.rightJoystick.getRawButton(2)) {
+      Robot.shooter.extendPunch();
+    } else {
+      Robot.shooter.retractPunch();
+    }
   }
 
 }