mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Leds active without vendor fov (#156)
* Changed out LED logic to always manipulate them if configured (rather than requiring vendor FOV)
This commit is contained in:
@@ -102,7 +102,7 @@ public class PhotonConfiguration {
|
||||
|
||||
var lightingConfig = new UILightingConfig();
|
||||
lightingConfig.brightness = hardwareSettings.ledBrightnessPercentage;
|
||||
lightingConfig.supported = Platform.isRaspberryPi(); // TODO check non pi??
|
||||
lightingConfig.supported = (hardwareConfig.ledPins.size() != 0);
|
||||
settingsSubmap.put("lighting", SerializationUtils.objectToHashMap(lightingConfig));
|
||||
|
||||
var generalSubmap = new HashMap<String, Object>();
|
||||
|
||||
@@ -131,7 +131,10 @@ public class VisionModule {
|
||||
var fov = ConfigManager.getInstance().getConfig().getHardwareConfig().vendorFOV;
|
||||
logger.info("Setting FOV of vendor camera to " + fov);
|
||||
visionSource.getSettables().setFOV(fov);
|
||||
}
|
||||
|
||||
// Configure LED's if supported by the underlying hardware
|
||||
if (HardwareManager.getInstance().visionLED != null) {
|
||||
HardwareManager.getInstance()
|
||||
.visionLED
|
||||
.setPipelineModeSupplier(() -> pipelineManager.getCurrentPipelineSettings().ledMode);
|
||||
@@ -271,7 +274,8 @@ public class VisionModule {
|
||||
}
|
||||
|
||||
private void setVisionLEDs(boolean on) {
|
||||
if (isVendorCamera()) HardwareManager.getInstance().visionLED.setState(on);
|
||||
if (HardwareManager.getInstance().visionLED != null)
|
||||
HardwareManager.getInstance().visionLED.setState(on);
|
||||
}
|
||||
|
||||
public void saveModule() {
|
||||
|
||||
Reference in New Issue
Block a user