commit
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / Robot.java
index 79e12d9e00d8adc2adeb8be51b8fd97fa8978459..be86bc2935465efb2d34ffb38f27dd226baf8456 100644 (file)
@@ -1,40 +1,77 @@
 package org.usfirst.frc.team3501.robot;
 
-import org.usfirst.frc.team3501.robot.Constants.DriveTrain;
+import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear;
+import org.usfirst.frc.team3501.robot.commands.driving.TimeDrive;
+import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
+import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
 
+import edu.wpi.first.wpilibj.CameraServer;
 import edu.wpi.first.wpilibj.IterativeRobot;
 import edu.wpi.first.wpilibj.command.Scheduler;
+import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
 
 public class Robot extends IterativeRobot {
   public static OI oi;
   public static DriveTrain driveTrain;
   public static Shooter shooter;
+  public static IntakeArm intakeArm;
+
+  SendableChooser frontChooser;
+  boolean isFront;
+
+  CameraServer cameraServer;
 
   @Override
   public void robotInit() {
     driveTrain = new DriveTrain();
-    oi = new OI();
     shooter = new Shooter();
+    intakeArm = new IntakeArm();
+
+    oi = new OI();
+    isFront = true;
+
+    frontChooser = new SendableChooser();
+    frontChooser.addDefault("Intake is front", false);
+    frontChooser.addObject("Shooter is front", true);
+
+    SmartDashboard.putData("Front chooser", frontChooser);
+
+    cameraServer = CameraServer.getInstance();
+    cameraServer.setQuality(50);
+    cameraServer.startAutomaticCapture();
+
   }
 
   @Override
   public void autonomousInit() {
+    // get options chosen from drop down menu
+
+    isFront = (boolean) frontChooser.getSelected();
+
+    if (!isFront)
+      driveTrain.toggleFlipped();
+
+    Scheduler.getInstance().add(new TimeDrive(.6, 4));
   }
 
   @Override
   public void autonomousPeriodic() {
-    Scheduler.getInstance().run();
 
+    Scheduler.getInstance().run();
   }
 
   @Override
   public void teleopInit() {
+    if (!isFront)
+      driveTrain.toggleFlipped();
+    Scheduler.getInstance().add(new SetLowGear());
   }
 
   @Override
   public void teleopPeriodic() {
     Scheduler.getInstance().run();
-
   }
+
 }