From cc96a0600519b79d20b9544d753ddc9621f88415 Mon Sep 17 00:00:00 2001 From: Jade Turner Date: Sun, 10 Nov 2024 13:00:10 +0800 Subject: [PATCH] [photon-targeting] Remove dependency on wpilibc Closes https://github.com/PhotonVision/photonvision/pull/1543/files Signed-off-by: Jade Turner --- photon-core/build.gradle | 1 - photon-lib/src/generate/photonlib.json.in | 13 ------------- photon-targeting/build.gradle | 2 -- .../java/org/photonvision/jni/WpilibLoader.java | 1 - .../include/photon/targeting/PhotonPipelineResult.h | 8 ++++---- 5 files changed, 4 insertions(+), 21 deletions(-) diff --git a/photon-core/build.gradle b/photon-core/build.gradle index 0a481d6520..2a63716349 100644 --- a/photon-core/build.gradle +++ b/photon-core/build.gradle @@ -18,7 +18,6 @@ def nativeTasks = wpilibTools.createExtractionTasks { nativeTasks.addToSourceSetResources(sourceSets.main) -nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpilibc") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil") diff --git a/photon-lib/src/generate/photonlib.json.in b/photon-lib/src/generate/photonlib.json.in index 88d4e002d9..df1552030d 100644 --- a/photon-lib/src/generate/photonlib.json.in +++ b/photon-lib/src/generate/photonlib.json.in @@ -10,19 +10,6 @@ ], "jsonUrl": "https://maven.photonvision.org/repository/internal/org/photonvision/photonlib-json/1.0/photonlib-json-1.0.json", "jniDependencies": [ - { - "groupId": "edu.wpi.first.wpilibc", - "artifactId": "wpilibc-cpp", - "version": "${wpilib_version}", - "skipInvalidPlatforms": true, - "isJar": false, - "validPlatforms": [ - "windowsx86-64", - "linuxathena", - "linuxx86-64", - "osxuniversal" - ] - }, { "groupId": "org.photonvision", "artifactId": "photontargeting-cpp", diff --git a/photon-targeting/build.gradle b/photon-targeting/build.gradle index 6b35a95987..2abf8301a1 100644 --- a/photon-targeting/build.gradle +++ b/photon-targeting/build.gradle @@ -64,7 +64,6 @@ model { nativeUtils.useRequiredLibrary(it, "wpiutil_shared") nativeUtils.useRequiredLibrary(it, "wpimath_shared") nativeUtils.useRequiredLibrary(it, "wpinet_shared") - nativeUtils.useRequiredLibrary(it, "wpilibc_shared") nativeUtils.useRequiredLibrary(it, "ntcore_shared") } "${nativeName}JNI"(JniNativeLibrarySpec) { @@ -215,7 +214,6 @@ def nativeTasks = wpilibTools.createExtractionTasks { nativeTasks.addToSourceSetResources(sourceSets.test) -nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpilibc") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet") diff --git a/photon-targeting/src/generated/main/java/org/photonvision/jni/WpilibLoader.java b/photon-targeting/src/generated/main/java/org/photonvision/jni/WpilibLoader.java index 80ded92c55..301868e622 100644 --- a/photon-targeting/src/generated/main/java/org/photonvision/jni/WpilibLoader.java +++ b/photon-targeting/src/generated/main/java/org/photonvision/jni/WpilibLoader.java @@ -64,7 +64,6 @@ public static boolean loadLibraries() { CombinedRuntimeLoader.loadLibraries( WpilibLoader.class, "wpiutiljni", - "wpilibc", "wpimathjni", "ntcorejni", "wpinetjni", diff --git a/photon-targeting/src/main/native/include/photon/targeting/PhotonPipelineResult.h b/photon-targeting/src/main/native/include/photon/targeting/PhotonPipelineResult.h index 989c7a4d3f..614c17947d 100644 --- a/photon-targeting/src/main/native/include/photon/targeting/PhotonPipelineResult.h +++ b/photon-targeting/src/main/native/include/photon/targeting/PhotonPipelineResult.h @@ -21,12 +21,12 @@ #include #include -#include #include #include #include "MultiTargetPNPResult.h" #include "PhotonTrackedTarget.h" +#include "fmt/base.h" #include "photon/dataflow/structures/Packet.h" #include "photon/struct/PhotonPipelineResultStruct.h" @@ -73,9 +73,9 @@ class PhotonPipelineResult : public PhotonPipelineResult_PhotonStruct { */ PhotonTrackedTarget GetBestTarget() const { if (!HasTargets() && !HAS_WARNED) { - FRC_ReportError( - frc::warn::Warning, "{}", - "This PhotonPipelineResult object has no targets associated with it! " + fmt::println( + "WARNING: This PhotonPipelineResult object has no targets associated " + "with it! " "Please check HasTargets() before calling this method. For more " "information, please review the PhotonLib documentation at " "http://docs.photonvision.org");