Skip to content

Commit

Permalink
See3Cam_24CUG Quirks (#1302)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt <[email protected]>
Co-authored-by: Chris Gerth <[email protected]>
  • Loading branch information
3 people committed Sep 24, 2024
1 parent a8daff3 commit b7cab04
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ public enum CameraQuirk {
ArduOV2311Controls,
ArduOV9782Controls,
/**
* Camera is innomaker USB OV9281 which also has incorrect v4l exposure times Real range is more
* like 0-500
* Camera is one brand of USB OV9281 which also has incorrect v4l exposure times Real range is
* more like 0-500
*/
InnoOV9281Controls,
ArduOV9782,
/** Camera has odd exposure range, and supports gain control */
See3Cam_24CUG,
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
public class QuirkyCamera {
private static final List<QuirkyCamera> quirkyCameras =
List.of(
// SeeCam, which has an odd exposure range
new QuirkyCamera(
0x2560, 0xc128, "See3Cam_24CUG", CameraQuirk.Gain, CameraQuirk.See3Cam_24CUG),
// Chris's older generic "Logitec HD Webcam"
new QuirkyCamera(0x9331, 0x5A3, CameraQuirk.CompletelyBroken),
// Logitec C270
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (C) Photon Vision.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package org.photonvision.vision.camera.USBCameras;

import edu.wpi.first.cscore.UsbCamera;
import org.photonvision.common.configuration.CameraConfiguration;

/*
* This class holds the camera quirks for the See3Cam 24UGS.
*/
public class See3Cam24CUGSettables extends GenericUSBCameraSettables {
public See3Cam24CUGSettables(CameraConfiguration configuration, UsbCamera camera) {
super(configuration, camera);
}

@Override
protected void setUpExposureProperties() {
super.setUpExposureProperties();

// Property limits are incorrect
this.minExposure = 0;
this.maxExposure = 600;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ protected GenericUSBCameraSettables createSettables(
settables = new ArduOV9782CameraSettables(config, camera);
} else if (quirks.hasQuirk(CameraQuirk.InnoOV9281Controls)) {
settables = new InnoOV9281CameraSettables(config, camera);
} else if (quirks.hasQuirk(CameraQuirk.See3Cam_24CUG)) {
settables = new See3Cam24CUGSettables(config, camera);
} else {
logger.debug("Using Generic USB Cam Settables");
settables = new GenericUSBCameraSettables(config, camera);
Expand Down

0 comments on commit b7cab04

Please sign in to comment.