implement singleton pattern for climber and shooter subsystems
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / Robot.java
CommitLineData
38a404b3
KZ
1package org.usfirst.frc.team3501.robot;
2
b081e34b 3import org.usfirst.frc.team3501.robot.commands.driving.TimeDrive;
079a8cb6 4import org.usfirst.frc.team3501.robot.subsystems.Climber;
cca02549 5import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
079a8cb6 6import org.usfirst.frc.team3501.robot.subsystems.Shooter;
6acd1f1b 7
38a404b3
KZ
8import edu.wpi.first.wpilibj.IterativeRobot;
9import edu.wpi.first.wpilibj.command.Scheduler;
10
11public class Robot extends IterativeRobot {
6acd1f1b
CZ
12 private static DriveTrain driveTrain;
13 private static OI oi;
079a8cb6
CZ
14 private static Climber climber;
15 private static Shooter shooter;
38a404b3
KZ
16
17 @Override
18 public void robotInit() {
6acd1f1b
CZ
19 driveTrain = DriveTrain.getDriveTrain();
20 oi = OI.getOI();
079a8cb6
CZ
21 climber = Climber.getClimber();
22 shooter = Shooter.getShooter();
23
cca02549 24 }
6acd1f1b
CZ
25
26 public static DriveTrain getDriveTrain() {
27 return DriveTrain.getDriveTrain();
cca02549 28 }
6acd1f1b
CZ
29
30 public static OI getOI() {
31 return OI.getOI();
38a404b3
KZ
32 }
33
079a8cb6
CZ
34 public static Climber getClimber() {
35 return Climber.getClimber();
36 }
37
38 public static Shooter getShooter() {
39 return Shooter.getShooter();
40 }
41
38a404b3
KZ
42 @Override
43 public void autonomousInit() {
b081e34b 44 Scheduler.getInstance().add(new TimeDrive(1.5, 0.4));
38a404b3
KZ
45 }
46
47 @Override
48 public void autonomousPeriodic() {
49 Scheduler.getInstance().run();
50
51 }
52
53 @Override
54 public void teleopInit() {
55 }
56
57 @Override
58 public void teleopPeriodic() {
59 Scheduler.getInstance().run();
60
61 }
62}