Add testing stuff
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / Robot.java
index 9bc45b8f2c73ca742e7f332ff1fee083c63201ca..1f86b9bcf71889f6d610a76a737a211a0ce58ea5 100644 (file)
@@ -1,12 +1,14 @@
 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;
 import org.usfirst.frc.team3501.robot.subsystems.Scaler;
 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
 
+import edu.wpi.first.wpilibj.Compressor;
 import edu.wpi.first.wpilibj.IterativeRobot;
 import edu.wpi.first.wpilibj.command.Scheduler;
 import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
@@ -22,10 +24,12 @@ public class Robot extends IterativeRobot {
   public static IntakeArm intakeArm;
   public static DefenseArm defenseArm;
 
+  public static Compressor compressor;
+
   // 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() {
@@ -40,6 +44,7 @@ public class Robot extends IterativeRobot {
     // addPositionChooserOptions();
     // addDefensesToAllDefenseSendableChoosers();
     // sendSendableChoosersToSmartDashboard();
+    compressor = new Compressor();
 
   }
 
@@ -103,28 +108,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));
@@ -135,10 +118,18 @@ public class Robot extends IterativeRobot {
     // Scheduler.getInstance().add(new Turn180());
   }
 
+  @Override
+  public void autonomousPeriodic() {
+    Scheduler.getInstance().run();
+  }
+
   @Override
   public void teleopInit() {
-    // Scheduler.getInstance().add(new JoystickDrive());
 
+    Scheduler.getInstance().add(new JoystickDrive());
+    compressor.start();
+    driveTrain.leftGearPiston.set(Constants.DriveTrain.HIGH_GEAR);
+    driveTrain.rightGearPiston.set(Constants.DriveTrain.HIGH_GEAR);
   }
 
   @Override