setup command and chooser
authorEvanYap <evanyap.14@gmail.com>
Fri, 3 Feb 2017 03:21:12 +0000 (19:21 -0800)
committerEvanYap <evanyap.14@gmail.com>
Fri, 3 Feb 2017 03:21:12 +0000 (19:21 -0800)
src/org/usfirst/frc/team3501/robot/Robot.java

index 4681b192fd951470578c3148809f76e6b862ba1a..9d87c50183ab81e60006afcd78de2d620e167182 100644 (file)
@@ -5,7 +5,9 @@ import org.usfirst.frc.team3501.robot.subsystems.Intake;
 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
 
 import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.command.CommandGroup;
 import edu.wpi.first.wpilibj.command.Scheduler;
+import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
 
 public class Robot extends IterativeRobot {
 
@@ -13,6 +15,8 @@ public class Robot extends IterativeRobot {
   private static Shooter shooter;
   private static OI oi;
   private static Intake intake;
+  private static CommandGroup commandGroup;
+  private static SendableChooser chooser;
 
   @Override
   public void robotInit() {
@@ -20,8 +24,8 @@ public class Robot extends IterativeRobot {
     oi = OI.getOI();
     shooter = Shooter.getShooter();
     intake = Intake.getIntake();
+    chooser = new SendableChooser();
 
-    // init
   }
 
   public static DriveTrain getDriveTrain() {
@@ -43,12 +47,14 @@ public class Robot extends IterativeRobot {
   @Override
   public void autonomousInit() {
     Scheduler.getInstance();
+    commandGroup = (CommandGroup) chooser.getSelected();
+    commandGroup.start();
+
   }
 
   @Override
   public void autonomousPeriodic() {
     Scheduler.getInstance().run();
-
   }
 
   @Override