From 98633e9150a4c8111f42cbea5ba78cfb75ef5394 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 26 May 2024 14:02:07 -0500 Subject: [PATCH] Bump wpilib to latest dev (#1327) --- .github/workflows/build.yml | 4 +- build.gradle | 2 +- .../edu/wpi/first/util/RuntimeDetector.java | 207 ++++++++++++++++++ .../configuration/LegacyConfigProvider.java | 2 +- .../configuration/SqlConfigProvider.java | 2 +- .../photonvision/common/util/TestUtils.java | 4 +- .../photon/simulation/PhotonCameraSim.h | 2 +- .../java/org/photonvision/OpenCVTest.java | 4 +- .../photon/dataflow/structures/Packet.h | 9 +- .../java/org/photonvision/PacketTest.java | 14 ++ .../targeting/PhotonPipelineResultTest.java | 32 +++ .../targeting/PhotonTrackedTargetTest.java | 8 + .../proto/PhotonPipelineResultProtoTest.java | 8 + .../proto/PhotonTrackedTargetProtoTest.java | 6 + .../src/test/native/cpp/PacketTest.cpp | 6 + .../proto/PhotonPipelineResultProtoTest.cpp | 4 + .../proto/PhotonTrackedTargetProtoTest.cpp | 2 + 17 files changed, 300 insertions(+), 16 deletions(-) create mode 100644 photon-core/src/main/java/edu/wpi/first/util/RuntimeDetector.java diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index edef1bffba..acc5887c0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -149,7 +149,7 @@ jobs: - run: git fetch --tags --force - run: | chmod +x gradlew - ./gradlew photon-lib:build --max-workers 1 + ./gradlew photon-targeting:build photon-lib:build --max-workers 1 - run: ./gradlew photon-lib:publish photon-targeting:publish name: Publish env: @@ -180,7 +180,7 @@ jobs: - name: Build PhotonLib run: | chmod +x gradlew - ./gradlew photon-lib:build --max-workers 1 + ./gradlew photon-targeting:build photon-lib:build --max-workers 1 - name: Publish run: | chmod +x gradlew diff --git a/build.gradle b/build.gradle index fe2c495a48..2744170b4b 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ allprojects { apply from: "versioningHelper.gradle" ext { - wpilibVersion = "2024.3.2" + wpilibVersion = "2024.3.2-139-gfbfef85" wpimathVersion = wpilibVersion openCVversion = "4.8.0-2" joglVersion = "2.4.0-rc-20200307" diff --git a/photon-core/src/main/java/edu/wpi/first/util/RuntimeDetector.java b/photon-core/src/main/java/edu/wpi/first/util/RuntimeDetector.java new file mode 100644 index 0000000000..eedafc4f85 --- /dev/null +++ b/photon-core/src/main/java/edu/wpi/first/util/RuntimeDetector.java @@ -0,0 +1,207 @@ +/* + * Copyright (C) Photon Vision. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package edu.wpi.first.util; + +import java.io.File; + +/** + * A utility class for detecting and providing platform-specific such as OS and CPU architecture. + */ +public final class RuntimeDetector { + private static String filePrefix; + private static String fileExtension; + private static String filePath; + + private static synchronized void computePlatform() { + if (fileExtension != null && filePath != null && filePrefix != null) { + return; + } + + boolean intel32 = is32BitIntel(); + boolean intel64 = is64BitIntel(); + boolean arm64 = isArm64(); + + if (isWindows()) { + filePrefix = ""; + fileExtension = ".dll"; + if (intel32) { + filePath = "/windows/x86/"; + } else { + filePath = "/windows/x86-64/"; + } + } else if (isMac()) { + filePrefix = "lib"; + fileExtension = ".dylib"; + filePath = "/osx/universal/"; + } else if (isLinux()) { + filePrefix = "lib"; + fileExtension = ".so"; + if (intel32) { + filePath = "/linux/x86/"; + } else if (intel64) { + filePath = "/linux/x86-64/"; + } else if (isAthena()) { + filePath = "/linux/athena/"; + } else if (isArm32()) { + filePath = "/linux/arm32/"; + } else if (arm64) { + filePath = "/linux/arm64/"; + } else { + filePath = "/linux/nativearm/"; + } + } else { + throw new IllegalStateException("Failed to determine OS"); + } + } + + /** + * Get the file prefix for the current system. + * + * @return The file prefix. + */ + public static synchronized String getFilePrefix() { + computePlatform(); + + return filePrefix; + } + + /** + * Get the file extension for the current system. + * + * @return The file extension. + */ + public static synchronized String getFileExtension() { + computePlatform(); + + return fileExtension; + } + + /** + * Get the platform path for the current system. + * + * @return The platform path. + */ + public static synchronized String getPlatformPath() { + computePlatform(); + + return filePath; + } + + /** + * Get the path to the requested resource. + * + * @param libName Library name. + * @return The path to the requested resource. + */ + public static synchronized String getLibraryResource(String libName) { + computePlatform(); + + return filePath + filePrefix + libName + fileExtension; + } + + /** + * Get the path to the hash to the requested resource. + * + * @param libName Library name. + * @return The path to the hash to the requested resource. + */ + public static synchronized String getHashLibraryResource(String libName) { + computePlatform(); + + return filePath + libName + ".hash"; + } + + /** + * Check if hardware platform is Athena. + * + * @return True if hardware platform is Athena. + */ + public static boolean isAthena() { + File runRobotFile = new File("/usr/local/frc/bin/frcRunRobot.sh"); + return runRobotFile.exists(); + } + + /** + * Check if OS is Arm32. + * + * @return True if OS is Arm32. + */ + public static boolean isArm32() { + String arch = System.getProperty("os.arch"); + return "arm".equals(arch) || "arm32".equals(arch); + } + + /** + * Check if architecture is Arm64. + * + * @return if architecture is Arm64. + */ + public static boolean isArm64() { + String arch = System.getProperty("os.arch"); + return "aarch64".equals(arch) || "arm64".equals(arch); + } + + /** + * Check if OS is Linux. + * + * @return if OS is Linux. + */ + public static boolean isLinux() { + return System.getProperty("os.name").startsWith("Linux"); + } + + /** + * Check if OS is Windows. + * + * @return if OS is Windows. + */ + public static boolean isWindows() { + return System.getProperty("os.name").startsWith("Windows"); + } + + /** + * Check if OS is Mac. + * + * @return if OS is Mac. + */ + public static boolean isMac() { + return System.getProperty("os.name").startsWith("Mac"); + } + + /** + * Check if OS is 32bit Intel. + * + * @return if OS is 32bit Intel. + */ + public static boolean is32BitIntel() { + String arch = System.getProperty("os.arch"); + return "x86".equals(arch) || "i386".equals(arch); + } + + /** + * Check if OS is 64bit Intel. + * + * @return if OS is 64bit Intel. + */ + public static boolean is64BitIntel() { + String arch = System.getProperty("os.arch"); + return "amd64".equals(arch) || "x86_64".equals(arch); + } + + private RuntimeDetector() {} +} diff --git a/photon-core/src/main/java/org/photonvision/common/configuration/LegacyConfigProvider.java b/photon-core/src/main/java/org/photonvision/common/configuration/LegacyConfigProvider.java index e570fbf734..6c2dca8cc9 100644 --- a/photon-core/src/main/java/org/photonvision/common/configuration/LegacyConfigProvider.java +++ b/photon-core/src/main/java/org/photonvision/common/configuration/LegacyConfigProvider.java @@ -198,7 +198,7 @@ public void load() { if (atfl == null) { logger.info("Loading default apriltags for 2024 field..."); try { - atfl = AprilTagFields.kDefaultField.loadAprilTagLayoutField(); + atfl = AprilTagFieldLayout.loadField(AprilTagFields.kDefaultField); } catch (UncheckedIOException e) { logger.error("Error loading WPILib field", e); atfl = null; diff --git a/photon-core/src/main/java/org/photonvision/common/configuration/SqlConfigProvider.java b/photon-core/src/main/java/org/photonvision/common/configuration/SqlConfigProvider.java index bf4d90707f..7d02a09098 100644 --- a/photon-core/src/main/java/org/photonvision/common/configuration/SqlConfigProvider.java +++ b/photon-core/src/main/java/org/photonvision/common/configuration/SqlConfigProvider.java @@ -294,7 +294,7 @@ public void load() { } catch (IOException e) { logger.error("Could not deserialize apriltag layout! Loading defaults"); try { - atfl = AprilTagFields.kDefaultField.loadAprilTagLayoutField(); + atfl = AprilTagFieldLayout.loadField(AprilTagFields.kDefaultField); } catch (UncheckedIOException e2) { logger.error("Error loading WPILib field", e); atfl = null; diff --git a/photon-core/src/main/java/org/photonvision/common/util/TestUtils.java b/photon-core/src/main/java/org/photonvision/common/util/TestUtils.java index 8d2176193e..c906736351 100644 --- a/photon-core/src/main/java/org/photonvision/common/util/TestUtils.java +++ b/photon-core/src/main/java/org/photonvision/common/util/TestUtils.java @@ -19,8 +19,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import edu.wpi.first.apriltag.jni.AprilTagJNI; -import edu.wpi.first.cscore.CameraServerCvJNI; import edu.wpi.first.cscore.CameraServerJNI; +import edu.wpi.first.cscore.OpenCvLoader; import edu.wpi.first.hal.JNIWrapper; import edu.wpi.first.math.WPIMathJNI; import edu.wpi.first.math.geometry.Translation2d; @@ -48,7 +48,7 @@ public static boolean loadLibraries() { WPIUtilJNI.Helper.setExtractOnStaticLoad(false); WPIMathJNI.Helper.setExtractOnStaticLoad(false); CameraServerJNI.Helper.setExtractOnStaticLoad(false); - CameraServerCvJNI.Helper.setExtractOnStaticLoad(false); + OpenCvLoader.Helper.setExtractOnStaticLoad(false); JNIWrapper.Helper.setExtractOnStaticLoad(false); WPINetJNI.Helper.setExtractOnStaticLoad(false); AprilTagJNI.Helper.setExtractOnStaticLoad(false); diff --git a/photon-lib/src/main/native/include/photon/simulation/PhotonCameraSim.h b/photon-lib/src/main/native/include/photon/simulation/PhotonCameraSim.h index 9bc945f46b..84e585f1a3 100644 --- a/photon-lib/src/main/native/include/photon/simulation/PhotonCameraSim.h +++ b/photon-lib/src/main/native/include/photon/simulation/PhotonCameraSim.h @@ -440,7 +440,7 @@ class PhotonCameraSim { double minTargetAreaPercent; frc::AprilTagFieldLayout tagLayout{ - frc::LoadAprilTagLayoutField(frc::AprilTagField::k2024Crescendo)}; + frc::AprilTagFieldLayout::LoadField(frc::AprilTagField::k2024Crescendo)}; cs::CvSource videoSimRaw; cv::Mat videoSimFrameRaw{}; diff --git a/photon-lib/src/test/java/org/photonvision/OpenCVTest.java b/photon-lib/src/test/java/org/photonvision/OpenCVTest.java index 2849c84552..c62d9c7c5e 100644 --- a/photon-lib/src/test/java/org/photonvision/OpenCVTest.java +++ b/photon-lib/src/test/java/org/photonvision/OpenCVTest.java @@ -26,7 +26,7 @@ import static org.junit.jupiter.api.Assertions.*; -import edu.wpi.first.cscore.CameraServerCvJNI; +import edu.wpi.first.cscore.OpenCvLoader; import edu.wpi.first.math.MathUtil; import edu.wpi.first.math.geometry.Pose3d; import edu.wpi.first.math.geometry.Rotation2d; @@ -77,7 +77,7 @@ public static void assertSame(Transform3d trf1, Transform3d trf2) { @BeforeAll public static void setUp() throws IOException { - CameraServerCvJNI.forceLoad(); + OpenCvLoader.forceLoad(); // NT live for debug purposes NetworkTableInstance.getDefault().startServer(); diff --git a/photon-targeting/src/main/native/include/photon/dataflow/structures/Packet.h b/photon-targeting/src/main/native/include/photon/dataflow/structures/Packet.h index c2b16c7821..f1ed30442b 100644 --- a/photon-targeting/src/main/native/include/photon/dataflow/structures/Packet.h +++ b/photon-targeting/src/main/native/include/photon/dataflow/structures/Packet.h @@ -18,11 +18,10 @@ #pragma once #include +#include #include #include -#include - namespace photon { /** @@ -73,8 +72,7 @@ class Packet { packetData.resize(packetData.size() + sizeof(T)); std::memcpy(packetData.data() + writePos, &src, sizeof(T)); - if constexpr (wpi::support::endian::system_endianness() == - wpi::support::endianness::little) { + if constexpr (std::endian::native == std::endian::little) { // Reverse to big endian for network conventions. std::reverse(packetData.data() + writePos, packetData.data() + writePos + sizeof(T)); @@ -95,8 +93,7 @@ class Packet { if (!packetData.empty()) { std::memcpy(&value, packetData.data() + readPos, sizeof(T)); - if constexpr (wpi::support::endian::system_endianness() == - wpi::support::endianness::little) { + if constexpr (std::endian::native == std::endian::little) { // Reverse to little endian for host. uint8_t& raw = reinterpret_cast(value); std::reverse(&raw, &raw + sizeof(T)); diff --git a/photon-targeting/src/test/java/org/photonvision/PacketTest.java b/photon-targeting/src/test/java/org/photonvision/PacketTest.java index ab361932a1..429ae77a54 100644 --- a/photon-targeting/src/test/java/org/photonvision/PacketTest.java +++ b/photon-targeting/src/test/java/org/photonvision/PacketTest.java @@ -160,6 +160,8 @@ void trackedTargetSerde() { 9.0, -5.0, -1, + -1, + -1f, new Transform3d(), new Transform3d(), -1, @@ -198,6 +200,8 @@ void pipelineResultSerde() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -217,6 +221,8 @@ void pipelineResultSerde() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, @@ -247,6 +253,8 @@ void pipelineResultSerde() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -266,6 +274,8 @@ void pipelineResultSerde() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, @@ -303,6 +313,8 @@ public void testMultiTargetSerde() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -322,6 +334,8 @@ public void testMultiTargetSerde() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, diff --git a/photon-targeting/src/test/java/org/photonvision/targeting/PhotonPipelineResultTest.java b/photon-targeting/src/test/java/org/photonvision/targeting/PhotonPipelineResultTest.java index 5bb1f1b5e3..b8129c74f6 100644 --- a/photon-targeting/src/test/java/org/photonvision/targeting/PhotonPipelineResultTest.java +++ b/photon-targeting/src/test/java/org/photonvision/targeting/PhotonPipelineResultTest.java @@ -45,6 +45,8 @@ public void equalityTest() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -64,6 +66,8 @@ public void equalityTest() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, @@ -89,6 +93,8 @@ public void equalityTest() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -108,6 +114,8 @@ public void equalityTest() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, @@ -135,6 +143,8 @@ public void equalityTest() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -154,6 +164,8 @@ public void equalityTest() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, @@ -183,6 +195,8 @@ public void equalityTest() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -202,6 +216,8 @@ public void equalityTest() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, @@ -236,6 +252,8 @@ public void inequalityTest() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -255,6 +273,8 @@ public void inequalityTest() { 1.0, -9.0, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, @@ -280,6 +300,8 @@ public void inequalityTest() { 1.0, -9.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -299,6 +321,8 @@ public void inequalityTest() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, @@ -326,6 +350,8 @@ public void inequalityTest() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -345,6 +371,8 @@ public void inequalityTest() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, @@ -374,6 +402,8 @@ public void inequalityTest() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -393,6 +423,8 @@ public void inequalityTest() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, diff --git a/photon-targeting/src/test/java/org/photonvision/targeting/PhotonTrackedTargetTest.java b/photon-targeting/src/test/java/org/photonvision/targeting/PhotonTrackedTargetTest.java index 5d42a2b68f..15a44cb2fd 100644 --- a/photon-targeting/src/test/java/org/photonvision/targeting/PhotonTrackedTargetTest.java +++ b/photon-targeting/src/test/java/org/photonvision/targeting/PhotonTrackedTargetTest.java @@ -36,6 +36,8 @@ public void equalityTest() { 9.0, -5.0, -1, + -1, + -1f, new Transform3d(new Translation3d(), new Rotation3d()), new Transform3d(new Translation3d(), new Rotation3d()), 0.25, @@ -56,6 +58,8 @@ public void equalityTest() { 9.0, -5.0, -1, + -1, + -1f, new Transform3d(new Translation3d(), new Rotation3d()), new Transform3d(new Translation3d(), new Rotation3d()), 0.25, @@ -81,6 +85,8 @@ public void inequalityTest() { 9.0, -5.0, -1, + -1, + -1f, new Transform3d(new Translation3d(), new Rotation3d()), new Transform3d(new Translation3d(), new Rotation3d()), 0.25, @@ -101,6 +107,8 @@ public void inequalityTest() { 1.0, -9.0, -1, + -1, + -1f, new Transform3d(new Translation3d(), new Rotation3d()), new Transform3d(new Translation3d(), new Rotation3d()), 0.25, diff --git a/photon-targeting/src/test/java/org/photonvision/targeting/proto/PhotonPipelineResultProtoTest.java b/photon-targeting/src/test/java/org/photonvision/targeting/proto/PhotonPipelineResultProtoTest.java index 6857a808b1..dbbc7121a7 100644 --- a/photon-targeting/src/test/java/org/photonvision/targeting/proto/PhotonPipelineResultProtoTest.java +++ b/photon-targeting/src/test/java/org/photonvision/targeting/proto/PhotonPipelineResultProtoTest.java @@ -49,6 +49,8 @@ public void protobufTest() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -68,6 +70,8 @@ public void protobufTest() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, @@ -99,6 +103,8 @@ public void protobufTest() { 9.0, 4.0, 2, + -1, + -1f, new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)), 0.25, @@ -118,6 +124,8 @@ public void protobufTest() { 9.1, 6.7, 3, + -1, + -1f, new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)), 0.25, diff --git a/photon-targeting/src/test/java/org/photonvision/targeting/proto/PhotonTrackedTargetProtoTest.java b/photon-targeting/src/test/java/org/photonvision/targeting/proto/PhotonTrackedTargetProtoTest.java index 9aa88c1fca..aba75576cb 100644 --- a/photon-targeting/src/test/java/org/photonvision/targeting/proto/PhotonTrackedTargetProtoTest.java +++ b/photon-targeting/src/test/java/org/photonvision/targeting/proto/PhotonTrackedTargetProtoTest.java @@ -39,6 +39,8 @@ public void protobufTest() { 9.0, -5.0, -1, + -1, + -1f, new Transform3d(new Translation3d(), new Rotation3d()), new Transform3d(new Translation3d(), new Rotation3d()), 0.25, @@ -75,6 +77,8 @@ public void protobufListTest() { 9.0, -5.0, -1, + -1, + -1f, new Transform3d(new Translation3d(), new Rotation3d()), new Transform3d(new Translation3d(), new Rotation3d()), 0.25, @@ -94,6 +98,8 @@ public void protobufListTest() { 1.0, -9.0, -1, + -1, + -1f, new Transform3d(new Translation3d(), new Rotation3d()), new Transform3d(new Translation3d(), new Rotation3d()), 0.25, diff --git a/photon-targeting/src/test/native/cpp/PacketTest.cpp b/photon-targeting/src/test/native/cpp/PacketTest.cpp index 61b8bf1240..78d7667106 100644 --- a/photon-targeting/src/test/native/cpp/PacketTest.cpp +++ b/photon-targeting/src/test/native/cpp/PacketTest.cpp @@ -53,6 +53,8 @@ TEST(PacketTest, PhotonTrackedTarget) { 9.0, -5.0, -1, + -1, + -1.0, frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m), frc::Rotation3d(1_rad, 2_rad, 3_rad)), frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m), @@ -87,6 +89,8 @@ TEST(PacketTest, PhotonPipelineResult) { 9.0, 4.0, 1, + -1, + -1.0, frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m), frc::Rotation3d(1_rad, 2_rad, 3_rad)), frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m), @@ -100,6 +104,8 @@ TEST(PacketTest, PhotonPipelineResult) { 9.1, 6.7, -1, + -1, + -1.0, frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m), frc::Rotation3d(1_rad, 2_rad, 3_rad)), frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m), diff --git a/photon-targeting/src/test/native/cpp/targeting/proto/PhotonPipelineResultProtoTest.cpp b/photon-targeting/src/test/native/cpp/targeting/proto/PhotonPipelineResultProtoTest.cpp index 5b46962c69..4e11b4757a 100644 --- a/photon-targeting/src/test/native/cpp/targeting/proto/PhotonPipelineResultProtoTest.cpp +++ b/photon-targeting/src/test/native/cpp/targeting/proto/PhotonPipelineResultProtoTest.cpp @@ -40,6 +40,8 @@ TEST(PhotonPipelineResultTest, Roundtrip) { 9.0, 4.0, 1, + -1, + -1.0, frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m), frc::Rotation3d(1_rad, 2_rad, 3_rad)), frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m), @@ -53,6 +55,8 @@ TEST(PhotonPipelineResultTest, Roundtrip) { 9.1, 6.7, -1, + -1, + -1.0, frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m), frc::Rotation3d(1_rad, 2_rad, 3_rad)), frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m), diff --git a/photon-targeting/src/test/native/cpp/targeting/proto/PhotonTrackedTargetProtoTest.cpp b/photon-targeting/src/test/native/cpp/targeting/proto/PhotonTrackedTargetProtoTest.cpp index 73ef41f77c..a8b545109d 100644 --- a/photon-targeting/src/test/native/cpp/targeting/proto/PhotonTrackedTargetProtoTest.cpp +++ b/photon-targeting/src/test/native/cpp/targeting/proto/PhotonTrackedTargetProtoTest.cpp @@ -27,6 +27,8 @@ TEST(PhotonTrackedTargetTest, Roundtrip) { 9.0, -5.0, -1, + -1, + -1.0, frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m), frc::Rotation3d(1_rad, 2_rad, 3_rad)), frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),