Fix ports and unusuable code to make shooter test work
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / Robot.java
index eb66cfb9d64bbd81370bbd11e3ee32045a2e2dc8..71e156b6988aec38d24e6a40a9f4edcf6fb0fac1 100644 (file)
@@ -1,7 +1,6 @@
 package org.usfirst.frc.team3501.robot;
 
 import org.usfirst.frc.team3501.robot.Constants.Defense;
-import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
 import org.usfirst.frc.team3501.robot.subsystems.DefenseArm;
 import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
 import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
@@ -26,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();
@@ -86,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);
 
   }
 
@@ -104,23 +103,14 @@ 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);
+    // Scheduler.getInstance().add(new DriveDistance(24, 5));
+    // Scheduler.getInstance().add(new DriveForTime(2, 0.3));
+    // Scheduler.getInstance().add(new TurnForAngle(90, 5));
+    // Scheduler.getInstance().add(
+    // new TurnForTime(3, Constants.Direction.RIGHT, 0.3));
+    // Scheduler.getInstance().add(
+    // new TurnForTime(3, Constants.Direction.LEFT, 0.3));
+    // Scheduler.getInstance().add(new Turn180());
   }
 
   @Override
@@ -130,20 +120,24 @@ public class Robot extends IterativeRobot {
 
   @Override
   public void teleopInit() {
-    Scheduler.getInstance().add(new DriveDistance(24, 5));
-    // Scheduler.getInstance().add(new DriveForTime(2, 0.3));
-    // Scheduler.getInstance().add(new TurnForAngle(90, 5));
-    // Scheduler.getInstance().add(
-    // new TurnForTime(3, Constants.Direction.RIGHT, 0.3));
-    // Scheduler.getInstance().add(
-    // new TurnForTime(3, Constants.Direction.LEFT, 0.3));
-    // Scheduler.getInstance().add(new JoystickDrive());
-    // Scheduler.getInstance().add(new Turn180());
+    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();
+
+    }
   }
 
 }