remove position chooser and make one Sendable Chooser for the defense in front of...
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / Robot.java
CommitLineData
38a404b3
KZ
1package org.usfirst.frc.team3501.robot;
2
b378dfef 3import org.usfirst.frc.team3501.robot.Constants.Auton;
9e9154af
HD
4import org.usfirst.frc.team3501.robot.Constants.Defense;
5import org.usfirst.frc.team3501.robot.commands.auton.ChooseStrategy;
eeb6c3d9 6import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear;
e2c4d3a5 7import org.usfirst.frc.team3501.robot.commands.intakearm.Photogate;
047383c3 8import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
e47f0862 9import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
40348cab
E
10import org.usfirst.frc.team3501.robot.subsystems.Shooter;
11
38a404b3
KZ
12import edu.wpi.first.wpilibj.IterativeRobot;
13import edu.wpi.first.wpilibj.command.Scheduler;
9e9154af
HD
14import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
15import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
38a404b3
KZ
16
17public class Robot extends IterativeRobot {
18 public static OI oi;
19 public static DriveTrain driveTrain;
40348cab 20 public static Shooter shooter;
a96fa926 21 public static IntakeArm intakeArm;
e2c4d3a5 22 public static Photogate photogate;
3366a59a 23
9e9154af 24 // Sendable Choosers send a drop down menu to the Smart Dashboard.
de0cd1ce 25 SendableChooser defenseChooser;
9e9154af 26
38a404b3
KZ
27 @Override
28 public void robotInit() {
9742fe2e 29 driveTrain = new DriveTrain();
40348cab 30 shooter = new Shooter();
a96fa926 31 intakeArm = new IntakeArm();
fab544eb
HD
32
33 oi = new OI();
e2c4d3a5 34 photogate = new Photogate();
9e9154af 35
de0cd1ce
ME
36 defenseChooser = new SendableChooser();
37 addDefenseOptions(defenseChooser);
38 SmartDashboard.putData("Defense Chooser", defenseChooser);
9e9154af
HD
39 }
40
41 private void addDefenseOptions(SendableChooser chooser) {
42 chooser.addDefault("Portcullis", Defense.PORTCULLIS);
43 chooser.addObject("Sally Port", Defense.SALLY_PORT);
b378dfef
HD
44 chooser.addObject("Rough Terrain" + Auton.ROUGH_TERRAIN_SPEED + " "
45 + Auton.ROUGH_TERRAIN_TIME, Defense.ROUGH_TERRAIN);
949415d0 46 chooser.addObject("Low Bar" + " Will probably work...", Defense.LOW_BAR);
9e9154af
HD
47 chooser.addObject("Chival De Frise", Defense.CHIVAL_DE_FRISE);
48 chooser.addObject("Drawbridge", Defense.DRAWBRIDGE);
b378dfef
HD
49 chooser.addObject("Moat" + Auton.MOAT_SPEED + " " + Auton.MOAT_TIME,
50 Defense.MOAT);
de0cd1ce
ME
51 chooser.addObject(
52 "Rock Wall" + Auton.ROCK_WALL_SPEED + " " + Auton.ROCK_WALL_TIME,
53 Defense.ROCK_WALL);
29d59f48
ME
54 }
55
38a404b3
KZ
56 @Override
57 public void autonomousInit() {
de0cd1ce 58 Defense chosenDefense = (Defense) (defenseChooser.getSelected());
9e9154af 59
de0cd1ce 60 Scheduler.getInstance().add(new ChooseStrategy(chosenDefense));
35e19c59
HD
61
62 // Scheduler.getInstance().add(new TimeDrive(.6, 4));
38a404b3
KZ
63 }
64
65 @Override
66 public void autonomousPeriodic() {
67 Scheduler.getInstance().run();
38a404b3
KZ
68 }
69
70 @Override
71 public void teleopInit() {
eeb6c3d9 72 Scheduler.getInstance().add(new SetLowGear());
38a404b3
KZ
73 }
74
75 @Override
76 public void teleopPeriodic() {
77 Scheduler.getInstance().run();
1e039ebd
E
78 }
79
38a404b3 80}