Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 110 additions & 125 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
- name: Generate diff
run: git diff HEAD > wpiformat-fixes.patch
if: ${{ failure() }}
- uses: actions/upload-artifact@v6
- uses: actions/upload-artifact@v7
with:
name: wpiformat fixes
archive: false
path: wpiformat-fixes.patch
if: ${{ failure() }}
javaformat:
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v5
with:
version: 10
- name: Setup Node.js
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/photon-api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v5
with:
version: 10
- name: Setup Node.js
Expand All @@ -44,7 +44,7 @@ jobs:
run: pnpm i --frozen-lockfile
- name: Build Production Client
run: pnpm run build-demo
- uses: actions/upload-artifact@v6
- uses: actions/upload-artifact@v7
with:
name: built-demo
path: photon-client/dist/
Expand All @@ -69,7 +69,7 @@ jobs:
run: |
chmod +x gradlew
./gradlew photon-docs:generateJavaDocs photon-docs:doxygen
- uses: actions/upload-artifact@v6
- uses: actions/upload-artifact@v7
with:
name: docs-java-cpp
path: photon-docs/build/docs
Expand All @@ -80,7 +80,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
# Download docs artifact
- uses: actions/download-artifact@v7
- uses: actions/download-artifact@v8
with:
pattern: docs-*
- run: find .
Expand All @@ -106,7 +106,7 @@ jobs:
needs: [build_demo]
runs-on: ubuntu-24.04
steps:
- uses: actions/download-artifact@v7
- uses: actions/download-artifact@v8
with:
name: built-demo
- run: find .
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: python setup.py sdist bdist_wheel

- name: Upload artifacts
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: dist
path: ./photon-lib/py/dist/
Expand All @@ -62,7 +62,7 @@ jobs:
pip install pytest mypy

- name: Download artifacts
uses: actions/download-artifact@v6
uses: actions/download-artifact@v8
with:
name: dist
path: dist/
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
python -m pip install --upgrade pip

- name: Download artifacts
uses: actions/download-artifact@v6
uses: actions/download-artifact@v8
with:
name: dist
path: ./photon-lib/py/dist/
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:

steps:
- name: Download artifacts
uses: actions/download-artifact@v6
uses: actions/download-artifact@v8
with:
name: dist
path: dist/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v5
with:
version: 10
- name: Setup Node
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v5
with:
version: 10
- name: Setup Node
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,5 @@ photon-client/playwright/.auth/
shell.nix
flake.nix
flake.lock

/workspace
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Note that these are case sensitive!
- `-Pprofile`: enables JVM profiling
- `-PwithSanitizers`: On Linux, enables `-fsanitize=address,undefined,leak`

If you're cross-compiling, you'll need the WPILib toolchain installed. This must be done via Gradle: for example `./gradlew installArm64Toolchain` or `./gradlew installRoboRioToolchain`
If you're cross-compiling, you'll need the WPILib toolchain installed. This must be done via Gradle: for example `./gradlew installArm64Toolchain` or `./gradlew installSystemCoreToolchain`

## Out-of-Source Dependencies

Expand Down
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import edu.wpi.first.toolchain.*
import org.wpilib.toolchain.*

plugins {
id "cpp"
id "com.diffplug.spotless" version "8.1.0"
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
id "edu.wpi.first.GradleRIO" version "2026.2.1"
id "org.wpilib.WPILibRepositoriesPlugin" version "2027.0.0"
id "org.wpilib.GradleRIO" version "2027.0.0-alpha-2"
id 'org.photonvision.tools.WpilibTools' version '2.4.1-photon'
id 'com.google.protobuf' version '0.9.3' apply false
id 'edu.wpi.first.GradleJni' version '1.1.0'
id 'org.wpilib.GradleJni' version '2027.0.0'
id "org.ysb33r.doxygen" version "2.0.0" apply false
id 'com.gradleup.shadow' version '8.3.4' apply false
id "com.github.node-gradle.node" version "7.0.1" apply false
Expand All @@ -21,6 +21,7 @@ allprojects {
maven { url = "https://maven.photonvision.org/releases" }
maven { url = "https://maven.photonvision.org/snapshots" }
}
wpilibRepositories.use2027Repos()
wpilibRepositories.addAllReleaseRepositories(it)
wpilibRepositories.addAllDevelopmentRepositories(it)
}
Expand All @@ -32,15 +33,15 @@ ext.allOutputsFolder = file("$project.buildDir/outputs")
apply from: "versioningHelper.gradle"

