[photon-targeting] Remove dependency on wpilibc (#1544)

Closes https://github.com/PhotonVision/photonvision/pull/1543/files

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
This commit is contained in:
Jade
2024-11-14 13:25:32 +08:00
committed by GitHub
parent a64491a59e
commit 5f3dc152c3
5 changed files with 4 additions and 21 deletions

View File

@@ -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")

View File

@@ -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",

View File

@@ -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) {
@@ -217,7 +216,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")

View File

@@ -64,7 +64,6 @@ public class WpilibLoader {
CombinedRuntimeLoader.loadLibraries(
WpilibLoader.class,
"wpiutiljni",
"wpilibc",
"wpimathjni",
"ntcorejni",
"wpinetjni",

View File

@@ -21,12 +21,12 @@
#include <string>
#include <utility>
#include <frc/Errors.h>
#include <units/time.h>
#include <wpi/SmallVector.h>
#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");