Create branch just to run USB Camera.
[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.subsystems.DriveTrain;
4 import org.usfirst.frc.team3501.robot.subsystems.Intake;
5 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
6
7 import edu.wpi.cscore.UsbCamera;
8 import edu.wpi.first.wpilibj.CameraServer;
9 import edu.wpi.first.wpilibj.IterativeRobot;
10 import edu.wpi.first.wpilibj.command.Scheduler;
11
12 public class Robot extends IterativeRobot {
13 private static DriveTrain driveTrain;
14 private static Shooter shooter;
15 private static OI oi;
16 private static Intake intake;
17 private CameraServer server;
18 private static UsbCamera intakeCam;
19
20 @Override
21 public void robotInit() {
22 driveTrain = DriveTrain.getDriveTrain();
23 oi = OI.getOI();
24 shooter = Shooter.getShooter();
25 intake = Intake.getIntake();
26 server = CameraServer.getInstance();
27 intakeCam = server.startAutomaticCapture();
28 }
29
30 public static DriveTrain getDriveTrain() {
31 return DriveTrain.getDriveTrain();
32 }
33
34 public static Shooter getShooter() {
35 return Shooter.getShooter();
36 }
37
38 public static OI getOI() {
39 return OI.getOI();
40 }
41
42 public static Intake getIntake() {
43 return Intake.getIntake();
44 }
45
46 // If the gear values do not match in the left and right piston, then they are
47 // both set to high gear
48 @Override
49 public void autonomousInit() {
50 driveTrain.setHighGear();
51 }
52
53 @Override
54 public void autonomousPeriodic() {
55 Scheduler.getInstance().run();
56
57 }
58
59 @Override
60 public void teleopInit() {
61
62 }
63
64 @Override
65 public void teleopPeriodic() {
66 Scheduler.getInstance().run();
67 }
68 }