db5e469ff3be6a031e0efbfc571c6a9a13727cfd
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / Robot.java
1 package org.usfirst.frc.team3501.robot;
2
3 import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
4 import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
5 import org.usfirst.frc.team3501.robot.subsystems.Intake;
6 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
7
8 import edu.wpi.first.wpilibj.IterativeRobot;
9 import edu.wpi.first.wpilibj.command.Scheduler;
10
11 public class Robot extends IterativeRobot {
12 private static DriveTrain driveTrain;
13 private static Shooter shooter;
14 private static OI oi;
15 private static Intake intake;
16
17 @Override
18 public void robotInit() {
19 driveTrain = DriveTrain.getDriveTrain();
20 oi = OI.getOI();
21 shooter = Shooter.getShooter();
22 intake = Intake.getIntake();
23 }
24
25 public static DriveTrain getDriveTrain() {
26 return DriveTrain.getDriveTrain();
27 }
28
29 public static Shooter getShooter() {
30 return Shooter.getShooter();
31 }
32
33 public static OI getOI() {
34 return OI.getOI();
35 }
36
37 public static Intake getIntake() {
38 return Intake.getIntake();
39 }
40
41 // If the gear values do not match in the left and right piston, then they are
42 // both set to high gear
43 @Override
44 public void autonomousInit() {
45 Scheduler.getInstance().add(new DriveDistance(25, 10));
46 if (driveTrain.getLeftGearPistonValue() != driveTrain
47 .getRightGearPistonValue()) {
48 driveTrain.setHighGear();
49 }
50 }
51
52 @Override
53 public void autonomousPeriodic() {
54 Scheduler.getInstance().run();
55
56 }
57
58 @Override
59 public void teleopInit() {
60
61 }
62
63 @Override
64 public void teleopPeriodic() {
65 Scheduler.getInstance().run();
66
67 }
68 }