Skip to content

Commit 937bafa

Browse files
Juniormunkmcm001
andauthored
Bump to WPILib 2025 Beta 1 & remove C++ protobuf (#1484)
Remove C++ protobuf support until wpilibsuite/allwpilib#7250 is addressed. Developers should upgrade to wpilib vscode 2025 beta 1. --------- Co-authored-by: Matt <[email protected]>
1 parent 3d18ded commit 937bafa

File tree

67 files changed

+185
-824
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+185
-824
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ jobs:
4848
fetch-depth: 0
4949
- name: Fetch tags
5050
run: git fetch --tags --force
51-
- name: Install RoboRIO Toolchain
52-
run: ./gradlew installRoboRioToolchain
5351
- name: Install Java 17
5452
uses: actions/setup-java@v4
5553
with:
5654
java-version: 17
5755
distribution: temurin
56+
- name: Install RoboRIO Toolchain
57+
run: ./gradlew installRoboRioToolchain
5858
# Need to publish to maven local first, so that C++ sim can pick it up
5959
# Still haven't figured out how to make the vendordep file be copied before trying to build examples
6060
- name: Publish photonlib to maven local
@@ -85,7 +85,7 @@ jobs:
8585
- name: Fetch tags
8686
run: git fetch --tags --force
8787
- name: Install Java 17
88-
uses: actions/setup-java@v3
88+
uses: actions/setup-java@v4
8989
with:
9090
java-version: 17
9191
distribution: temurin
@@ -344,7 +344,7 @@ jobs:
344344
- run: |
345345
sudo apt-get update
346346
sudo apt-get install --yes libcholmod3 liblapack3 libsuitesparseconfig5
347-
if: ${{ (matrix.os) == 'ubuntu-latest' }}
347+
if: ${{ (matrix.os) == 'ubuntu-22.04' }}
348348
# and actually run the jar
349349
- run: java -jar ${{ matrix.extraOpts }} *.jar --smoketest
350350
if: ${{ (matrix.os) != 'windows-latest' }}
@@ -439,7 +439,7 @@ jobs:
439439
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.0-beta-6/photonvision_opi5pro.img.xz
440440
cpu: cortex-a8
441441
image_additional_mb: 1024
442-
- os: ubuntu-latest
442+
- os: ubuntu-22.04
443443
artifact-name: LinuxArm64
444444
image_suffix: orangepi5max
445445
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.0-beta-6/photonvision_opi5max.img.xz

.github/workflows/lint-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- uses: actions/checkout@v3
5858
with:
5959
fetch-depth: 0
60-
- uses: actions/setup-java@v3
60+
- uses: actions/setup-java@v4
6161
with:
6262
java-version: 17
6363
distribution: temurin

.github/workflows/photon-code-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Fetch tags
6060
run: git fetch --tags --force
6161
- name: Install Java 17
62-
uses: actions/setup-java@v3
62+
uses: actions/setup-java@v4
6363
with:
6464
java-version: 17
6565
distribution: temurin

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121

2222
jobs:
2323
buildAndDeploy:
24-
runs-on: ubuntu-latest
24+
runs-on: ubuntu-22.04
2525

2626
steps:
2727
- name: Checkout code

build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ plugins {
55
id "cpp"
66
id "com.diffplug.spotless" version "6.24.0"
77
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
8-
id "edu.wpi.first.GradleRIO" version "2024.3.2"
8+
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-1"
99
id 'edu.wpi.first.WpilibTools' version '1.3.0'
10-
id 'com.google.protobuf' version '0.9.4' apply false
10+
id 'com.google.protobuf' version '0.9.3' apply false
1111
id 'edu.wpi.first.GradleJni' version '1.1.0'
1212
}
1313

@@ -30,14 +30,15 @@ ext.allOutputsFolder = file("$project.buildDir/outputs")
3030
apply from: "versioningHelper.gradle"
3131

3232
ext {
33-
wpilibVersion = "2024.3.2"
33+
wpilibVersion = "2025.1.1-beta-1"
3434
wpimathVersion = wpilibVersion
35-
openCVversion = "4.8.0-2"
35+
openCVYear = "2024"
36+
openCVversion = "4.8.0-4"
3637
joglVersion = "2.4.0"
3738
javalinVersion = "5.6.2"
3839
libcameraDriverVersion = "dev-v2023.1.0-14-g787ab59"
3940
rknnVersion = "dev-v2024.0.1-4-g0db16ac"
40-
frcYear = "2024"
41+
frcYear = "2025"
4142
mrcalVersion = "dev-v2024.0.0-24-gc1efcf0";
4243

4344

photon-client/src/components/settings/NetworkingCard.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ const resetTempSettingsStruct = () => {
1717
const settingsValid = ref(true);
1818
1919
const isValidNetworkTablesIP = (v: string | undefined): boolean => {
20-
// Check if it is a valid team number between 1-9999
21-
const teamNumberRegex = /^[1-9][0-9]{0,3}$/;
20+
// Check if it is a valid team number between 1-99999 (5 digits)
21+
const teamNumberRegex = /^[1-9][0-9]{0,4}$/;
2222
// Check if it is a team number longer than 5 digits
23-
const badTeamNumberRegex = /^[0-9]{5,}$/;
23+
const badTeamNumberRegex = /^[0-9]{6,}$/;
2424
2525
if (v === undefined) return false;
2626
if (teamNumberRegex.test(v)) return true;

photon-core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore")
2424
nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore")
2525
nativeConfig.dependencies.add wpilibTools.deps.wpilib("apriltag")
2626
nativeConfig.dependencies.add wpilibTools.deps.wpilib("hal")
27-
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
27+
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + openCVYear, wpi.versions.opencvVersion.get())
2828

2929
dependencies {
3030
// JOGL stuff (currently we only distribute for aarch64, which is Pi 4)

photon-core/src/main/java/org/photonvision/common/util/TestUtils.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@
1919

2020
import com.fasterxml.jackson.databind.ObjectMapper;
2121
import edu.wpi.first.apriltag.jni.AprilTagJNI;
22-
import edu.wpi.first.cscore.CameraServerCvJNI;
2322
import edu.wpi.first.cscore.CameraServerJNI;
23+
import edu.wpi.first.cscore.OpenCvLoader;
2424
import edu.wpi.first.hal.JNIWrapper;
25-
import edu.wpi.first.math.WPIMathJNI;
2625
import edu.wpi.first.math.geometry.Translation2d;
26+
import edu.wpi.first.math.jni.ArmFeedforwardJNI;
27+
import edu.wpi.first.math.jni.DAREJNI;
28+
import edu.wpi.first.math.jni.EigenJNI;
29+
import edu.wpi.first.math.jni.Ellipse2dJNI;
30+
import edu.wpi.first.math.jni.Pose3dJNI;
31+
import edu.wpi.first.math.jni.StateSpaceUtilJNI;
32+
import edu.wpi.first.math.jni.TrajectoryUtilJNI;
2733
import edu.wpi.first.math.util.Units;
2834
import edu.wpi.first.net.WPINetJNI;
2935
import edu.wpi.first.networktables.NetworkTablesJNI;
@@ -46,23 +52,21 @@ public static boolean loadLibraries() {
4652

4753
NetworkTablesJNI.Helper.setExtractOnStaticLoad(false);
4854
WPIUtilJNI.Helper.setExtractOnStaticLoad(false);
49-
WPIMathJNI.Helper.setExtractOnStaticLoad(false);
5055
CameraServerJNI.Helper.setExtractOnStaticLoad(false);
51-
CameraServerCvJNI.Helper.setExtractOnStaticLoad(false);
52-
// OpenCvLoader.Helper.setExtractOnStaticLoad(false);
56+
OpenCvLoader.Helper.setExtractOnStaticLoad(false);
5357
JNIWrapper.Helper.setExtractOnStaticLoad(false);
5458
WPINetJNI.Helper.setExtractOnStaticLoad(false);
5559
AprilTagJNI.Helper.setExtractOnStaticLoad(false);
5660

5761
// wpimathjni is a bit odd, it's all in the wpimathjni shared lib, but the java side stuff has
5862
// been split.
59-
// ArmFeedforwardJNI.Helper.setExtractOnStaticLoad(false);
60-
// DAREJNI.Helper.setExtractOnStaticLoad(false);
61-
// EigenJNI.Helper.setExtractOnStaticLoad(false);
62-
// Ellipse2dJNI.Helper.setExtractOnStaticLoad(false);
63-
// Pose3dJNI.Helper.setExtractOnStaticLoad(false);
64-
// StateSpaceUtilJNI.Helper.setExtractOnStaticLoad(false);
65-
// TrajectoryUtilJNI.Helper.setExtractOnStaticLoad(false);
63+
ArmFeedforwardJNI.Helper.setExtractOnStaticLoad(false);
64+
DAREJNI.Helper.setExtractOnStaticLoad(false);
65+
EigenJNI.Helper.setExtractOnStaticLoad(false);
66+
Ellipse2dJNI.Helper.setExtractOnStaticLoad(false);
67+
Pose3dJNI.Helper.setExtractOnStaticLoad(false);
68+
StateSpaceUtilJNI.Helper.setExtractOnStaticLoad(false);
69+
TrajectoryUtilJNI.Helper.setExtractOnStaticLoad(false);
6670

6771
try {
6872
CombinedRuntimeLoader.loadLibraries(
@@ -72,10 +76,11 @@ public static boolean loadLibraries() {
7276
"ntcorejni",
7377
"wpinetjni",
7478
"wpiHaljni",
75-
Core.NATIVE_LIBRARY_NAME,
7679
"cscorejni",
7780
"apriltagjni");
7881

82+
CombinedRuntimeLoader.loadLibraries(TestUtils.class, Core.NATIVE_LIBRARY_NAME);
83+
7984
has_loaded = true;
8085
} catch (IOException e) {
8186
e.printStackTrace();

photon-lib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,4 +338,4 @@ nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore")
338338
nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore")
339339
nativeConfig.dependencies.add wpilibTools.deps.wpilib("apriltag")
340340
nativeConfig.dependencies.add wpilibTools.deps.wpilib("hal")
341-
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
341+
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + openCVYear, wpi.versions.opencvVersion.get())

photon-lib/src/test/java/org/photonvision/OpenCVTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,19 @@
2626

2727
import static org.junit.jupiter.api.Assertions.*;
2828

29-
import edu.wpi.first.cscore.CameraServerCvJNI;
3029
import edu.wpi.first.math.MathUtil;
3130
import edu.wpi.first.math.geometry.Pose3d;
3231
import edu.wpi.first.math.geometry.Rotation2d;
3332
import edu.wpi.first.math.geometry.Rotation3d;
3433
import edu.wpi.first.math.geometry.Transform3d;
3534
import edu.wpi.first.math.geometry.Translation3d;
3635
import edu.wpi.first.networktables.NetworkTableInstance;
36+
import edu.wpi.first.util.CombinedRuntimeLoader;
3737
import java.io.IOException;
3838
import java.util.List;
3939
import org.junit.jupiter.api.BeforeAll;
4040
import org.junit.jupiter.api.Test;
41+
import org.opencv.core.Core;
4142
import org.photonvision.estimation.CameraTargetRelation;
4243
import org.photonvision.estimation.OpenCVHelp;
4344
import org.photonvision.estimation.RotTrlTransform3d;
@@ -77,7 +78,7 @@ public static void assertSame(Transform3d trf1, Transform3d trf2) {
7778

7879
@BeforeAll
7980
public static void setUp() throws IOException {
80-
CameraServerCvJNI.forceLoad();
81+
CombinedRuntimeLoader.loadLibraries(OpenCVTest.class, Core.NATIVE_LIBRARY_NAME);
8182

8283
// NT live for debug purposes
8384
NetworkTableInstance.getDefault().startServer();

0 commit comments

Comments
 (0)