Automatically detect and report hardware model for most SBCs (#1540)

ARM-based machines populate the device model into Device Tree. We can
use this information to automatically detect and report the hardware
model for most Single Board Computers (SBCs). Vendors who want to
override this can still do so via the value in the configuration
database.
This commit is contained in:
Stephen Just
2024-11-10 13:49:29 -08:00
committed by GitHub
parent 2ea4da0f1e
commit b5d48a6503
2 changed files with 65 additions and 11 deletions

View File

@@ -151,7 +151,11 @@ public class PhotonConfiguration {
generalSubmap.put("availableModels", NeuralNetworkModelManager.getInstance().getModels());
generalSubmap.put(
"supportedBackends", NeuralNetworkModelManager.getInstance().getSupportedBackends());
generalSubmap.put("hardwareModel", hardwareConfig.deviceName);
generalSubmap.put(
"hardwareModel",
hardwareConfig.deviceName.isEmpty()
? Platform.getHardwareModel()
: hardwareConfig.deviceName);
generalSubmap.put("hardwarePlatform", Platform.getPlatformName());
settingsSubmap.put("general", generalSubmap);
// AprilTagFieldLayout