Skip to content

Make 2027 build#2422

Merged
samfreund merged 33 commits intoPhotonVision:2027from
samfreund:update-2027
Apr 11, 2026
Merged

Make 2027 build#2422
samfreund merged 33 commits intoPhotonVision:2027from
samfreund:update-2027

Conversation

@samfreund
Copy link
Copy Markdown
Member

@samfreund samfreund commented Apr 4, 2026

This PR updates everything for 2027. This includes removing GradleRIO, simplifying our wpilib version defintion, updating APIs, updating to Java 21, and more.

Note that photonlibpy is failing because robotpy has not been fully updated yet. Examples are omitted because they need to be updated for our new PhotonPoseEstimator API and still need some changes from WPILIB. photonlib windows build is failing because we're waiting for some upstream changes. Finally, images are failing since they don't have Java 21 yet.

@github-actions github-actions bot added documentation Anything relating to https://docs.photonvision.org photonlib Things related to the PhotonVision library backend Things relating to photon-core and photon-server labels Apr 4, 2026
@samfreund samfreund force-pushed the update-2027 branch 2 times, most recently from d41e0f4 to 955aedb Compare April 4, 2026 21:49
@samfreund
Copy link
Copy Markdown
Member Author

Currently working, more or less, although tests need to be migrated so we don't use deprecated methods.

@samfreund samfreund changed the base branch from main to 2027 April 5, 2026 00:02
@samfreund samfreund force-pushed the update-2027 branch 2 times, most recently from 5b4f1da to 26c02f1 Compare April 8, 2026 03:59
@samfreund

This comment was marked as resolved.

@samfreund samfreund force-pushed the update-2027 branch 3 times, most recently from 5ae4470 to 774c923 Compare April 8, 2026 19:36
@samfreund samfreund requested a review from Copilot April 8, 2026 19:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the project to build against the 2027 WPILib ecosystem by upgrading the Gradle toolchain, moving the Java baseline forward, and applying WPILib 2027 API/namespace changes across Java/C++/JNI and examples.

Changes:

  • Upgrade Gradle wrappers/build tooling and update CI workflows to use Java 21.
  • Bump WPILib/FRC “2027 alpha” versions in examples and build scripts, and switch core builds to Java 21 toolchains.
  • Refactor code to match updated WPILib 2027 APIs (geometry rotation composition, Alert API, timestamp/time APIs, header renames, etc.).

Reviewed changes

