Fix CSI camera exposure setting (#1665)

Adjusts the exposure setting of csi cameras to match that of USB
cameras. If you set a manual exposure it will drop out of auto exposure.
This commit is contained in:
Cameron (3539)
2025-01-01 14:21:54 -05:00
committed by GitHub
parent 34e9d5084c
commit 6065a3d70c

View File

@@ -124,16 +124,19 @@ public class LibcameraGpuSettables extends VisionSourceSettables {
@Override
public void setAutoExposure(boolean cameraAutoExposure) {
logger.debug("Setting auto exposure to " + cameraAutoExposure);
lastAutoExposureActive = cameraAutoExposure;
LibCameraJNI.setAutoExposure(r_ptr, cameraAutoExposure);
if (!cameraAutoExposure) {
setExposureRaw(lastManualExposure);
}
}
@Override
public void setExposureRaw(double exposureRaw) {
if (exposureRaw < 0.0 || lastAutoExposureActive) {
// Auto-exposure is active right now, don't set anything.
return;
}
logger.debug("Setting exposure to " + exposureRaw);
LibCameraJNI.setAutoExposure(r_ptr, false);
// Store the exposure for use when we need to recreate the camera.
lastManualExposure = exposureRaw;