Fix small bug in toggle.
authorRayan Hirech <ramine411@gmail.com>
Tue, 7 Feb 2017 04:50:06 +0000 (20:50 -0800)
committerRayan Hirech <ramine411@gmail.com>
Tue, 7 Feb 2017 04:50:06 +0000 (20:50 -0800)
src/org/usfirst/frc/team3501/robot/CameraFeeds.java

index e59b8ecc75257a1ec90282f66d6bf33b794fc0a8..15ea3695efe43ba65a1743d32568fb9898c5ebda 100755 (executable)
@@ -15,11 +15,11 @@ public class CameraFeeds {
   private static String usbCamName;
   private static String axisCamName;
   private static CameraFeeds cameraFeeds = null;
 
   @SuppressWarnings("deprecation")
   public CameraFeeds(/* Joystick Button */) {
-    // Get camera id by supplying camera name example 'cam0', found on roborio web
+    // Get camera id by supplying camera name example 'cam0', found on roborio
+    // web
     // interface
     /*
      * intakeCam =
@@ -44,29 +44,32 @@ public class CameraFeeds {
     // axisCamera = cameraServer2.addAxisCamera("axisCamera", "10.35.1.11");
     // cameraFeeds = new CameraFeeds();
   }
-  
+
   public static CameraFeeds getCameraFeeds() {
-         if (cameraFeeds == null) {
-                 cameraFeeds = new CameraFeeds();
-         }
-         return cameraFeeds;
-         
-         
+    if (cameraFeeds == null) {
+      cameraFeeds = new CameraFeeds();
+    }
+    return cameraFeeds;
+
   }
 
   public void init() {
-    changeCam(intakeCam);
+    changeCam(climberCam);
   }
 
   public void toggleCamera() {
     if (curCam.equals(intakeCam)) {
       changeCam(climberCam);
       curCam = climberCam;
+      System.out.println("Switching to climber camera.");
+      return;
     }
 
     if (curCam.equals(climberCam)) {
       changeCam(intakeCam);
       curCam = intakeCam;
+      System.out.println("Switching to intake camera.");
+      return;
     }
   }
 
@@ -74,8 +77,7 @@ public class CameraFeeds {
    *
    * Change the camera to get image from to a different one
    *
-   * newId
-   *          for camera
+   * newId for camera
    */
   public void changeCam(VideoSource cam) {
     server.removeCamera(axisCamName);