Fix ports and unusuable code to make shooter test work
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / Robot.java
index 9bc45b8f2c73ca742e7f332ff1fee083c63201ca..71e156b6988aec38d24e6a40a9f4edcf6fb0fac1 100644 (file)
@@ -25,13 +25,15 @@ public class Robot extends IterativeRobot {
   // Sendable Choosers send a drop down menu to the Smart Dashboard.
   SendableChooser positionChooser;
   SendableChooser positionOneDefense, positionTwoDefense, positionThreeDefense,
-  positionFourDefense, positionFiveDefense;
+      positionFourDefense, positionFiveDefense;
 
   @Override
   public void robotInit() {
     driveTrain = new DriveTrain();
     oi = new OI();
 
+    shooter = new Shooter();
+
     // shooter = new Shooter();
     // scaler = new Scaler();
     // intakeArm = new IntakeArm();
@@ -85,17 +87,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);
 
   }
 
@@ -103,28 +103,6 @@ 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);
-  }
-
-  @Override
-  public void autonomousPeriodic() {
-    Scheduler.getInstance().run();
     // Scheduler.getInstance().add(new DriveDistance(24, 5));
     // Scheduler.getInstance().add(new DriveForTime(2, 0.3));
     // Scheduler.getInstance().add(new TurnForAngle(90, 5));
@@ -136,14 +114,30 @@ public class Robot extends IterativeRobot {
   }
 
   @Override
-  public void teleopInit() {
-    // Scheduler.getInstance().add(new JoystickDrive());
+  public void autonomousPeriodic() {
+    Scheduler.getInstance().run();
+  }
 
+  @Override
+  public void teleopInit() {
+    Robot.driveTrain.setLowGear();
+    Robot.shooter.raiseHood();
   }
 
   @Override
   public void teleopPeriodic() {
     Scheduler.getInstance().run();
+    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();
+
+    }
   }
 
 }