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