Copilot reviewed 98 out of 110 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
versioningHelper.gradle Modernizes git version detection and version file generation helper.
shared/javacommon.gradle Moves shared Java configuration to Java 21 toolchain; updates dependency version sourcing and test runtime deps.
shared/common.gradle Moves shared Java configuration to Java 21 toolchain; updates dependency version sourcing.
photonlib-java-examples/poseest/settings.gradle Updates example FRC year identifier to 2027 alpha4.
photonlib-java-examples/poseest/gradle/wrapper/gradle-wrapper.properties Bumps example Gradle wrapper to 9.2.0.
photonlib-java-examples/poseest/build.gradle Pins WPILib version to 2027.0.0-alpha-4.
photonlib-java-examples/gradle/wrapper/gradle-wrapper.properties Bumps examples Gradle wrapper to 9.2.0.
photonlib-java-examples/aimattarget/settings.gradle Updates example FRC year identifier to 2027 alpha4.
photonlib-java-examples/aimattarget/gradle/wrapper/gradle-wrapper.properties Bumps example Gradle wrapper to 9.2.0.
photonlib-java-examples/aimattarget/build.gradle Pins WPILib version to 2027.0.0-alpha-4.
photonlib-java-examples/aimandrange/settings.gradle Updates example FRC year identifier to 2027 alpha4.
photonlib-java-examples/aimandrange/gradle/wrapper/gradle-wrapper.properties Bumps example Gradle wrapper to 9.2.0.
photonlib-java-examples/aimandrange/build.gradle Pins WPILib version to 2027.0.0-alpha-4.
photonlib-cpp-examples/poseest/src/main/include/subsystems/SwerveDriveSim.h Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/poseest/src/main/include/subsystems/SwerveDrive.h Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/poseest/src/main/include/subsystems/GamepieceLauncher.h Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/poseest/src/main/include/Robot.h Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/poseest/src/main/include/Constants.h Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/poseest/src/main/cpp/subsystems/SwerveModule.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/poseest/src/main/cpp/subsystems/SwerveDriveSim.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/poseest/src/main/cpp/subsystems/SwerveDrive.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/poseest/src/main/cpp/subsystems/GamepieceLauncher.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/poseest/src/main/cpp/Robot.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/poseest/settings.gradle Updates example FRC year identifier to 2027 alpha4.
photonlib-cpp-examples/poseest/build.gradle Pins WPILib version to 2027.0.0-alpha-4.
photonlib-cpp-examples/gradle/wrapper/gradle-wrapper.properties Bumps C++ examples Gradle wrapper to 9.2.0.
photonlib-cpp-examples/aimattarget/src/main/include/subsystems/SwerveDriveSim.h Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimattarget/src/main/include/subsystems/SwerveDrive.h Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimattarget/src/main/include/Constants.h Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimattarget/src/main/cpp/subsystems/SwerveModule.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimattarget/src/main/cpp/subsystems/SwerveDriveSim.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimattarget/src/main/cpp/subsystems/SwerveDrive.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimattarget/src/main/cpp/Robot.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimattarget/settings.gradle Updates example FRC year identifier to 2027 alpha4.
photonlib-cpp-examples/aimattarget/build.gradle Pins WPILib version to 2027.0.0-alpha-4.
photonlib-cpp-examples/aimandrange/src/main/include/subsystems/SwerveDriveSim.h Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimandrange/src/main/include/subsystems/SwerveDrive.h Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimandrange/src/main/include/Constants.h Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimandrange/src/main/cpp/subsystems/SwerveModule.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimandrange/src/main/cpp/subsystems/SwerveDriveSim.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimandrange/src/main/cpp/subsystems/SwerveDrive.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimandrange/src/main/cpp/Robot.cpp Formatting/style adjustments for updated toolchains.
photonlib-cpp-examples/aimandrange/settings.gradle Updates example FRC year identifier to 2027 alpha4.
photonlib-cpp-examples/aimandrange/build.gradle Pins WPILib version to 2027.0.0-alpha-4.
photon-targeting/src/test/native/cpp/CasadiWrapperTest.cpp Updates includes/time printing for WPILib 2027 headers/APIs.
photon-targeting/src/main/native/jni/CscoreExtras.cpp Updates CSCore/WPIUtil headers for WPILib 2027.
photon-targeting/src/main/native/jni/ConstrainedSolvepnpJNI.cpp Formatting tweaks; keeps JNI signature intact.
photon-targeting/src/main/native/include/photon/estimation/RotTrlTransform3d.h Migrates rotation math to newer WPILib Rotation3d APIs.
photon-targeting/src/main/native/include/photon/estimation/OpenCVHelp.h Migrates rotation conversion logic to newer WPILib Rotation3d APIs.
photon-targeting/src/main/native/include/photon/estimation/CameraTargetRelation.h Minor formatting adjustment.
photon-targeting/src/main/native/include/net/TimeSyncServer.h Minor signature formatting adjustment.
photon-targeting/src/main/native/cpp/photon/estimation/VisionEstimation.cpp Minor formatting adjustment.
photon-targeting/src/main/native/cpp/photon/constrained_solvepnp/wrap/casadi_wrapper.cpp Switches timing calls to NTCore time API; updates headers.
photon-targeting/src/main/native/cpp/net/TimeSyncServer.cpp Header include cleanup/reordering; adds structs include.
photon-targeting/src/main/native/cpp/net/TimeSyncClient.cpp Formatting adjustments; keeps behavior.
photon-targeting/src/main/java/org/photonvision/estimation/RotTrlTransform3d.java Migrates rotation math to newer WPILib Rotation3d APIs.
photon-targeting/src/main/java/org/photonvision/estimation/OpenCVHelp.java Migrates rotation conversion logic to newer WPILib Rotation3d APIs.
photon-targeting/src/main/java/org/photonvision/common/networktables/NTTopicSet.java Updates PubSubOption usage to new constants.
photon-targeting/src/generated/main/native/include/photon/struct/PnpResultStruct.h Updates WPILib geometry header include extension.
photon-targeting/src/generated/main/native/include/photon/struct/PhotonTrackedTargetStruct.h Updates WPILib geometry header include extension.
photon-targeting/src/generated/main/native/include/photon/serde/PnpResultSerde.h Updates WPILib geometry header include extension.
photon-targeting/src/generated/main/native/include/photon/serde/PhotonTrackedTargetSerde.h Updates WPILib geometry header include extension.
photon-targeting/src/generated/main/java/org/photonvision/struct/TargetCornerSerde.java Updates Struct import package for WPILib 2027.
photon-targeting/src/generated/main/java/org/photonvision/struct/PnpResultSerde.java Updates Struct import package for WPILib 2027.
photon-targeting/src/generated/main/java/org/photonvision/struct/PhotonTrackedTargetSerde.java Updates Struct import package for WPILib 2027.
photon-targeting/src/generated/main/java/org/photonvision/struct/PhotonPipelineResultSerde.java Updates Struct import package for WPILib 2027.
photon-targeting/src/generated/main/java/org/photonvision/struct/PhotonPipelineMetadataSerde.java Updates Struct import package for WPILib 2027.
photon-targeting/src/generated/main/java/org/photonvision/struct/MultiTargetPNPResultSerde.java Updates Struct import package for WPILib 2027.
photon-targeting/build.gradle Updates WPILib/OpenCV version wiring for native extraction deps.
photon-server/src/main/java/org/photonvision/Main.java Removes legacy OS image version logging; adds Rotation2d usage import.
photon-server/build.gradle Applies DeployUtils plugin and moves import statements to top.
photon-lib/src/test/native/cpp/VisionSystemSimTest.cpp Updates WPILib namespaces/types and formatting for WPILib 2027.
photon-lib/src/test/native/cpp/VersionTest.cpp Updates print header/API usage to WPILib 2027.
photon-lib/src/test/native/cpp/PhotonPoseEstimatorTest.cpp Updates tests to newer pose-estimation API usage for constrained solvepnp.
photon-lib/src/test/native/cpp/LegacyPhotonPoseEstimatorTest.cpp Updates includes/namespaces for WPILib 2027 headers.
photon-lib/src/test/java/org/photonvision/PhotonPoseEstimatorTest.java Removes unused imports after WPILib API changes.
photon-lib/src/test/java/org/photonvision/PhotonCameraTest.java Updates alert assertions to use AlertSim instead of SmartDashboard arrays.
photon-lib/src/test/java/org/photonvision/OpenCVTest.java Updates rotation diff calculation to relativeTo() API.
photon-lib/src/main/native/include/photon/simulation/VideoSimUtil.h Updates CSCore include for WPILib 2027.
photon-lib/src/main/native/include/photon/simulation/SimCameraProperties.h Minor formatting adjustments.
photon-lib/src/main/native/include/photon/simulation/PhotonCameraSim.h Switches timing to NTCore time API (wpi::nt::Now).
photon-lib/src/main/native/include/photon/PhotonUtils.h Formatting adjustment.
photon-lib/src/main/native/include/photon/PhotonPoseEstimator.h Updates AprilTagFieldLayout type namespace for WPILib 2027.
photon-lib/src/main/native/include/photon/PhotonCamera.h Updates Alert header/package and minor accessor formatting.
photon-lib/src/main/native/cpp/photon/simulation/SimCameraProperties.cpp Updates Errors header include and formatting.
photon-lib/src/main/native/cpp/photon/simulation/PhotonCameraSim.cpp Switches timing and pixel format APIs for WPILib 2027.
photon-lib/src/main/native/cpp/photon/PhotonPoseEstimator.cpp Updates usage reporting and error-reporting calls for WPILib 2027.
photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp Updates usage reporting include and Alert API level enum.
photon-lib/src/main/java/org/photonvision/simulation/PhotonCameraSim.java Updates confidence clamp implementation (currently introduces a build issue).
photon-lib/src/main/java/org/photonvision/PhotonPoseEstimator.java Updates HAL usage reporting and rotation composition semantics.
photon-lib/src/main/java/org/photonvision/PhotonCamera.java Updates Alert API imports/options and PubSubOption constant usage.
photon-lib/py/photonlibpy/photonPoseEstimator.py Updates HAL usage reporting call signature.
photon-lib/py/photonlibpy/photonCamera.py Updates HAL usage reporting call signature.
photon-lib/build.gradle Updates WPILib/OpenCV version wiring for native extraction deps.
photon-docs/build.gradle Updates JavaDoc links to Java 21 docs.
photon-core/src/main/java/org/photonvision/vision/pipeline/result/CVPipelineResult.java Updates latency doc comment to refer to new time API.
photon-core/src/main/java/org/photonvision/vision/pipeline/AprilTagPipeline.java Updates rotation composition to rotateBy() API.
photon-core/src/main/java/org/photonvision/vision/frame/provider/USBFrameProvider.java Updates time API references in comments; removes unused import.
photon-core/src/main/java/org/photonvision/vision/calibration/BoardObservation.java Adds OpenCV drawing/color utilities for calibration visualization.
photon-core/src/main/java/org/photonvision/common/util/TestUtils.java Adds Rotation2d import (supporting WPILib API changes).
photon-core/src/main/java/org/photonvision/common/hardware/OsImageData.java Removes legacy IMAGE_VERSION file support in favor of JSON metadata.
photon-core/src/main/java/org/photonvision/common/hardware/HardwareManager.java Removes an unused import.
photon-core/src/main/java/org/photonvision/common/dataflow/networktables/NetworkTablesManager.java Migrates Alert API imports/types to new WPILib package/enum.
photon-core/build.gradle Updates WPILib/OpenCV version wiring for native extraction deps.
gradle/wrapper/gradle-wrapper.properties Bumps root Gradle wrapper to 9.2.0.
build.gradle Updates WPILib versions, plugin versions, Gradle wrapper version, and adds explicit dependency versions.
.github/workflows/photon-api-docs.yml Updates CI Java version to 21.
.github/workflows/lint-format.yml Updates CI Java version to 21.
.github/workflows/dependency-submission.yml Updates CI Java version to 21.
.github/workflows/build.yml Updates CI Java version to 21 and updates container tags for 2027 toolchains.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread photonlib-java-examples/poseest/build.gradle
Comment thread photonlib-java-examples/aimattarget/build.gradle
Comment thread photonlib-java-examples/aimandrange/build.gradle
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 99 out of 111 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread photon-targeting/src/main/native/include/photon/estimation/OpenCVHelp.h Outdated
Comment thread photon-targeting/src/main/native/include/photon/estimation/OpenCVHelp.h Outdated
Comment thread photon-lib/src/test/native/cpp/PhotonPoseEstimatorTest.cpp
@samfreund
Copy link
Copy Markdown
Member Author