ext {
wpilibVersion = "2026.2.1"
wpilibVersion = "2027.0.0-alpha-3-203-g0001ddc7e"
wpimathVersion = wpilibVersion
openCVYear = "2025"
openCVversion = "4.10.0-3"
javalinVersion = "6.7.0"
libcameraDriverVersion = "v2026.0.0"
rknnVersion = "dev-v2026.0.1-1-g89b2888"
rubikVersion = "dev-v2026.0.1-4-g13d6279"
frcYear = "2026"
frcYear = "2027_alpha1"
mrcalVersion = "dev-v2026.0.0-1-g239d80e";

pubVersion = versionString
Expand Down
2 changes: 1 addition & 1 deletion docs/source/docs/apriltag-pipelines/multitag.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This multi-target pose estimate can be accessed using PhotonLib. We suggest usin
{
auto multiTagResult = result.MultiTagResult();
if (multiTagResult.has_value()) {
frc::Transform3d fieldToCamera = multiTagResult->estimatedPose.best;
wpi::math::Transform3d fieldToCamera = multiTagResult->estimatedPose.best;
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/source/docs/hardware/selecting-hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In order to use PhotonVision, you need a coprocessor and a camera. This page dis

### Minimum System Requirements

- Ubuntu 22.04 LTS or Windows 10/11
- Ubuntu 24.04 LTS or Windows 10/11
- We don't recommend using Windows for anything except testing out the system on a local machine.
- CPU: ARM Cortex-A53 (the CPU on Raspberry Pi 3) or better
- At least 8GB of storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ You can also get the pipeline latency from a pipeline result using the `getLaten
.. code-block:: c++

// Get the pipeline latency.
units::second_t latency = result.GetLatency();
wpi::units::second_t latency = result.GetLatency();

.. code-block:: python

Expand Down
10 changes: 5 additions & 5 deletions docs/source/docs/programming/photonlib/getting-target-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ You can get a list of tracked targets using the `getTargets()`/`GetTargets()` (J
.. code-block:: c++

// Get a list of currently tracked targets.
wpi::ArrayRef<photonlib::PhotonTrackedTarget> targets = result.GetTargets();
std::span<photonlib::PhotonTrackedTarget> targets = result.GetTargets();

.. code-block:: python

Expand Down Expand Up @@ -166,8 +166,8 @@ You can get the {ref}`best target <docs/reflectiveAndShape/contour-filtering:Con
double pitch = target.GetPitch();
double area = target.GetArea();
double skew = target.GetSkew();
frc::Transform2d pose = target.GetCameraToTarget();
wpi::SmallVector<std::pair<double, double>, 4> corners = target.GetCorners();
wpi::math::Transform2d pose = target.GetCameraToTarget();
wpi::util::SmallVector<std::pair<double, double>, 4> corners = target.GetCorners();

.. code-block:: python

Expand Down Expand Up @@ -206,8 +206,8 @@ All of the data above (**except skew**) is available when using AprilTags.
// Get information from target.
int targetID = target.GetFiducialId();
double poseAmbiguity = target.GetPoseAmbiguity();
frc::Transform3d bestCameraToTarget = target.getBestCameraToTarget();
frc::Transform3d alternateCameraToTarget = target.getAlternateCameraToTarget();
wpi::math::Transform3d bestCameraToTarget = target.getBestCameraToTarget();
wpi::math::Transform3d alternateCameraToTarget = target.getAlternateCameraToTarget();

.. code-block:: python

Expand Down
8 changes: 4 additions & 4 deletions docs/source/docs/programming/photonlib/using-target-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ You can get your robot's `Pose2D` on the field using various camera data, target
.. code-block:: c++

// Calculate robot's field relative pose
frc::Pose2D robotPose = photonlib::EstimateFieldToRobot(
kCameraHeight, kTargetHeight, kCameraPitch, kTargetPitch, frc::Rotation2d(units::degree_t(-target.GetYaw())), frc::Rotation2d(units::degree_t(gyro.GetRotation2d)), targetPose, cameraToRobot);
wpi::math::Pose2d robotPose = photonlib::EstimateFieldToRobot(
kCameraHeight, kTargetHeight, kCameraPitch, kTargetPitch, wpi::math::Rotation2d(wpi::units::degree_t(-target.GetYaw())), wpi::math::Rotation2d(wpi::units::degree_t(gyro.GetRotation2d)), targetPose, cameraToRobot);

.. code-block:: python

Expand Down Expand Up @@ -106,8 +106,8 @@ You can get a [translation](https://docs.wpilib.org/en/latest/docs/software/adva
.. code-block:: c++

// Calculate a translation from the camera to the target.
frc::Translation2d translation = photonlib::PhotonUtils::EstimateCameraToTargetTranslation(
distance, frc::Rotation2d(units::degree_t(-target.GetYaw())));
wpi::math::Translation2d translation = photonlib::PhotonUtils::EstimateCameraToTargetTranslation(
distance, wpi::math::Rotation2d(wpi::units::degree_t(-target.GetYaw())));

.. code-block:: python

Expand Down
2 changes: 1 addition & 1 deletion docs/source/docs/quick-start/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ If you would like to access your Ethernet-connected vision device from a compute

.. code-block:: c++

wpi::PortForwarder::GetInstance().Add(5800, "photonvision.local", 5800);
wpi::net::PortForwarder::GetInstance().Add(5800, "photonvision.local", 5800);

.. code-block:: python

Expand Down
1 change: 1 addition & 0 deletions photon-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies {
wpilibNatives wpilibTools.deps.wpilib("wpimath")
wpilibNatives wpilibTools.deps.wpilib("wpinet")
wpilibNatives wpilibTools.deps.wpilib("wpiutil")
wpilibNatives wpilibTools.deps.wpilib("datalog")
wpilibNatives wpilibTools.deps.wpilib("ntcore")
wpilibNatives wpilibTools.deps.wpilib("cscore")
wpilibNatives wpilibTools.deps.wpilib("apriltag")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import edu.wpi.first.cscore.UsbCameraInfo;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
Expand All @@ -35,6 +34,7 @@
import org.photonvision.vision.pipeline.CVPipelineSettings;
import org.photonvision.vision.pipeline.DriverModePipelineSettings;
import org.photonvision.vision.processes.PipelineManager;
import org.wpilib.vision.camera.UsbCameraInfo;

public class CameraConfiguration {
private static final Logger logger = new Logger(CameraConfiguration.class, LogGroup.Camera);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
package org.photonvision.common.configuration;

import com.fasterxml.jackson.core.JsonProcessingException;
import edu.wpi.first.apriltag.AprilTagFieldLayout;
import edu.wpi.first.apriltag.AprilTagFields;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
Expand All @@ -40,6 +38,8 @@
import org.photonvision.vision.pipeline.CVPipelineSettings;
import org.photonvision.vision.pipeline.DriverModePipelineSettings;
import org.photonvision.vision.processes.VisionSource;
import org.wpilib.vision.apriltag.AprilTagFieldLayout;
import org.wpilib.vision.apriltag.AprilTagFields;
import org.zeroturnaround.zip.ZipUtil;

class LegacyConfigProvider extends ConfigProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

package org.photonvision.common.configuration;

import edu.wpi.first.apriltag.AprilTagFieldLayout;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import org.photonvision.vision.processes.VisionSource;
import org.wpilib.vision.apriltag.AprilTagFieldLayout;

public class PhotonConfiguration {
private final HardwareConfig hardwareConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

package org.photonvision.common.configuration;

import edu.wpi.first.apriltag.AprilTagFieldLayout;
import edu.wpi.first.apriltag.AprilTagFields;
import edu.wpi.first.cscore.UsbCameraInfo;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
Expand All @@ -40,6 +37,9 @@
import org.photonvision.common.util.file.JacksonUtils;
import org.photonvision.vision.pipeline.CVPipelineSettings;
import org.photonvision.vision.pipeline.DriverModePipelineSettings;
import org.wpilib.vision.apriltag.AprilTagFieldLayout;
import org.wpilib.vision.apriltag.AprilTagFields;
import org.wpilib.vision.camera.UsbCameraInfo;

/**
* Saves settings in a SQLite database file (called photon.sqlite).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

package org.photonvision.common.dataflow.networktables;

import edu.wpi.first.networktables.NetworkTableEvent;
import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.networktables.Subscriber;
import java.util.EnumSet;
import java.util.function.Consumer;
import org.wpilib.networktables.NetworkTableEvent;
import org.wpilib.networktables.NetworkTableInstance;
import org.wpilib.networktables.Subscriber;

public class NTDataChangeListener {
private final NetworkTableInstance instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@

package org.photonvision.common.dataflow.networktables;

import edu.wpi.first.math.geometry.Transform3d;
import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEvent;
import edu.wpi.first.networktables.NetworkTablesJNI;
import java.util.List;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer;
Expand All @@ -35,6 +31,10 @@
import org.photonvision.vision.pipeline.result.CVPipelineResult;
import org.photonvision.vision.pipeline.result.CalibrationPipelineResult;
import org.photonvision.vision.target.TrackedTarget;
import org.wpilib.math.geometry.Transform3d;
import org.wpilib.networktables.NetworkTable;
import org.wpilib.networktables.NetworkTableEvent;
import org.wpilib.networktables.NetworkTablesJNI;

public class NTDataPublisher implements CVPipelineResultConsumer {
private final Logger logger = new Logger(NTDataPublisher.class, LogGroup.General);
Expand Down Expand Up @@ -177,7 +177,8 @@ public void accept(CVPipelineResult result) {

var offset = NetworkTablesManager.getInstance().getOffset();

// Transform the metadata timestamps from the local nt::Now timebase to the Time Sync Server's
// Transform the metadata timestamps from the local wpi::nt::Now timebase to the Time Sync
// Server's
// timebase
var simplified =
new PhotonPipelineResult(
Expand Down
Loading
Loading