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