33
44import org .usfirst .frc .team199 .Robot2018 .subsystems .Climber ;
55import org .usfirst .frc .team199 .Robot2018 .subsystems .ClimberAssist ;
6+ import org .usfirst .frc .team199 .Robot2018 .subsystems .Drivetrain ;
67import org .usfirst .frc .team199 .Robot2018 .subsystems .IntakeEject ;
8+ import org .usfirst .frc .team199 .Robot2018 .subsystems .LeftDrive ;
79import org .usfirst .frc .team199 .Robot2018 .subsystems .Lift ;
10+ import org .usfirst .frc .team199 .Robot2018 .subsystems .RightDrive ;
811
9- import edu .wpi .first .wpilibj .IterativeRobot ;
1012import edu .wpi .first .wpilibj .TimedRobot ;
1113import edu .wpi .first .wpilibj .command .Command ;
1214import edu .wpi .first .wpilibj .command .Scheduler ;
13- import edu .wpi .first .wpilibj .livewindow .LiveWindow ;
1415import edu .wpi .first .wpilibj .smartdashboard .SendableChooser ;
1516import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
1617
2223 * directory.
2324 */
2425public class Robot extends TimedRobot {
25-
26- public static final Climber climber = new Climber ();
27- public static final ClimberAssist climberAssist = new ClimberAssist ();
28- public static final IntakeEject intakeEject = new IntakeEject ();
29- public static final Lift lift = new Lift ();
26+
27+ public static Climber climber ;
28+ public static ClimberAssist climberAssist ;
29+ public static IntakeEject intakeEject ;
30+ public static Lift lift ;
31+ public static RobotMap rmap ;
32+ public static Drivetrain dt ;
33+ public static LeftDrive ld ;
34+ public static RightDrive rd ;
35+ public static Listener listen ;
36+
3037 public static OI oi ;
3138
3239 Command autonomousCommand ;
3340 SendableChooser <Command > chooser = new SendableChooser <>();
3441
42+ public static double getConst (String key , double def ) {
43+ if (!SmartDashboard .containsKey ("Const/" + key )) {
44+ SmartDashboard .putNumber ("Const/" + key , def );
45+ }
46+ return SmartDashboard .getNumber ("Const/" + key , def );
47+ }
48+
49+ public static boolean getBool (String key , boolean def ) {
50+ if (!SmartDashboard .containsKey ("Bool/" + key )) {
51+ SmartDashboard .putBoolean ("Bool/" + key , def );
52+ }
53+ return SmartDashboard .getBoolean ("Bool/" + key , def );
54+ }
55+
3556 /**
36- * This function is run when the robot is first started up and should be
37- * used for any initialization code.
57+ * This function is run when the robot is first started up and should be used
58+ * for any initialization code.
3859 */
3960 @ Override
4061 public void robotInit () {
62+ rmap = new RobotMap ();
63+ climber = new Climber ();
64+ climberAssist = new ClimberAssist ();
65+ intakeEject = new IntakeEject ();
66+ lift = new Lift ();
67+ dt = new Drivetrain ();
68+ ld = new LeftDrive ();
69+ rd = new RightDrive ();
4170 oi = new OI ();
71+ listen = new Listener ();
4272 // chooser.addObject("My Auto", new MyAutoCommand());
4373 SmartDashboard .putData ("Auto mode" , chooser );
4474 }
4575
4676 /**
47- * This function is called once each time the robot enters Disabled mode.
48- * You can use it to reset any subsystem information you want to clear when
49- * the robot is disabled.
77+ * This function is called once each time the robot enters Disabled mode. You
78+ * can use it to reset any subsystem information you want to clear when the
79+ * robot is disabled.
5080 */
5181 @ Override
5282 public void disabledInit () {
@@ -60,24 +90,24 @@ public void disabledPeriodic() {
6090
6191 /**
6292 * This autonomous (along with the chooser code above) shows how to select
63- * between different autonomous modes using the dashboard. The sendable
64- * chooser code works with the Java SmartDashboard. If you prefer the
65- * LabVIEW Dashboard, remove all of the chooser code and uncomment the
66- * getString code to get the auto name from the text box below the Gyro
93+ * between different autonomous modes using the dashboard. The sendable chooser
94+ * code works with the Java SmartDashboard. If you prefer the LabVIEW Dashboard,
95+ * remove all of the chooser code and uncomment the getString code to get the
96+ * auto name from the text box below the Gyro
6797 *
6898 * You can add additional auto modes by adding additional commands to the
69- * chooser code above (like the commented example) or additional comparisons
70- * to the switch structure below with additional strings & commands.
99+ * chooser code above (like the commented example) or additional comparisons to
100+ * the switch structure below with additional strings & commands.
71101 */
72102 @ Override
73103 public void autonomousInit () {
74104 autonomousCommand = chooser .getSelected ();
75105
76106 /*
77- * String autoSelected = SmartDashboard.getString("Auto Selector",
78- * "Default"); switch(autoSelected) { case "My Auto": autonomousCommand
79- * = new MyAutoCommand(); break; case "Default Auto": default:
80- * autonomousCommand = new ExampleCommand(); break; }
107+ * String autoSelected = SmartDashboard.getString("Auto Selector", "Default");
108+ * switch(autoSelected) { case "My Auto": autonomousCommand = new
109+ * MyAutoCommand(); break; case "Default Auto": default: autonomousCommand = new
110+ * ExampleCommand(); break; }
81111 */
82112
83113 // schedule the autonomous command (example)
0 commit comments