diff --git a/devTools/calibrationUtils.py b/devTools/calibrationUtils.py index ff710ca21b..b3348c8f48 100644 --- a/devTools/calibrationUtils.py +++ b/devTools/calibrationUtils.py @@ -139,9 +139,7 @@ def main(): parser = argparse.ArgumentParser( description="Convert Photon calibration JSON for use with mrcal" ) - parser.add_argument( - "input", type=str, help="Path to Photon calibration JSON file" - ) + parser.add_argument("input", type=str, help="Path to Photon calibration JSON file") parser.add_argument( "output_folder", type=str, help="Output folder for mrcal VNL file + images" ) diff --git a/photon-client/src/components/cameras/CameraCalibrationCard.vue b/photon-client/src/components/cameras/CameraCalibrationCard.vue index 8c96fea945..5f9e0b44b2 100644 --- a/photon-client/src/components/cameras/CameraCalibrationCard.vue +++ b/photon-client/src/components/cameras/CameraCalibrationCard.vue @@ -337,7 +337,7 @@ const setSelectedVideoFormat = (format: VideoFormat) => { rounded color="red" text-color="white" - style="margin: 10px 0" + class="mt-3" icon="mdi-alert-circle-outline" > MrCal JNI could not be loaded! Consult journalctl logs for additional details. diff --git a/photon-core/src/main/java/org/photonvision/common/configuration/PhotonConfiguration.java b/photon-core/src/main/java/org/photonvision/common/configuration/PhotonConfiguration.java index a799510baf..a20a3badea 100644 --- a/photon-core/src/main/java/org/photonvision/common/configuration/PhotonConfiguration.java +++ b/photon-core/src/main/java/org/photonvision/common/configuration/PhotonConfiguration.java @@ -27,7 +27,7 @@ import org.photonvision.common.hardware.Platform; import org.photonvision.common.networking.NetworkUtils; import org.photonvision.common.util.SerializationUtils; -import org.photonvision.mrcal.MrCal; +import org.photonvision.mrcal.MrCalJNILoader; import org.photonvision.raspi.LibCameraJNILoader; import org.photonvision.vision.calibration.CameraCalibrationCoefficients; import org.photonvision.vision.processes.VisionModule; @@ -141,7 +141,7 @@ public Map toHashMap() { LibCameraJNILoader.isSupported() ? "Zerocopy Libcamera Working" : ""); // TODO add support for other types of GPU accel - generalSubmap.put("mrCalWorking", MrCal.isWorking()); + generalSubmap.put("mrCalWorking", MrCalJNILoader.isWorking()); generalSubmap.put("hardwareModel", hardwareConfig.deviceName); generalSubmap.put("hardwarePlatform", Platform.getPlatformName()); settingsSubmap.put("general", generalSubmap); diff --git a/photon-core/src/main/java/org/photonvision/mrcal/MrCal.java b/photon-core/src/main/java/org/photonvision/mrcal/MrCalJNILoader.java similarity index 90% rename from photon-core/src/main/java/org/photonvision/mrcal/MrCal.java rename to photon-core/src/main/java/org/photonvision/mrcal/MrCalJNILoader.java index 1b59cf9af6..a11f0ca758 100644 --- a/photon-core/src/main/java/org/photonvision/mrcal/MrCal.java +++ b/photon-core/src/main/java/org/photonvision/mrcal/MrCalJNILoader.java @@ -23,7 +23,7 @@ import org.photonvision.common.util.TestUtils; import org.photonvision.jni.PhotonJniCommon; -public class MrCal extends PhotonJniCommon { +public class MrCalJNILoader extends PhotonJniCommon { public static synchronized void forceLoad() throws IOException { // Force load opencv TestUtils.loadLibraries(); @@ -32,7 +32,7 @@ public static synchronized void forceLoad() throws IOException { if (Platform.isWindows()) { // Order is correct to match dependencies of libraries forceLoad( - MrCal.class, + MrCalJNILoader.class, List.of( "libamd", "libcamd", @@ -46,10 +46,10 @@ public static synchronized void forceLoad() throws IOException { "mrcal_jni")); } else { // Nothing else to do on linux - forceLoad(MrCal.class, List.of("mrcal_jni")); + forceLoad(MrCalJNILoader.class, List.of("mrcal_jni")); } - if (!MrCal.isWorking()) { + if (!MrCalJNILoader.isWorking()) { throw new IOException("Can't load mrcal?"); } } diff --git a/photon-core/src/main/java/org/photonvision/vision/pipe/impl/Calibrate3dPipe.java b/photon-core/src/main/java/org/photonvision/vision/pipe/impl/Calibrate3dPipe.java index 6f8a062861..c249f71c71 100644 --- a/photon-core/src/main/java/org/photonvision/vision/pipe/impl/Calibrate3dPipe.java +++ b/photon-core/src/main/java/org/photonvision/vision/pipe/impl/Calibrate3dPipe.java @@ -32,9 +32,9 @@ import org.photonvision.common.logging.LogGroup; import org.photonvision.common.logging.Logger; import org.photonvision.common.util.math.MathUtils; -import org.photonvision.mrcal.MrCal; import org.photonvision.mrcal.MrCalJNI; import org.photonvision.mrcal.MrCalJNI.MrCalResult; +import org.photonvision.mrcal.MrCalJNILoader; import org.photonvision.vision.calibration.BoardObservation; import org.photonvision.vision.calibration.CameraCalibrationCoefficients; import org.photonvision.vision.calibration.JsonImageMat; @@ -79,7 +79,7 @@ protected CameraCalibrationCoefficients process( && it.size != null) .collect(Collectors.toList()); - if (MrCal.isWorking() && params.useMrCal) { + if (MrCalJNILoader.isWorking() && params.useMrCal) { logger.debug("Calibrating with mrcal!"); return process_mrcal(in); } else { diff --git a/photon-core/src/test/java/org/photonvision/vision/pipeline/Calibrate3dPipeTest.java b/photon-core/src/test/java/org/photonvision/vision/pipeline/Calibrate3dPipeTest.java index d6822baef5..924e7c6feb 100644 --- a/photon-core/src/test/java/org/photonvision/vision/pipeline/Calibrate3dPipeTest.java +++ b/photon-core/src/test/java/org/photonvision/vision/pipeline/Calibrate3dPipeTest.java @@ -36,7 +36,7 @@ import org.photonvision.common.logging.LogLevel; import org.photonvision.common.logging.Logger; import org.photonvision.common.util.TestUtils; -import org.photonvision.mrcal.MrCal; +import org.photonvision.mrcal.MrCalJNILoader; import org.photonvision.vision.calibration.CameraCalibrationCoefficients; import org.photonvision.vision.camera.QuirkyCamera; import org.photonvision.vision.frame.Frame; @@ -49,7 +49,7 @@ public class Calibrate3dPipeTest { @BeforeAll public static void init() throws IOException { TestUtils.loadLibraries(); - MrCal.forceLoad(); + MrCalJNILoader.forceLoad(); var logLevel = LogLevel.DEBUG; Logger.setLevel(LogGroup.Camera, logLevel); diff --git a/photon-server/src/main/java/org/photonvision/Main.java b/photon-server/src/main/java/org/photonvision/Main.java index cdd9b0a535..a225299a96 100644 --- a/photon-server/src/main/java/org/photonvision/Main.java +++ b/photon-server/src/main/java/org/photonvision/Main.java @@ -37,7 +37,7 @@ import org.photonvision.common.networking.NetworkManager; import org.photonvision.common.util.TestUtils; import org.photonvision.common.util.numbers.IntegerCouple; -import org.photonvision.mrcal.MrCal; +import org.photonvision.mrcal.MrCalJNILoader; import org.photonvision.raspi.LibCameraJNILoader; import org.photonvision.server.Server; import org.photonvision.vision.camera.FileVisionSource; @@ -319,7 +319,7 @@ public static void main(String[] args) { } try { - MrCal.forceLoad(); + MrCalJNILoader.forceLoad(); } catch (IOException e) { logger.error("Failed to load mrcal-JNI! Camera calibration will fall back to opencv", e); }