1 package org
.usfirst
.frc
.team3501
.robot
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
.Auton
;
4 import org
.usfirst
.frc
.team3501
.robot
.Constants
.Defense
;
5 import org
.usfirst
.frc
.team3501
.robot
.commands
.auton
.ChooseStrategy
;
6 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.SetLowGear
;
7 import org
.usfirst
.frc
.team3501
.robot
.commands
.intakearm
.Photogate
;
8 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.DriveTrain
;
9 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.IntakeArm
;
10 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.Shooter
;
12 import edu
.wpi
.first
.wpilibj
.IterativeRobot
;
13 import edu
.wpi
.first
.wpilibj
.command
.Scheduler
;
14 import edu
.wpi
.first
.wpilibj
.smartdashboard
.SendableChooser
;
15 import edu
.wpi
.first
.wpilibj
.smartdashboard
.SmartDashboard
;
17 public class Robot
extends IterativeRobot
{
19 public static DriveTrain driveTrain
;
20 public static Shooter shooter
;
21 public static IntakeArm intakeArm
;
22 public static Photogate photogate
;
24 // Sendable Choosers send a drop down menu to the Smart Dashboard.
25 SendableChooser defenseChooser
;
28 public void robotInit() {
29 driveTrain
= new DriveTrain();
30 shooter
= new Shooter();
31 intakeArm
= new IntakeArm();
34 photogate
= new Photogate();
36 defenseChooser
= new SendableChooser();
37 addDefenseOptions(defenseChooser
);
38 SmartDashboard
.putData("Defense Chooser", defenseChooser
);
41 private void addDefenseOptions(SendableChooser chooser
) {
42 chooser
.addDefault("Portcullis", Defense
.PORTCULLIS
);
43 chooser
.addObject("Sally Port", Defense
.SALLY_PORT
);
44 chooser
.addObject("Rough Terrain" + Auton
.ROUGH_TERRAIN_SPEED
+ " "
45 + Auton
.ROUGH_TERRAIN_TIME
, Defense
.ROUGH_TERRAIN
);
46 chooser
.addObject("Low Bar" + " Will probably work...", Defense
.LOW_BAR
);
47 chooser
.addObject("Chival De Frise", Defense
.CHIVAL_DE_FRISE
);
48 chooser
.addObject("Drawbridge", Defense
.DRAWBRIDGE
);
49 chooser
.addObject("Moat" + Auton
.MOAT_SPEED
+ " " + Auton
.MOAT_TIME
,
52 "Rock Wall" + Auton
.ROCK_WALL_SPEED
+ " " + Auton
.ROCK_WALL_TIME
,
54 chooser
.addObject("No Auton", Defense
.NONE
);
58 public void autonomousInit() {
59 Defense chosenDefense
= (Defense
) (defenseChooser
.getSelected());
61 Scheduler
.getInstance().add(new ChooseStrategy(chosenDefense
));
63 // Scheduler.getInstance().add(new TimeDrive(.6, 4));
67 public void autonomousPeriodic() {
68 Scheduler
.getInstance().run();
72 public void teleopInit() {
73 Scheduler
.getInstance().add(new SetLowGear());
77 public void teleopPeriodic() {
78 Scheduler
.getInstance().run();