mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-22 01:11:40 +00:00
[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:
@@ -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")
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -64,7 +64,6 @@ public class WpilibLoader {
|
||||
CombinedRuntimeLoader.loadLibraries(
|
||||
WpilibLoader.class,
|
||||
"wpiutiljni",
|
||||
"wpilibc",
|
||||
"wpimathjni",
|
||||
"ntcorejni",
|
||||
"wpinetjni",
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user