diff --git a/photon-lib/src/main/java/org/photonvision/simulation/PhotonCameraSim.java b/photon-lib/src/main/java/org/photonvision/simulation/PhotonCameraSim.java index 1c9ef2ce1e..7ee78a19be 100644 --- a/photon-lib/src/main/java/org/photonvision/simulation/PhotonCameraSim.java +++ b/photon-lib/src/main/java/org/photonvision/simulation/PhotonCameraSim.java @@ -32,7 +32,7 @@ import edu.wpi.first.math.Pair; import edu.wpi.first.math.geometry.Pose3d; import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.util.RuntimeLoader; +import edu.wpi.first.util.CombinedRuntimeLoader; import edu.wpi.first.util.WPIUtilJNI; import java.util.ArrayList; import java.util.List; @@ -89,10 +89,7 @@ public class PhotonCameraSim implements AutoCloseable { static { try { - var loader = - new RuntimeLoader<>( - Core.NATIVE_LIBRARY_NAME, RuntimeLoader.getDefaultExtractionRoot(), Core.class); - loader.loadLibrary(); + CombinedRuntimeLoader.loadLibraries(OpenCVHelp.class, Core.NATIVE_LIBRARY_NAME, "cscorejni"); } catch (Exception e) { throw new RuntimeException("Failed to load native libraries!", e); } diff --git a/photon-lib/src/main/java/org/photonvision/simulation/VideoSimUtil.java b/photon-lib/src/main/java/org/photonvision/simulation/VideoSimUtil.java index 7a32e413a3..cc9ead27fb 100644 --- a/photon-lib/src/main/java/org/photonvision/simulation/VideoSimUtil.java +++ b/photon-lib/src/main/java/org/photonvision/simulation/VideoSimUtil.java @@ -28,7 +28,7 @@ import edu.wpi.first.math.geometry.Pose3d; import edu.wpi.first.math.geometry.Translation3d; import edu.wpi.first.math.util.Units; -import edu.wpi.first.util.RuntimeLoader; +import edu.wpi.first.util.CombinedRuntimeLoader; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.ArrayList; @@ -68,10 +68,7 @@ public class VideoSimUtil { static { try { - var loader = - new RuntimeLoader<>( - Core.NATIVE_LIBRARY_NAME, RuntimeLoader.getDefaultExtractionRoot(), Core.class); - loader.loadLibrary(); + CombinedRuntimeLoader.loadLibraries(OpenCVHelp.class, Core.NATIVE_LIBRARY_NAME, "cscorejni"); } catch (Exception e) { throw new RuntimeException("Failed to load native libraries!", e); } diff --git a/photon-lib/src/test/java/org/photonvision/OpenCVTest.java b/photon-lib/src/test/java/org/photonvision/OpenCVTest.java index e483833111..3cab3d496e 100644 --- a/photon-lib/src/test/java/org/photonvision/OpenCVTest.java +++ b/photon-lib/src/test/java/org/photonvision/OpenCVTest.java @@ -40,7 +40,6 @@ import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.networktables.NetworkTablesJNI; import edu.wpi.first.util.CombinedRuntimeLoader; -import edu.wpi.first.util.RuntimeLoader; import edu.wpi.first.util.WPIUtilJNI; import java.util.List; import org.junit.jupiter.api.BeforeAll; @@ -101,13 +100,9 @@ public static void setUp() { "ntcorejni", "wpinetjni", "wpiHaljni", + Core.NATIVE_LIBRARY_NAME, "cscorejni", - "cscorejnicvstatic"); - - var loader = - new RuntimeLoader<>( - Core.NATIVE_LIBRARY_NAME, RuntimeLoader.getDefaultExtractionRoot(), Core.class); - loader.loadLibrary(); + "apriltagjni"); } catch (Exception e) { e.printStackTrace(); } diff --git a/photon-lib/src/test/java/org/photonvision/VisionSystemSimTest.java b/photon-lib/src/test/java/org/photonvision/VisionSystemSimTest.java index c53e006717..d9ed86d8ed 100644 --- a/photon-lib/src/test/java/org/photonvision/VisionSystemSimTest.java +++ b/photon-lib/src/test/java/org/photonvision/VisionSystemSimTest.java @@ -46,7 +46,6 @@ import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.networktables.NetworkTablesJNI; import edu.wpi.first.util.CombinedRuntimeLoader; -import edu.wpi.first.util.RuntimeLoader; import edu.wpi.first.util.WPIUtilJNI; import java.util.ArrayList; import java.util.List; @@ -101,13 +100,9 @@ public static void setUp() { "ntcorejni", "wpinetjni", "wpiHaljni", + Core.NATIVE_LIBRARY_NAME, "cscorejni", - "cscorejnicvstatic"); - - var loader = - new RuntimeLoader<>( - Core.NATIVE_LIBRARY_NAME, RuntimeLoader.getDefaultExtractionRoot(), Core.class); - loader.loadLibrary(); + "apriltagjni"); } catch (Exception e) { e.printStackTrace(); } diff --git a/photon-targeting/src/main/java/org/photonvision/estimation/OpenCVHelp.java b/photon-targeting/src/main/java/org/photonvision/estimation/OpenCVHelp.java index 3f89918d62..e7028d58cc 100644 --- a/photon-targeting/src/main/java/org/photonvision/estimation/OpenCVHelp.java +++ b/photon-targeting/src/main/java/org/photonvision/estimation/OpenCVHelp.java @@ -26,7 +26,7 @@ import edu.wpi.first.math.geometry.Transform3d; import edu.wpi.first.math.geometry.Translation3d; import edu.wpi.first.math.numbers.*; -import edu.wpi.first.util.RuntimeLoader; +import edu.wpi.first.util.CombinedRuntimeLoader; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -54,10 +54,7 @@ public final class OpenCVHelp { static { try { - var loader = - new RuntimeLoader<>( - Core.NATIVE_LIBRARY_NAME, RuntimeLoader.getDefaultExtractionRoot(), Core.class); - loader.loadLibrary(); + CombinedRuntimeLoader.loadLibraries(OpenCVHelp.class, Core.NATIVE_LIBRARY_NAME, "cscorejni"); } catch (Exception e) { throw new RuntimeException("Failed to load native libraries!", e); }