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:
Chris Gerth
2020-11-11 13:06:51 -06:00
committed by GitHub
parent 3f48346557
commit e74f750fc0
2 changed files with 6 additions and 2 deletions

View File

@@ -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>();

View File

@@ -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() {