Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
542 changes: 271 additions & 271 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

262 changes: 131 additions & 131 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,134 +12,134 @@ concurrency:
cancel-in-progress: true

jobs:
# build-py:
# runs-on: ubuntu-24.04
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v6
# with:
# fetch-depth: 0
#
# - name: Set up Python
# uses: actions/setup-python@v6
# with:
# python-version: 3.14
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install setuptools wheel
#
# - name: Build wheel
# working-directory: ./photon-lib/py
# run: python setup.py sdist bdist_wheel
#
# - name: Upload artifacts
# uses: actions/upload-artifact@v7
# with:
# name: dist
# path: ./photon-lib/py/dist/
#
# test-py:
# needs: build-py
# runs-on: ubuntu-24.04
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v6
# with:
# fetch-depth: 0
#
# - name: Set up Python
# uses: actions/setup-python@v6
# with:
# python-version: 3.14
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install pytest mypy
#
# - name: Download artifacts
# uses: actions/download-artifact@v8
# with:
# name: dist
# path: dist/
#
# - name: Install package
# shell: bash
# run: pip install --no-cache-dir dist/*.whl
#
# - name: Run Unit Tests
# shell: bash
# run: pytest --import-mode=importlib photon-lib/py/test/
#
# - name: Run mypy type checking
# run: mypy --show-column-numbers --config-file photon-lib/py/pyproject.toml photon-lib
#
# build-python-examples:
# needs: build-py
# strategy:
# matrix:
# os: [ubuntu-24.04, windows-2022, macos-14]
# runs-on: ${{ matrix.os }}
#
# steps:
#
# - name: Checkout code
# uses: actions/checkout@v6
# with:
# fetch-depth: 0
#
# - name: Set up Python
# uses: actions/setup-python@v6
# with:
# python-version: 3.14
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
#
# - name: Download artifacts
# uses: actions/download-artifact@v8
# with:
# name: dist
# path: ./photon-lib/py/dist/
#
# - name: Install PhotonLibPy package
# working-directory: ./photon-lib/py
# shell: bash
# run: |
# pip install --no-cache-dir dist/*.whl
#
# - name: Build Python examples
# working-directory: photonlib-python-examples
# shell: bash
# run: |
# for folder in */;
# do
# echo $folder
# ./run.sh $folder
# done
#
# deploy:
# needs: [test-py, build-python-examples]
# runs-on: ubuntu-24.04
# # Only upload on tags
# if: startsWith(github.ref, 'refs/tags/v')
#
# steps:
# - name: Download artifacts
# uses: actions/download-artifact@v8
# with:
# name: dist
# path: dist/
#
# - name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# packages-dir: ./dist/
#
# permissions:
# id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
build-py:
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.14

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel

- name: Build wheel
working-directory: ./photon-lib/py
run: python setup.py sdist bdist_wheel

- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: dist
path: ./photon-lib/py/dist/

test-py:
needs: build-py
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.14

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest mypy

- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: dist
path: dist/

- name: Install package
shell: bash
run: pip install --no-cache-dir dist/*.whl

- name: Run Unit Tests
shell: bash
run: pytest --import-mode=importlib photon-lib/py/test/

- name: Run mypy type checking
run: mypy --show-column-numbers --config-file photon-lib/py/pyproject.toml photon-lib

build-python-examples:
needs: build-py
strategy:
matrix:
os: [ubuntu-24.04, windows-2022, macos-14]
runs-on: ${{ matrix.os }}

steps:

- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.14

- name: Install dependencies
run: |
python -m pip install --upgrade pip

- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: dist
path: ./photon-lib/py/dist/

- name: Install PhotonLibPy package
working-directory: ./photon-lib/py
shell: bash
run: |
pip install --no-cache-dir dist/*.whl

- name: Build Python examples
working-directory: photonlib-python-examples
shell: bash
run: |
for folder in */;
do
echo $folder
./run.sh $folder
done

deploy:
needs: [test-py, build-python-examples]
runs-on: ubuntu-24.04
# Only upload on tags
if: startsWith(github.ref, 'refs/tags/v')

steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: dist
path: dist/

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./dist/

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id "cpp"
id "com.diffplug.spotless" version "8.1.0"
id "org.wpilib.WPILibRepositoriesPlugin" version "2027.0.0"
id 'org.wpilib.NativeUtils' version '2027.4.1' apply false
id 'org.wpilib.NativeUtils' version '2027.5.1' apply false
id 'org.wpilib.DeployUtils' version '2027.1.0' apply false
id 'org.photonvision.tools.WpilibTools' version '3.0.0-photon'
id 'com.google.protobuf' version '0.9.5' apply false
Expand Down Expand Up @@ -34,20 +34,21 @@ ext.allOutputsFolder = file("$project.buildDir/outputs")
apply from: "versioningHelper.gradle"

