X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2FCameraFeeds.java;h=94501567cbac31e47e2ef70a9da5ae4815b3763b;hb=93d8373fe56e8036848f7d092855cb0819702b50;hp=f5d0384121d24ef8663d339f8e62ed8bb377f603;hpb=85c0135e3b2fd0da59a855b65a99511798157845;p=3501%2F2017steamworks diff --git a/src/org/usfirst/frc/team3501/robot/CameraFeeds.java b/src/org/usfirst/frc/team3501/robot/CameraFeeds.java index f5d0384..9450156 100755 --- a/src/org/usfirst/frc/team3501/robot/CameraFeeds.java +++ b/src/org/usfirst/frc/team3501/robot/CameraFeeds.java @@ -17,21 +17,7 @@ public class CameraFeeds { private static CameraFeeds cameraFeeds = null; @SuppressWarnings("deprecation") - public CameraFeeds(/* Joystick Button */) { - // Get camera id by supplying camera name example 'cam0', found on roborio - // web - // interface - /* - * intakeCam = - * NIVision.IMAQdxOpenCamera(Constants.CameraFeeds.camNameCenter, - * NIVision.IMAQdxCameraControlMode.CameraControlModeController); climberCam - * = NIVision.IMAQdxOpenCamera(Constants.CameraFeeds.camNameRight, - * NIVision.IMAQdxCameraControlMode.CameraControlModeController); curCam = - * intakeCam; // Image that will contain camera image frame = - * NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0); // Server that - * we'll give the image to server = CameraServer.getInstance(); - * server.setSize(Constants.CameraFeeds.imgQuality); - */ + private CameraFeeds(/* Joystick Button */) { usbCamName = intakeCam.getName(); axisCamName = climberCam.getName(); @@ -39,10 +25,9 @@ public class CameraFeeds { climberCam = server.addAxisCamera(axisCamName, "10.35.1.11"); intakeCam = server.startAutomaticCapture(); curCam = intakeCam; - - // server = CameraServer.getInstance(); - // axisCamera = cameraServer2.addAxisCamera("axisCamera", "10.35.1.11"); - // cameraFeeds = new CameraFeeds(); + curCam = climberCam; + usbCamName = intakeCam.getName(); + axisCamName = climberCam.getName(); } public static CameraFeeds getCameraFeeds() { @@ -58,6 +43,7 @@ public class CameraFeeds { } public void toggleCamera() { + System.out.println("enter toggleCamer"); if (curCam.equals(intakeCam)) { // changeCam(climberCam); curCam = climberCam; @@ -90,5 +76,12 @@ public class CameraFeeds { System.out.println("Switching to intake camera."); return; } + System.out.println("change camera"); + server.removeCamera(curCam.getName()); + server.addCamera(cam); + } + + public String getCurrentCamName() { + return curCam.getName(); } }