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