ext {
wpilibVersion = "2027.0.0-alpha-4"
wpilibVersion = "2027.0.0-alpha-5"
wpimathVersion = wpilibVersion
openCVYear = "2025"
openCVversion = "4.10.0-3"
ejmlVersion = "0.43.1";
jacksonVersion = "2.15.2";
avajeJsonbVersion = "3.11";
quickbufVersion = "1.3.3";
jacocoVersion = "0.8.14";

javalinVersion = "6.7.0"
libcameraDriverVersion = "v2026.0.0"
rknnVersion = "dev-v2026.0.1-1-g89b2888"
rubikVersion = "dev-v2026.0.1-4-g13d6279"
frcYear = "2027_alpha4"
frcYear = "2027_alpha5"
mrcalVersion = "v2027.0.1";

pubVersion = versionString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ public class Robot extends TimedRobot {
camera.getAllUnreadResults();
}

var t1 = Timer.getFPGATimestamp();
var t1 = Timer.getMonotonicTimestamp();
light.set(true);
var t2 = Timer.getFPGATimestamp();
var t2 = Timer.getMonotonicTimestamp();


for (int i = 0; i < 100; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public NTDataChangeListener(
this.instance = instance;
listenerID =
this.instance.addListener(
watchedEntry, EnumSet.of(NetworkTableEvent.Kind.kValueAll), dataChangeConsumer);
watchedEntry, EnumSet.of(NetworkTableEvent.Kind.VALUE_ALL), dataChangeConsumer);
}

public void remove() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public NTDriverStation(NetworkTableInstance inst) {

fmsTable.addListener(
"FMSControlData",
EnumSet.of(Kind.kValueAll),
EnumSet.of(Kind.VALUE_ALL),
(table, key, event) -> {
if (event.is(Kind.kValueAll) && event.valueData.value.isInteger()) {
if (event.is(Kind.VALUE_ALL) && event.valueData.value.isInteger()) {
// Logger totally isnt thread safe but whatevs
var word = NTDriverStation.getControlWord(event.valueData.value.getInteger());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ public class NetworkTablesManager {

private NetworkTablesManager() {
ntInstance.addLogger(
LogMessage.kInfo, LogMessage.kCritical, this::logNtMessage); // to hide error messages
LogMessage.INFO, LogMessage.CRITICAL, this::logNtMessage); // to hide error messages
ntInstance.addConnectionListener(true, this::checkNtConnectState); // to hide error messages

ntInstance.addListener(
m_fieldLayoutSubscriber, EnumSet.of(Kind.kValueAll), this::onFieldLayoutChanged);
m_fieldLayoutSubscriber, EnumSet.of(Kind.VALUE_ALL), this::onFieldLayoutChanged);

ntDriverStation = new NTDriverStation(this.getNTInst());

Expand Down Expand Up @@ -126,16 +126,16 @@ public void setMismatchAlert(boolean on, String message) {
private void logNtMessage(NetworkTableEvent event) {
String levelmsg = "DEBUG";
LogLevel pvlevel = LogLevel.DEBUG;
if (event.logMessage.level >= LogMessage.kCritical) {
if (event.logMessage.level >= LogMessage.CRITICAL) {
pvlevel = LogLevel.ERROR;
levelmsg = "CRITICAL";
} else if (event.logMessage.level >= LogMessage.kError) {
} else if (event.logMessage.level >= LogMessage.ERROR) {
pvlevel = LogLevel.ERROR;
levelmsg = "ERROR";
} else if (event.logMessage.level >= LogMessage.kWarning) {
} else if (event.logMessage.level >= LogMessage.WARNING) {
pvlevel = LogLevel.WARN;
levelmsg = "WARNING";
} else if (event.logMessage.level >= LogMessage.kInfo) {
} else if (event.logMessage.level >= LogMessage.INFO) {
pvlevel = LogLevel.INFO;
levelmsg = "INFO";
}
Expand All @@ -156,8 +156,8 @@ private void logNtMessage(NetworkTableEvent event) {
}

public void checkNtConnectState(NetworkTableEvent event) {
var isConnEvent = event.is(Kind.kConnected);
var isDisconnEvent = event.is(Kind.kDisconnected);
var isConnEvent = event.is(Kind.CONNECTED);
var isDisconnEvent = event.is(Kind.DISCONNECTED);

if (isDisconnEvent) {
var msg =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static class FileSourceSettables extends VisionSourceSettables {
this.frameStaticProperties = frameStaticProperties;
videoMode =
new VideoMode(
PixelFormat.kMJPEG,
PixelFormat.MJPEG,
frameStaticProperties.imageWidth,
frameStaticProperties.imageHeight,
30);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ private void cacheVideoModes() {
try {
for (VideoMode videoMode : camera.enumerateVideoModes()) {
// Filter grey modes
if (videoMode.pixelFormat == PixelFormat.kGray
|| videoMode.pixelFormat == PixelFormat.kUnknown) {
if (videoMode.pixelFormat == PixelFormat.GRAY
|| videoMode.pixelFormat == PixelFormat.UNKNOWN) {
continue;
}

Expand Down
Loading
Loading