Photonlib build on windows is failing cause windows is dumb, images are waiting on PhotonVision/photon-image-modifier#136

@samfreund
Copy link
Copy Markdown
Member Author

robotpy is also waiting on robotpy being released

@samfreund samfreund marked this pull request as ready for review April 10, 2026 22:55
@samfreund samfreund requested a review from a team as a code owner April 10, 2026 22:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 99 out of 111 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread versioningHelper.gradle
@spacey-sooty
Copy link
Copy Markdown
Member

Apart from failing CI broadly seems good

@samfreund samfreund merged commit 03a43cd into PhotonVision:2027 Apr 11, 2026
44 of 61 checks passed
@samfreund samfreund deleted the update-2027 branch April 11, 2026 17:14
samfreund added a commit that referenced this pull request Apr 11, 2026
This PR updates everything for 2027. This includes removing GradleRIO, simplifying our wpilib version defintion, updating APIs, updating to Java 21, and more.

Note that photonlibpy is failing because robotpy has not been fully updated yet. Examples are omitted because they need to be updated for our new PhotonPoseEstimator API and still need some changes from WPILIB. photonlib windows build is failing because we're waiting for some upstream changes. Finally, images are failing since they don't have Java 21 yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Things relating to photon-core and photon-server documentation Anything relating to https://docs.photonvision.org photonlib Things related to the PhotonVision library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants