mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Bump wpilib versions to 2024 beta 1 (#947)
This commit is contained in:
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
@@ -106,14 +106,14 @@ jobs:
|
||||
run: |
|
||||
chmod +x gradlew
|
||||
./gradlew copyPhotonlib -x check
|
||||
./gradlew buildAllExamples -x check --max-workers 2
|
||||
./gradlew build -x check --max-workers 2
|
||||
|
||||
- name: Build C++ examples
|
||||
working-directory: photonlib-cpp-examples
|
||||
run: |
|
||||
chmod +x gradlew
|
||||
./gradlew copyPhotonlib -x check
|
||||
./gradlew buildAllExamples -x check --max-workers 2
|
||||
./gradlew build -x check --max-workers 2
|
||||
photon-build-all:
|
||||
# The type of runner that the job will run on.
|
||||
runs-on: ubuntu-22.04
|
||||
@@ -225,6 +225,7 @@ jobs:
|
||||
include:
|
||||
- os: windows-2022
|
||||
artifact-name: Win64
|
||||
architecture: x64
|
||||
# Mac builds are broken due to opencv class loading issues -- disable for now
|
||||
# - os: macos-11
|
||||
# artifact-name: macOS
|
||||
@@ -255,7 +256,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- container: wpilib/roborio-cross-ubuntu:2023-22.04
|
||||
- container: wpilib/roborio-cross-ubuntu:2024-22.04
|
||||
artifact-name: Athena
|
||||
- container: wpilib/raspbian-cross-ubuntu:bullseye-22.04
|
||||
artifact-name: Raspbian
|
||||
|
||||
18
build.gradle
18
build.gradle
@@ -2,12 +2,12 @@ plugins {
|
||||
id "com.diffplug.spotless" version "6.19.0"
|
||||
id "com.github.johnrengelman.shadow" version "7.1.2"
|
||||
id "com.github.node-gradle.node" version "3.1.1" apply false
|
||||
id "edu.wpi.first.GradleJni" version "1.0.0"
|
||||
id "edu.wpi.first.GradleVsCode" version "1.1.0"
|
||||
id "edu.wpi.first.NativeUtils" version "2023.11.1" apply false
|
||||
id "edu.wpi.first.GradleJni" version "1.1.0"
|
||||
id "edu.wpi.first.GradleVsCode" version "1.3.0"
|
||||
id "edu.wpi.first.NativeUtils" version "2024.2.0" apply false
|
||||
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
|
||||
id "org.hidetake.ssh" version "2.10.1"
|
||||
id 'edu.wpi.first.WpilibTools' version '1.0.0'
|
||||
id 'edu.wpi.first.WpilibTools' version '1.1.0'
|
||||
}
|
||||
|
||||
import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency;
|
||||
@@ -26,10 +26,12 @@ allprojects {
|
||||
apply from: "versioningHelper.gradle"
|
||||
|
||||
ext {
|
||||
wpilibVersion = "2023.4.2"
|
||||
opencvVersion = "4.6.0-4"
|
||||
wpilibVersion = "2024.1.1-beta-1"
|
||||
openCVversion = "4.8.0-1"
|
||||
joglVersion = "2.4.0-rc-20200307"
|
||||
javalinVersion = "5.6.2"
|
||||
frcYear = "2024"
|
||||
|
||||
pubVersion = versionString
|
||||
isDev = pubVersion.startsWith("dev")
|
||||
|
||||
@@ -61,3 +63,7 @@ spotless {
|
||||
targetExclude("photon-lib/src/main/java/org/photonvision/PhotonVersion.java")
|
||||
}
|
||||
}
|
||||
|
||||
wrapper {
|
||||
gradleVersion '8.3'
|
||||
}
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
distributionUrl=https\://services\.gradle\.org/distributions/gradle-8\.3-bin\.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
3
gradlew
vendored
3
gradlew
vendored
@@ -36,7 +36,8 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'edu.wpi.first.WpilibTools' version '1.0.0'
|
||||
id 'edu.wpi.first.WpilibTools' version '1.1.0'
|
||||
}
|
||||
|
||||
import java.nio.file.Path
|
||||
|
||||
@@ -17,10 +17,9 @@
|
||||
|
||||
package org.photonvision.vision.aruco;
|
||||
|
||||
import org.opencv.aruco.Aruco;
|
||||
import org.opencv.aruco.ArucoDetector;
|
||||
import org.opencv.aruco.DetectorParameters;
|
||||
import org.opencv.aruco.Dictionary;
|
||||
import org.opencv.objdetect.ArucoDetector;
|
||||
import org.opencv.objdetect.DetectorParameters;
|
||||
import org.opencv.objdetect.Objdetect;
|
||||
import org.photonvision.common.logging.LogGroup;
|
||||
import org.photonvision.common.logging.Logger;
|
||||
|
||||
@@ -31,7 +30,7 @@ public class ArucoDetectorParams {
|
||||
private int m_iterations = -1;
|
||||
private double m_accuracy = -1;
|
||||
|
||||
DetectorParameters parameters = DetectorParameters.create();
|
||||
DetectorParameters parameters = new DetectorParameters();
|
||||
ArucoDetector detector;
|
||||
|
||||
public ArucoDetectorParams() {
|
||||
@@ -39,7 +38,9 @@ public class ArucoDetectorParams {
|
||||
setCornerAccuracy(25);
|
||||
setCornerRefinementMaxIterations(100);
|
||||
|
||||
detector = new ArucoDetector(Dictionary.get(Aruco.DICT_APRILTAG_16h5), parameters);
|
||||
detector =
|
||||
new ArucoDetector(
|
||||
Objdetect.getPredefinedDictionary(Objdetect.DICT_APRILTAG_16h5), parameters);
|
||||
}
|
||||
|
||||
public void setDecimation(float decimate) {
|
||||
@@ -56,7 +57,7 @@ public class ArucoDetectorParams {
|
||||
public void setCornerRefinementMaxIterations(int iters) {
|
||||
if (iters == m_iterations || iters <= 0) return;
|
||||
|
||||
parameters.set_cornerRefinementMethod(Aruco.CORNER_REFINE_SUBPIX);
|
||||
parameters.set_cornerRefinementMethod(Objdetect.CORNER_REFINE_SUBPIX);
|
||||
parameters.set_cornerRefinementMaxIterations(iters); // 200
|
||||
|
||||
m_iterations = iters;
|
||||
|
||||
@@ -24,8 +24,8 @@ import edu.wpi.first.math.geometry.Translation3d;
|
||||
import edu.wpi.first.math.util.Units;
|
||||
import java.util.ArrayList;
|
||||
import org.opencv.aruco.Aruco;
|
||||
import org.opencv.aruco.ArucoDetector;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.objdetect.ArucoDetector;
|
||||
import org.photonvision.common.logging.LogGroup;
|
||||
import org.photonvision.common.logging.Logger;
|
||||
import org.photonvision.vision.calibration.CameraCalibrationCoefficients;
|
||||
|
||||
@@ -19,8 +19,8 @@ package org.photonvision.vision.pipe.impl;
|
||||
|
||||
import edu.wpi.first.math.util.Units;
|
||||
import java.util.List;
|
||||
import org.opencv.aruco.DetectorParameters;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.objdetect.DetectorParameters;
|
||||
import org.photonvision.vision.aruco.ArucoDetectionResult;
|
||||
import org.photonvision.vision.aruco.PhotonArucoDetector;
|
||||
import org.photonvision.vision.pipe.CVPipe;
|
||||
@@ -45,6 +45,6 @@ public class ArucoDetectionPipe
|
||||
}
|
||||
|
||||
public DetectorParameters getParameters() {
|
||||
return params == null ? null : params.detectorParams.get_params();
|
||||
return params == null ? null : params.detectorParams.getDetectorParameters();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
package org.photonvision.vision.pipe.impl;
|
||||
|
||||
import java.util.Objects;
|
||||
import org.opencv.aruco.ArucoDetector;
|
||||
import org.opencv.objdetect.ArucoDetector;
|
||||
import org.photonvision.vision.calibration.CameraCalibrationCoefficients;
|
||||
|
||||
public class ArucoDetectionPipeParams {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'edu.wpi.first.WpilibTools' version '1.0.0'
|
||||
id 'edu.wpi.first.WpilibTools' version '1.1.0'
|
||||
}
|
||||
|
||||
import java.nio.file.Path
|
||||
@@ -50,10 +50,10 @@ dependencies {
|
||||
implementation "com.fasterxml.jackson.core:jackson-core:2.12.4"
|
||||
implementation "com.fasterxml.jackson.core:jackson-databind:2.12.4"
|
||||
|
||||
implementation "edu.wpi.first.thirdparty.frc2023.opencv:opencv-java:$opencvVersion"
|
||||
implementation "edu.wpi.first.thirdparty.frc2023.opencv:opencv-jni:$opencvVersion:$jniPlatform"
|
||||
implementation "edu.wpi.first.thirdparty.frc2024.opencv:opencv-java:$openCVversion"
|
||||
implementation "edu.wpi.first.thirdparty.frc2024.opencv:opencv-jni:$openCVversion:$jniPlatform"
|
||||
|
||||
implementation "org.ejml:ejml-simple:0.41"
|
||||
implementation "org.ejml:ejml-simple:0.42"
|
||||
|
||||
// Junit
|
||||
testImplementation wpilibTools.deps.wpilibJava("cscore")
|
||||
@@ -126,7 +126,9 @@ task generateVendorJson() {
|
||||
if (photonlibFileOutput.exists()) {
|
||||
photonlibFileOutput.delete()
|
||||
}
|
||||
def read = photonlibFileInput.text.replace('${photon_version}', pubVersion)
|
||||
def read = photonlibFileInput.text
|
||||
.replace('${photon_version}', pubVersion)
|
||||
.replace('${frc_year}', frcYear)
|
||||
photonlibFileOutput.write(read)
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ copyAllOutputs.dependsOn outputVersions
|
||||
|
||||
ext.addTaskToCopyAllOutputs = { task ->
|
||||
copyAllOutputs.dependsOn task
|
||||
copyAllOutputs.inputs.file task.archivePath
|
||||
copyAllOutputs.from task.archivePath
|
||||
copyAllOutputs.inputs.file task.archiveFile
|
||||
copyAllOutputs.from task.archiveFile
|
||||
}
|
||||
|
||||
def artifactGroupId = 'org.photonvision'
|
||||
@@ -49,7 +49,7 @@ def javaBaseName = "_GROUP_org_photonvision_photonlib_ID_${baseArtifactId}-java_
|
||||
task cppHeadersZip(type: Zip) {
|
||||
destinationDirectory = outputsFolder
|
||||
archiveBaseName = zipBaseName
|
||||
classifier = "headers"
|
||||
archiveClassifier = "headers"
|
||||
|
||||
from(licenseFile) {
|
||||
into '/'
|
||||
@@ -67,7 +67,7 @@ task cppHeadersZip(type: Zip) {
|
||||
task cppSourcesZip(type: Zip) {
|
||||
destinationDirectory = outputsFolder
|
||||
archiveBaseName = zipBaseName
|
||||
classifier = "sources"
|
||||
archiveClassifier = "sources"
|
||||
|
||||
from(licenseFile) {
|
||||
into '/'
|
||||
@@ -84,12 +84,12 @@ build.dependsOn cppSourcesZip
|
||||
addTaskToCopyAllOutputs(cppSourcesZip)
|
||||
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier = 'sources'
|
||||
archiveClassifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
classifier = 'javadoc'
|
||||
archiveClassifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
@@ -102,14 +102,14 @@ task outputJar(type: Jar, dependsOn: classes) {
|
||||
task outputSourcesJar(type: Jar, dependsOn: classes) {
|
||||
archiveBaseName = javaBaseName
|
||||
destinationDirectory = outputsFolder
|
||||
classifier = 'sources'
|
||||
archiveClassifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
task outputJavadocJar(type: Jar, dependsOn: javadoc) {
|
||||
archiveBaseName = javaBaseName
|
||||
destinationDirectory = outputsFolder
|
||||
classifier = 'javadoc'
|
||||
archiveClassifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
@@ -198,5 +198,10 @@ model {
|
||||
}
|
||||
}
|
||||
|
||||
// So I don't actually know the _right_ way to tell gradle that the vendordep json publish requires generation first, so we're doing this
|
||||
getTasksByName("publishVendorjsonPublicationToMavenLocal", false).each {
|
||||
it.mustRunAfter generateVendorJson
|
||||
}
|
||||
|
||||
publishToMavenLocal.dependsOn libraryBuild
|
||||
publish.dependsOn libraryBuild
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"fileName": "photonlib.json",
|
||||
"name": "photonlib",
|
||||
"version": "${photon_version}",
|
||||
"uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004 ",
|
||||
"uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004",
|
||||
"frcYear": "${frc_year}",
|
||||
"mavenUrls": [
|
||||
"https://maven.photonvision.org/repository/internal",
|
||||
"https://maven.photonvision.org/repository/snapshots"
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <frc/Errors.h>
|
||||
#include <frc/geometry/Pose3d.h>
|
||||
#include <frc/geometry/Rotation3d.h>
|
||||
@@ -337,21 +338,17 @@ frc::Pose3d detail::ToPose3d(const cv::Mat& tvec, const cv::Mat& rvec) {
|
||||
R = R.t(); // rotation of inverse
|
||||
cv::Mat tvecI = -R * tvec; // translation of inverse
|
||||
|
||||
Vectord<3> tv;
|
||||
Eigen::Matrix<double, 3, 1> tv;
|
||||
tv[0] = +tvecI.at<double>(2, 0);
|
||||
tv[1] = -tvecI.at<double>(0, 0);
|
||||
tv[2] = -tvecI.at<double>(1, 0);
|
||||
Vectord<3> rv;
|
||||
Eigen::Matrix<double, 3, 1> rv;
|
||||
rv[0] = +rvec.at<double>(2, 0);
|
||||
rv[1] = -rvec.at<double>(0, 0);
|
||||
rv[2] = +rvec.at<double>(1, 0);
|
||||
|
||||
return Pose3d(Translation3d(meter_t{tv[0]}, meter_t{tv[1]}, meter_t{tv[2]}),
|
||||
Rotation3d(
|
||||
// radian_t{rv[0]},
|
||||
// radian_t{rv[1]},
|
||||
// radian_t{rv[2]}
|
||||
rv, radian_t{rv.norm()}));
|
||||
Rotation3d(rv));
|
||||
}
|
||||
|
||||
std::optional<EstimatedRobotPose> PhotonPoseEstimator::MultiTagPnpStrategy(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'edu.wpi.first.WpilibTools' version '1.0.0'
|
||||
id 'edu.wpi.first.WpilibTools' version '1.1.0'
|
||||
}
|
||||
|
||||
apply plugin: "application"
|
||||
|
||||
@@ -4,7 +4,7 @@ apply from: "${rootDir}/shared/common.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation wpilibTools.deps.wpilibJava("wpimath")
|
||||
implementation "org.ejml:ejml-simple:0.41"
|
||||
implementation "org.ejml:ejml-simple:0.42"
|
||||
|
||||
// Junit
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id "cpp"
|
||||
id "google-test-test-suite"
|
||||
id "edu.wpi.first.GradleRIO" version "2023.4.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-1"
|
||||
|
||||
id "com.dorongold.task-tree" version "2.1.0"
|
||||
}
|
||||
|
||||
3
photonlib-cpp-examples/aimandrange/gradlew
vendored
3
photonlib-cpp-examples/aimandrange/gradlew
vendored
@@ -80,7 +80,8 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
@@ -7,7 +7,7 @@ pluginManagement {
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
gradlePluginPortal()
|
||||
String frcYear = '2023'
|
||||
String frcYear = '2024'
|
||||
File frcHome
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
String publicFolder = System.getenv('PUBLIC')
|
||||
|
||||
@@ -53,11 +53,11 @@ class Robot : public frc::TimedRobot {
|
||||
// PID constants should be tuned per robot
|
||||
const double LINEAR_P = 0.1;
|
||||
const double LINEAR_D = 0.0;
|
||||
frc2::PIDController forwardController{LINEAR_P, 0.0, LINEAR_D};
|
||||
frc::PIDController forwardController{LINEAR_P, 0.0, LINEAR_D};
|
||||
|
||||
const double ANGULAR_P = 0.1;
|
||||
const double ANGULAR_D = 0.0;
|
||||
frc2::PIDController turnController{ANGULAR_P, 0.0, ANGULAR_D};
|
||||
frc::PIDController turnController{ANGULAR_P, 0.0, ANGULAR_D};
|
||||
|
||||
// Change this to match the name of your camera
|
||||
photonlib::PhotonCamera camera{"photonvision"};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id "cpp"
|
||||
id "google-test-test-suite"
|
||||
id "edu.wpi.first.GradleRIO" version "2023.4.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-1"
|
||||
|
||||
id "com.dorongold.task-tree" version "2.1.0"
|
||||
}
|
||||
|
||||
3
photonlib-cpp-examples/aimattarget/gradlew
vendored
3
photonlib-cpp-examples/aimattarget/gradlew
vendored
@@ -80,7 +80,8 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
@@ -7,7 +7,7 @@ pluginManagement {
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
gradlePluginPortal()
|
||||
String frcYear = '2023'
|
||||
String frcYear = '2024'
|
||||
File frcHome
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
String publicFolder = System.getenv('PUBLIC')
|
||||
|
||||
@@ -42,7 +42,7 @@ class Robot : public frc::TimedRobot {
|
||||
// Change this to match the name of your camera
|
||||
photonlib::PhotonCamera camera{"photonvision"};
|
||||
// PID constants should be tuned per robot
|
||||
frc2::PIDController controller{.1, 0, 0};
|
||||
frc::PIDController controller{.1, 0, 0};
|
||||
|
||||
frc::XboxController xboxController{0};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id "cpp"
|
||||
id "google-test-test-suite"
|
||||
id "edu.wpi.first.GradleRIO" version "2023.4.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-1"
|
||||
|
||||
id "com.dorongold.task-tree" version "2.1.0"
|
||||
}
|
||||
|
||||
@@ -80,7 +80,8 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
@@ -7,7 +7,7 @@ pluginManagement {
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
gradlePluginPortal()
|
||||
String frcYear = '2023'
|
||||
String frcYear = '2024'
|
||||
File frcHome
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
String publicFolder = System.getenv('PUBLIC')
|
||||
|
||||
@@ -109,8 +109,8 @@ class Drivetrain {
|
||||
frc::Encoder m_leftEncoder{0, 1};
|
||||
frc::Encoder m_rightEncoder{2, 3};
|
||||
|
||||
frc2::PIDController m_leftPIDController{8.5, 0.0, 0.0};
|
||||
frc2::PIDController m_rightPIDController{8.5, 0.0, 0.0};
|
||||
frc::PIDController m_leftPIDController{8.5, 0.0, 0.0};
|
||||
frc::PIDController m_rightPIDController{8.5, 0.0, 0.0};
|
||||
|
||||
frc::AnalogGyro m_gyro{0};
|
||||
|
||||
|
||||
@@ -28,10 +28,3 @@ spotless {
|
||||
}
|
||||
|
||||
apply from: "examples.gradle"
|
||||
|
||||
// Task that depends on the build task for every example
|
||||
task buildAllExamples { task ->
|
||||
exampleFolderNames.each { line ->
|
||||
task.dependsOn(line + ":build")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id "cpp"
|
||||
id "google-test-test-suite"
|
||||
id "edu.wpi.first.GradleRIO" version "2023.4.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-1"
|
||||
|
||||
id "com.dorongold.task-tree" version "2.1.0"
|
||||
}
|
||||
|
||||
3
photonlib-cpp-examples/getinrange/gradlew
vendored
3
photonlib-cpp-examples/getinrange/gradlew
vendored
@@ -80,7 +80,8 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
@@ -7,7 +7,7 @@ pluginManagement {
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
gradlePluginPortal()
|
||||
String frcYear = '2023'
|
||||
String frcYear = '2024'
|
||||
File frcHome
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
String publicFolder = System.getenv('PUBLIC')
|
||||
|
||||
@@ -53,7 +53,7 @@ class Robot : public frc::TimedRobot {
|
||||
// PID constants should be tuned per robot
|
||||
const double P_GAIN = 0.1;
|
||||
const double D_GAIN = 0.0;
|
||||
frc2::PIDController controller{P_GAIN, 0.0, D_GAIN};
|
||||
frc::PIDController controller{P_GAIN, 0.0, D_GAIN};
|
||||
|
||||
// Change this to match the name of your camera
|
||||
photonlib::PhotonCamera camera{"photonvision"};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
distributionUrl=https\://services\.gradle\.org/distributions/gradle-8\.3-bin\.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
3
photonlib-cpp-examples/gradlew
vendored
3
photonlib-cpp-examples/gradlew
vendored
@@ -36,7 +36,8 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2023.4.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-1"
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
|
||||
@@ -6,7 +6,7 @@ pluginManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
String frcYear = '2023'
|
||||
String frcYear = '2024'
|
||||
File frcHome
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
String publicFolder = System.getenv('PUBLIC')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2023.4.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-1"
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
|
||||
@@ -6,7 +6,7 @@ pluginManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
String frcYear = '2023'
|
||||
String frcYear = '2024'
|
||||
File frcHome
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
String publicFolder = System.getenv('PUBLIC')
|
||||
|
||||
@@ -28,10 +28,3 @@ spotless {
|
||||
targetExclude("photon-lib/src/main/java/org/photonvision/PhotonVersion.java")
|
||||
}
|
||||
}
|
||||
|
||||
// Task that depends on the build task for every example
|
||||
task buildAllExamples { task ->
|
||||
exampleFolderNames.each { line ->
|
||||
task.dependsOn(line + ":build")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2023.4.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-1"
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
|
||||
@@ -6,7 +6,7 @@ pluginManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
String frcYear = '2023'
|
||||
String frcYear = '2024'
|
||||
File frcHome
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
String publicFolder = System.getenv('PUBLIC')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
distributionUrl=https\://services\.gradle\.org/distributions/gradle-8\.3-bin\.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
3
photonlib-java-examples/gradlew
vendored
3
photonlib-java-examples/gradlew
vendored
@@ -36,7 +36,8 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2023.4.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-1"
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
|
||||
@@ -6,7 +6,7 @@ pluginManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
String frcYear = '2023'
|
||||
String frcYear = '2024'
|
||||
File frcHome
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
String publicFolder = System.getenv('PUBLIC')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2023.4.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-1"
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=permwrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
distributionUrl=https\://services\.gradle\.org/distributions/gradle-8\.3-bin\.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=permwrapper/dists
|
||||
|
||||
@@ -80,7 +80,8 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
@@ -4,7 +4,7 @@ pluginManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
String frcYear = '2023'
|
||||
String frcYear = '2024'
|
||||
File frcHome
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
String publicFolder = System.getenv('PUBLIC')
|
||||
|
||||
@@ -36,7 +36,6 @@ import edu.wpi.first.math.geometry.Translation3d;
|
||||
import edu.wpi.first.math.numbers.N1;
|
||||
import edu.wpi.first.math.numbers.N3;
|
||||
import edu.wpi.first.math.util.Units;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Constants {
|
||||
public static class Vision {
|
||||
@@ -46,16 +45,8 @@ public class Constants {
|
||||
new Transform3d(new Translation3d(0.5, 0.0, 0.5), new Rotation3d(0, 0, 0));
|
||||
|
||||
// The layout of the AprilTags on the field
|
||||
public static final AprilTagFieldLayout kTagLayout;
|
||||
|
||||
static {
|
||||
try {
|
||||
kTagLayout = AprilTagFields.kDefaultField.loadAprilTagLayoutField();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
public static final AprilTagFieldLayout kTagLayout =
|
||||
AprilTagFields.kDefaultField.loadAprilTagLayoutField();
|
||||
|
||||
// The standard deviations of our vision estimated poses, which affect correction rate
|
||||
// (Fake values. Experiment and determine estimation noise on an actual robot.)
|
||||
|
||||
@@ -36,10 +36,10 @@ dependencies {
|
||||
implementation wpilibTools.deps.wpilibJava("hal")
|
||||
implementation wpilibTools.deps.wpilibJava("wpilibj")
|
||||
|
||||
implementation "edu.wpi.first.thirdparty.frc2023.opencv:opencv-java:$opencvVersion"
|
||||
implementation "edu.wpi.first.thirdparty.frc2023.opencv:opencv-jni:$opencvVersion:$jniPlatform"
|
||||
implementation "edu.wpi.first.thirdparty.frc2024.opencv:opencv-java:$openCVversion"
|
||||
implementation "edu.wpi.first.thirdparty.frc2024.opencv:opencv-jni:$openCVversion:$jniPlatform"
|
||||
|
||||
implementation "org.ejml:ejml-simple:0.41"
|
||||
implementation "org.ejml:ejml-simple:0.42"
|
||||
|
||||
// test stuff
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
|
||||
@@ -51,6 +51,7 @@ test {
|
||||
events "passed", "skipped", "failed", "standardOut", "standardError"
|
||||
}
|
||||
workingDir = new File("${rootDir}")
|
||||
finalizedBy jacocoTestReport
|
||||
}
|
||||
|
||||
task testHeadless(type: Test) {
|
||||
@@ -67,11 +68,19 @@ task generateJavaDocs(type: Javadoc) {
|
||||
destinationDir = file("${projectDir}/build/docs")
|
||||
}
|
||||
|
||||
|
||||
jacoco {
|
||||
toolVersion = "0.8.9"
|
||||
reportsDirectory = layout.buildDirectory.dir('customJacocoReportDir')
|
||||
}
|
||||
|
||||
jacocoTestReport {
|
||||
// dependsOn testHeadless // Tests are required to run before generating the report
|
||||
dependsOn testHeadless
|
||||
|
||||
reports {
|
||||
xml.enabled true
|
||||
xml.required = true
|
||||
csv.required = false
|
||||
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
|
||||
@@ -6,11 +6,14 @@ nativeUtils.withCrossLinuxArm64()
|
||||
|
||||
// Configure WPI dependencies.
|
||||
nativeUtils.wpi.configureDependencies {
|
||||
opencvYear = 'frc2024'
|
||||
googleTestYear = "frc2023"
|
||||
|
||||
wpiVersion = wpilibVersion
|
||||
wpimathVersion = wpilibVersion
|
||||
niLibVersion = "2023.3.0"
|
||||
opencvVersion = "4.6.0-4"
|
||||
googleTestVersion = "1.12.1-1"
|
||||
niLibVersion = "2024.1.1"
|
||||
opencvVersion = openCVversion
|
||||
googleTestVersion = "1.12.1-2"
|
||||
imguiVersion = "1.86-1"
|
||||
}
|
||||
|
||||
@@ -91,7 +94,7 @@ ext.createComponentZipTasks = { components, names, base, type, project, func ->
|
||||
def task = project.tasks.create(base + "-${key}", type) {
|
||||
description = 'Creates component archive for platform ' + key
|
||||
destinationDirectory = outputsFolder
|
||||
classifier = key
|
||||
archiveClassifier = key
|
||||
archiveBaseName = '_M_' + base
|
||||
duplicatesStrategy = 'exclude'
|
||||
|
||||
@@ -125,7 +128,7 @@ ext.createAllCombined = { list, name, base, type, project ->
|
||||
|
||||
list.each {
|
||||
if (it.name.endsWith('debug')) return
|
||||
from project.zipTree(it.archivePath)
|
||||
from project.zipTree(it.archiveFile)
|
||||
dependsOn it
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user