1 package org
.usfirst
.frc
.team3501
.robot
;
3 import edu
.wpi
.cscore
.AxisCamera
;
4 import edu
.wpi
.cscore
.UsbCamera
;
5 import edu
.wpi
.cscore
.VideoSource
;
6 import edu
.wpi
.first
.wpilibj
.CameraServer
;
8 public class CameraFeeds
{
9 // private final int intakeCam;
10 // private final int climberCam;
11 private VideoSource curCam
;
12 private CameraServer server
;
13 private static UsbCamera intakeCam
;
14 private static AxisCamera climberCam
;
15 private static String usbCamName
;
16 private static String axisCamName
;
17 private static CameraFeeds cameraFeeds
= null;
19 @SuppressWarnings("deprecation")
20 private CameraFeeds(/* Joystick Button */) {
21 System
.out
.println("Enter CameraFeeds constructor");
22 server
= CameraServer
.getInstance();
23 climberCam
= server
.addAxisCamera("AxisCamera", "10.35.1.11");
24 intakeCam
= server
.startAutomaticCapture();
25 usbCamName
= intakeCam
.getName();
26 axisCamName
= climberCam
.getName();
29 System
.out
.println("Leaving CameraFeeds constructor");
32 public static CameraFeeds
getCameraFeeds() {
33 System
.out
.println("Enter CameraFeeds.getCameraFeeds");
34 if (cameraFeeds
== null) {
35 cameraFeeds
= new CameraFeeds();
37 System
.out
.println("Leaving CameraFeeds.getCameraFeeds");
42 System
.out
.println("Initializing...");
45 public void toggleCamera() {
46 System
.out
.println("enter toggleCamera");
47 if (curCam
.equals(intakeCam
)) {
48 changeCam(climberCam
);
50 System
.out
.println("Switching to climber camera.");
51 } else if (curCam
.equals(climberCam
)) {
54 System
.out
.println("Switching to intake camera.");
60 * Change the camera to get image from to a different one
64 public void changeCam(VideoSource cam
) {
65 System
.out
.println("Changing cameras...");