Skip to content

Commit

Permalink
Add StickyFPS quirk for Arducam OV2311 (PhotonVision#994)
Browse files Browse the repository at this point in the history
Disable setting first video mode on boot. Resolution is actually set immediately after
  • Loading branch information
superpenguin612 authored Nov 3, 2023
1 parent 5a4eb54 commit 5136dad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ public enum CameraQuirk {
CompletelyBroken,
/** Has adjustable focus and autofocus switch */
AdjustableFocus,
/** Changing FPS repeatedly with small delay does not work correctly */
StickyFPS,
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public class QuirkyCamera {
new QuirkyCamera(
-1, -1, "mmal service 16.1", CameraQuirk.PiCam), // PiCam (via V4L2, not zerocopy)
new QuirkyCamera(-1, -1, "unicam", CameraQuirk.PiCam), // PiCam (via V4L2, not zerocopy)
new QuirkyCamera(0x85B, 0x46D, CameraQuirk.AdjustableFocus) // Logitech C925-e
new QuirkyCamera(0x85B, 0x46D, CameraQuirk.AdjustableFocus), // Logitech C925-e
new QuirkyCamera(0x6366, 0x0c45, CameraQuirk.StickyFPS) // Arducam OV2311
);

public static final QuirkyCamera DefaultCamera = new QuirkyCamera(0, 0, "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public class USBCameraSettables extends VisionSourceSettables {
protected USBCameraSettables(CameraConfiguration configuration) {
super(configuration);
getAllVideoModes();
setVideoMode(videoModes.get(0));
if (!cameraQuirks.hasQuirk(CameraQuirk.StickyFPS))
setVideoMode(videoModes.get(0)); // fixes double FPS set
}

public void setAutoExposure(boolean cameraAutoExposure) {
Expand Down

0 comments on commit 5136dad

Please sign in to comment.