Try to understand why axis camera does turn on while toggling.
[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.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 static UsbCamera usbCamera;
18 private static CameraServer cameraServer2;
19 private static AxisCamera axisCamera;
20 private static CameraFeeds cameraFeeds;
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 cameraServer2 = CameraServer.getInstance();
30 axisCamera = cameraServer2.addAxisCamera("axisCamera", "10.35.1.11");
31
32 cameraFeeds = new CameraFeeds();
33
34 }
35
36 public static DriveTrain getDriveTrain() {
37 return DriveTrain.getDriveTrain();
38 }
39
40 public static Shooter getShooter() {
41 return Shooter.getShooter();
42 }
43
44 public static OI getOI() {
45 return OI.getOI();
46 }
47
48 public static Intake getIntake() {
49 return Intake.getIntake();
50 }
51
52 // If the gear values do not match in the left and right piston, then they are
53 // both set to high gear
54 @Override
55 public void autonomousInit() {
56 driveTrain.setHighGear();
57 }
58
59 @Override
60 public void autonomousPeriodic() {
61 Scheduler.getInstance().run();
62
63 }
64
65 @Override
66 public void teleopInit() {
67 cameraFeeds.init();
68 }
69
70 @Override
71 public void teleopPeriodic() {
72 Scheduler.getInstance().run();
73 }
74 }