add cameras
[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
18 @Override
19 public void robotInit() {
20 driveTrain = DriveTrain.getDriveTrain();
21 oi = OI.getOI();
22 shooter = Shooter.getShooter();
23 intake = Intake.getIntake();
24 CameraServer server = CameraServer.getInstance();
25 UsbCamera climberCam = server.startAutomaticCapture("climbercam", 0);
26 UsbCamera intakeCam = server.startAutomaticCapture("intakecam", 1);
27 }
28
29 public static DriveTrain getDriveTrain() {
30 return DriveTrain.getDriveTrain();
31 }
32
33 public static Shooter getShooter() {
34 return Shooter.getShooter();
35 }
36
37 public static OI getOI() {
38 return OI.getOI();
39 }
40
41 public static Intake getIntake() {
42 return Intake.getIntake();
43 }
44
45 // If the gear values do not match in the left and right piston, then they are
46 // both set to high gear
47 @Override
48 public void autonomousInit() {
49 driveTrain.setHighGear();
50 }
51
52 @Override
53 public void autonomousPeriodic() {
54 Scheduler.getInstance().run();
55 }
56
57 @Override
58 public void teleopInit() {
59
60 }
61
62 @Override
63 public void teleopPeriodic() {
64 Scheduler.getInstance().run();
65 }
66 }