mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user