From c1278cccd7523b64fa00fba2477d9dc080005450 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 6 Jan 2024 22:17:05 -0700 Subject: [PATCH] whoops --- build.gradle | 16 ++++++++++++++++ src/main/native/cpp/rknn_yolo_wrapper.cc | 1 + .../java/org/photonvision/rknn/RknnTest.java | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c5509ce..c5b9ca0 100644 --- a/build.gradle +++ b/build.gradle @@ -44,6 +44,7 @@ dependencies { testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") implementation wpilibTools.deps.wpilibJava("wpiutil") + testImplementation wpilibTools.deps.wpilibJava("cscore") implementation wpilibTools.deps.wpilibOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get()) @@ -86,4 +87,19 @@ tasks.register('copyNativeLibrary', Sync) { publish.dependsOn it } + +def nativeConfigName = 'wpilibNatives' +def nativeConfig = configurations.create(nativeConfigName) + +def nativeTasks = wpilibTools.createExtractionTasks { + configurationName = nativeConfigName +} + +nativeTasks.addToSourceSetResources(sourceSets.main) + +nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil") +nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore") +nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get()) + + apply from: "publish.gradle" diff --git a/src/main/native/cpp/rknn_yolo_wrapper.cc b/src/main/native/cpp/rknn_yolo_wrapper.cc index 3891110..c604c3c 100644 --- a/src/main/native/cpp/rknn_yolo_wrapper.cc +++ b/src/main/native/cpp/rknn_yolo_wrapper.cc @@ -23,6 +23,7 @@ #include "yolov7.h" #include "file_utils.h" #include "rknn_yolo_wrapper.h" +#include "rknn_jni.h" RknnYoloWrapper::RknnYoloWrapper() { // Make very sure zero-inited? copied from example diff --git a/src/test/java/org/photonvision/rknn/RknnTest.java b/src/test/java/org/photonvision/rknn/RknnTest.java index 93fa0c5..ab153d7 100644 --- a/src/test/java/org/photonvision/rknn/RknnTest.java +++ b/src/test/java/org/photonvision/rknn/RknnTest.java @@ -30,7 +30,7 @@ public class RknnTest { @Test public void testBasicBlobs() throws IOException { // I really really hate this. Someone should fix this for me - System.load("/home/matt/Documents/GitHub/photonvision/photon-targeting/build/NativeMain/RawRuntimeLibs/linux/x86-64/shared/libopencv_java480.so"); + var s = new CvSource(); // This also needs to get fixed System.load("/home/matt/Documents/rknn/rknn_java/cmake_build/librknn_java.so");