Skip to content

Commit

Permalink
[photon-targeting] Remove dependency on wpilibc
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty committed Nov 10, 2024
1 parent 14f7155 commit cc96a06
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 21 deletions.
1 change: 0 additions & 1 deletion photon-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
13 changes: 0 additions & 13 deletions photon-lib/src/generate/photonlib.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions photon-targeting/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public static boolean loadLibraries() {
CombinedRuntimeLoader.loadLibraries(
WpilibLoader.class,
"wpiutiljni",
"wpilibc",
"wpimathjni",
"ntcorejni",
"wpinetjni",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit cc96a06

Please sign in to comment.