Skip to content
Merged

2027 #22

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
15 changes: 7 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
arch-name: linuxx86-64
- os: ubuntu-22.04-arm
- os: ubuntu-24.04-arm
arch-name: linuxarm64
- os: windows-latest
arch-name: windowsx86-64
Expand All @@ -41,10 +41,9 @@ jobs:
run: git fetch --tags --force
- run: git describe --tags

- name: Install Java 17
uses: actions/setup-java@v5
- uses: actions/setup-java@v5
with:
java-version: 17
java-version: 25
distribution: temurin

- name: Install deps (Linux)
Expand Down Expand Up @@ -74,16 +73,16 @@ jobs:
name: Publish
env:
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
if: github.event_name == 'push'
if: github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v')

- uses: actions/upload-artifact@v5
- uses: actions/upload-artifact@v7
with:
name: libmrcal-jar-${{ matrix.arch-name }}
path: ${{ github.workspace }}/build/libs/*.jar

release:
needs: build-host
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
# Download literally every single artifact. This also downloads client and docs,
# but the filtering below won't pick these up (I hope)
Expand Down
11 changes: 5 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ include(FetchContent)
# OpenCV configuration
# Keep this in sync with build.gradle and with
# https://github.com/PhotonVision/photonvision/blob/main/build.gradle
set(OPENCV_YEAR "frc2025")
set(OPENCV_VERSION "4.10.0-3")
set(WPIMATH_VERSION "2026.2.1")
set(OPENCV_VERSION "2027-4.13.0-3")
set(WPIMATH_VERSION "2027.0.0-alpha-5")

# type can be "", "debug", "static", or "staticdebug"
set(OPENCV_TYPE "")
Expand All @@ -32,15 +31,15 @@ message(STATUS "Using FRC OpenCV for architecture: ${OPENCV_ARCH}")
FetchContent_Declare(
opencv_lib
URL
https://frcmaven.wpi.edu/artifactory/release/edu/wpi/first/thirdparty/${OPENCV_YEAR}/opencv/opencv-cpp/${OPENCV_VERSION}/opencv-cpp-${OPENCV_VERSION}-${OPENCV_ARCH}${OPENCV_TYPE}.zip
https://frcmaven.wpi.edu/artifactory/release/org/wpilib/thirdparty/opencv/opencv-cpp/${OPENCV_VERSION}/opencv-cpp-${OPENCV_VERSION}-${OPENCV_ARCH}${OPENCV_TYPE}.zip
)
FetchContent_MakeAvailable(opencv_lib)

# download OpenCV headers
FetchContent_Declare(
opencv_header
URL
https://frcmaven.wpi.edu/artifactory/release/edu/wpi/first/thirdparty/${OPENCV_YEAR}/opencv/opencv-cpp/${OPENCV_VERSION}/opencv-cpp-${OPENCV_VERSION}-headers.zip
https://frcmaven.wpi.edu/artifactory/release/org/wpilib/thirdparty/opencv/opencv-cpp/${OPENCV_VERSION}/opencv-cpp-${OPENCV_VERSION}-headers.zip
)
FetchContent_MakeAvailable(opencv_header)

Expand All @@ -58,7 +57,7 @@ message(STATUS "Using FRC OpenCV libraries: ${OPENCV_LIB_PATH}")
FetchContent_Declare(
wpimath_header
URL
https://frcmaven.wpi.edu/artifactory/release/edu/wpi/first/wpimath/wpimath-cpp/${WPIMATH_VERSION}/wpimath-cpp-${WPIMATH_VERSION}-headers.zip
https://frcmaven.wpi.edu/artifactory/release-2027/org/wpilib/wpimath/wpimath-cpp/${WPIMATH_VERSION}/wpimath-cpp-${WPIMATH_VERSION}-headers.zip
)
FetchContent_MakeAvailable(wpimath_header)
set(WPIMATH_INCLUDE_PATH ${wpimath_header_SOURCE_DIR})
Expand Down
14 changes: 9 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "java"
id 'org.photonvision.tools.WpilibTools' version '2.3.1-photon'
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
id 'org.photonvision.tools.WpilibTools' version '3.1.0-photon'
id "org.wpilib.WPILibRepositoriesPlugin" version "2027.0.0"
id "com.diffplug.spotless" version "8.1.0"
}

Expand All @@ -11,6 +11,7 @@ allprojects {
mavenLocal()
maven { url = "https://maven.photonvision.org/repository/internal/" }
}
wpilibRepositories.use2027Repos()
wpilibRepositories.addAllReleaseRepositories(it)
wpilibRepositories.addAllDevelopmentRepositories(it)
}
Expand All @@ -24,19 +25,22 @@ ext {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}

wpilibTools.deps.wpilibVersion = "2027.0.0-alpha-5"

dependencies {
implementation wpilibTools.deps.wpilibOpenCvJava("frc2025", "4.10.0-3")
implementation wpilibTools.deps.wpilibOpenCvJava("2027-4.13.0-3")

// Junit
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

implementation wpilibTools.deps.wpilibJava("wpimath")
implementation wpilibTools.deps.wpilibJava("wpiunits")
// This is included for protobuf support
implementation wpilibTools.deps.wpilibJava("wpiutil")
implementation "com.fasterxml.jackson.core:jackson-annotations:2.15.2"
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/photonvision/mrcal/MrCalJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

package org.photonvision.mrcal;

import edu.wpi.first.math.VecBuilder;
import edu.wpi.first.math.geometry.Pose3d;
import edu.wpi.first.math.geometry.Rotation3d;
import edu.wpi.first.math.geometry.Translation3d;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.opencv.core.MatOfFloat;
import org.opencv.core.MatOfPoint2f;
import org.wpilib.math.geometry.Pose3d;
import org.wpilib.math.geometry.Rotation3d;
import org.wpilib.math.geometry.Translation3d;
import org.wpilib.math.linalg.VecBuilder;

public class MrCalJNI {
public static enum CameraLensModel {
Expand Down
62 changes: 28 additions & 34 deletions versioningHelper.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,35 @@ import java.nio.file.Path
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter

gradle.allprojects {
ext.getCurrentVersion = {
->
def stdout = new ByteArrayOutputStream()
String tagIsh
try {
exec {
commandLine 'git', 'describe', '--tags', "--match=v*"
standardOutput = stdout
}
tagIsh = stdout.toString().trim().toLowerCase()
} catch (Exception e) {
tagIsh = "dev-Unknown"
}

// Dev tags: v2021.1.6-3-gf922466d
// We're specifically looking to capture the middle -3-
boolean isDev = tagIsh.matches(".*-[0-9]*-g[0-9a-f]*")
if (isDev && !tagIsh.startsWith("dev-")) tagIsh = "dev-" + tagIsh
println("Picked up version: " + tagIsh)
return tagIsh
ext.getCurrentVersion = {
String tagIsh = "dev-unknown"
try {
tagIsh = providers.exec {
commandLine 'git', 'describe', '--tags', '--match=v*'
}.standardOutput.asText.get().trim().toLowerCase()
} catch (Exception ignored) {
tagIsh = "dev-unknown"
}

if (!ext.has("versionString")) {
ext.versionString = getCurrentVersion()
}
// Dev tags: v2021.1.6-3-gf922466d
// We're specifically looking to capture the middle -3-
boolean isDev = tagIsh.matches(".*-[0-9]*-g[0-9a-f]*")
if (isDev && !tagIsh.startsWith("dev-")) tagIsh = "dev-" + tagIsh
println("Picked up version: " + tagIsh)
return tagIsh
}

ext.writePhotonVersionFile = {File versionFileIn, Path path, String version ->
println("Writing " + version + " to " + path.toAbsolutePath().toString())
String date = DateTimeFormatter.ofPattern("yyyy-M-d hh:mm:ss").format(LocalDateTime.now())
File versionFileOut = new File(path.toAbsolutePath().toString())
versionFileOut.delete()
def read = versionFileIn.text.replace('${version}', version).replace('${date}', date)
if (!versionFileOut.parentFile.exists()) versionFileOut.parentFile.mkdirs()
if (!versionFileOut.exists()) versionFileOut.createNewFile()
versionFileOut.write(read)
}
if (!ext.has("versionString")) {
ext.versionString = getCurrentVersion()
}

ext.writePhotonVersionFile = {File versionFileIn, Path path, String version ->
println("Writing " + version + " to " + path.toAbsolutePath().toString())
String date = DateTimeFormatter.ofPattern("yyyy-M-d hh:mm:ss").format(LocalDateTime.now())
File versionFileOut = new File(path.toAbsolutePath().toString())
versionFileOut.delete()
def read = versionFileIn.text.replace('${version}', version).replace('${date}', date)
if (!versionFileOut.parentFile.exists()) versionFileOut.parentFile.mkdirs()
if (!versionFileOut.exists()) versionFileOut.createNewFile()
versionFileOut.write(read)
}
Loading