diff --git a/photon-lib/src/main/java/org/photonvision/PhotonCamera.java b/photon-lib/src/main/java/org/photonvision/PhotonCamera.java index feb3885f8e..0f150c3666 100644 --- a/photon-lib/src/main/java/org/photonvision/PhotonCamera.java +++ b/photon-lib/src/main/java/org/photonvision/PhotonCamera.java @@ -28,7 +28,6 @@ import java.util.Arrays; import java.util.List; import java.util.Optional; -import org.opencv.core.Core; import org.photonvision.common.hardware.VisionLEDMode; import org.photonvision.common.networktables.PacketSubscriber; import org.photonvision.targeting.PhotonPipelineResult; @@ -184,61 +183,6 @@ public PhotonCamera(NetworkTableInstance instance, String cameraName) { // HACK - start a TimeSyncServer, if we haven't yet. TimeSyncSingleton.load(); - - // HACK - check if things are compatible - verifyDependencies(); - } - - /** This is something we only need to check for java because of the way java packages opencv. */ - static void verifyDependencies() { - // spotless:off - // WPILIB names their opencv version in the format YEAR-OPENCVVERSION-PATCH - // so we split on '-' and take the middle part to get the version number - if (!Core.VERSION.equals(PhotonVersion.opencvTargetVersion.split("-")[1])) { - String bfw = """ - - - - - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\s - >>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\s - >>> \s - >>> You are running an incompatible version \s - >>> of PhotonVision ! \s - >>> \s - >>> PhotonLib """ - + PhotonVersion.versionString - + " is built for OpenCV " - + PhotonVersion.opencvTargetVersion - + "\n" - + ">>> but you are using OpenCV " - + Core.VERSION - + """ - \n>>> \s - >>> This is neither tested nor supported. \s - >>> You MUST update WPILib, PhotonLib, or both. - >>> Check `./gradlew dependencies` and ensure\s - >>> all mentions of OpenCV match the version \s - >>> that PhotonLib was built for. If you find a - >>> a mismatched version in a dependency, you\s - >>> must take steps to update the version of \s - >>> OpenCV used in that dependency. If you do\s - >>> not control that dependency and an updated\s - >>> version is not available, contact the \s - >>> developers of that dependency. \s - >>> \s - >>> Your code will now crash. \s - >>> We hope your day gets better. \s - >>> \s - >>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\s - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\s - """; - // spotless:on - - DriverStationErrors.reportWarning(bfw, false); - DriverStationErrors.reportError(bfw, false); - throw new UnsupportedOperationException(bfw); - } } /** diff --git a/photon-lib/src/test/java/org/photonvision/PhotonVersionTest.java b/photon-lib/src/test/java/org/photonvision/PhotonVersionTest.java index f21c8957fc..5e2401ff0e 100644 --- a/photon-lib/src/test/java/org/photonvision/PhotonVersionTest.java +++ b/photon-lib/src/test/java/org/photonvision/PhotonVersionTest.java @@ -24,7 +24,6 @@ package org.photonvision; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -59,9 +58,4 @@ public void testVersion() { assertFalse(versionMatches("", "v2021.1.6")); assertFalse(versionMatches("v2021.1.6", "")); } - - @Test - public void testNominalDeps() { - assertDoesNotThrow(PhotonCamera::verifyDependencies); - } }