Prepare for intake arm test
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / Robot.java
index 19fa056a857c635282ca337eed87d1db08ca4a96..a060c88e8c0a42745edfc61b7aae67fb374b3f6b 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.JoystickDrive;
 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,17 +25,17 @@ 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();
-    // scaler = new Scaler();
-    // intakeArm = new IntakeArm();
-    //
+    shooter = new Shooter();
+    scaler = new Scaler();
+    intakeArm = new IntakeArm();
+
     // initializeSendableChoosers();
     // addPositionChooserOptions();
     // addDefensesToAllDefenseSendableChoosers();
@@ -86,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);
 
   }
 
@@ -104,14 +101,23 @@ public class Robot extends IterativeRobot {
   public void autonomousInit() {
     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));
-    // 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());
+    // // 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
@@ -121,13 +127,23 @@ public class Robot extends IterativeRobot {
 
   @Override
   public void teleopInit() {
-    Scheduler.getInstance().add(new JoystickDrive());
-
+    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();
+    }
   }
 
 }