From 0e4b80ab44fbe724fba993a3193afe19a72a704e Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 09:02:56 -0400 Subject: [PATCH 01/35] Target WPILib 2027.0.0-alpha-2 for sim-only sandbox (config + vendordeps) Bumps GradleRIO to edu.wpi.first.GradleRIO2027 2027.0.0-alpha-2, swaps the RoboRIO deploy target for SystemCore, and updates settings.gradle/ wpilib_preferences.json to the "2027_alpha1" vendor tier. All vendordeps are bumped to their 2027_alpha1-tier builds (Phoenix6, REVLib, ReduxLib, PathPlannerLib, ChoreoLib, AdvantageKit, WPILibNewCommands). photonlib has no 2027_alpha1-tier release (jumped straight to a 2027_alpha5-tier alpha-2), so its frcYear field is patched to 2027_alpha1 as an unsupported workaround per user direction - the 2026 build appears ABI-compatible with this WPILib tier. No source package renames needed: alpha-2 still uses edu.wpi.first.* and edu.wpi.first.wpilibj2.command, matching the existing 2026 source tree. Plugin now applies and dependencies resolve cleanly. ~25 compile errors remain across drive/vision/util code from 2027 alpha-1 API breaking changes - tracked as follow-up. --- .wpilib/wpilib_preferences.json | 2 +- build.gradle | 41 +++------- settings.gradle | 2 +- vendordeps/AdvantageKit.json | 10 +-- ...eoLib2026.json => ChoreoLib2027Alpha.json} | 19 ++--- ...son => PathplannerLibSystemCoreAlpha.json} | 14 ++-- ...3.0.json => Phoenix6-25.90.0-alpha-2.json} | 76 ++++++++--------- vendordeps/REVLib.json | 82 +++---------------- ....2.json => ReduxLib-2027.0.0-alpha-2.json} | 22 ++--- vendordeps/WPILibNewCommands.json | 2 +- vendordeps/photonlib.json | 2 +- 11 files changed, 95 insertions(+), 177 deletions(-) rename vendordeps/{ChoreoLib2026.json => ChoreoLib2027Alpha.json} (72%) rename vendordeps/{PathplannerLib-2026.1.2.json => PathplannerLibSystemCoreAlpha.json} (75%) rename vendordeps/{Phoenix6-26.3.0.json => Phoenix6-25.90.0-alpha-2.json} (88%) rename vendordeps/{ReduxLib-2026.1.2.json => ReduxLib-2027.0.0-alpha-2.json} (76%) diff --git a/.wpilib/wpilib_preferences.json b/.wpilib/wpilib_preferences.json index 57a7d66..efe72c0 100644 --- a/.wpilib/wpilib_preferences.json +++ b/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": false, "currentLanguage": "java", - "projectYear": "2026", + "projectYear": "2027_alpha1", "teamNumber": 2363 } diff --git a/build.gradle b/build.gradle index bf72faa..4fc9e71 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2026.2.1" + id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-2" id "com.peterabeles.gversion" version "1.10" id "com.diffplug.spotless" version "7.0.2" } @@ -12,11 +12,11 @@ java { def ROBOT_MAIN_CLASS = "frc.robot.Main" -// Define my targets (RoboRIO) and artifacts (deployable files) +// Define my targets (SystemCore) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { targets { - roborio(getTargetTypeClass('RoboRIO')) { + systemcore(getTargetTypeClass('SystemCore')) { // Team number is loaded either from the .wpilib/wpilib_preferences.json // or from command line. If not found an exception will be thrown. // You can use getTeamOrDefault(team) instead of getTeamNumber if you @@ -29,33 +29,14 @@ deploy { // getTargetTypeClass is a shortcut to get the class type using a string frcJava(getArtifactTypeClass('FRCJavaArtifact')) { - jvmArgs.add("-XX:+UnlockExperimentalVMOptions") - jvmArgs.add("-XX:GCTimeRatio=5") - jvmArgs.add("-XX:+UseSerialGC") - jvmArgs.add("-XX:MaxGCPauseMillis=50") - - // The options below may improve performance, but should only be enabled on the RIO 2 - // - final MAX_JAVA_HEAP_SIZE_MB = 100; - jvmArgs.add("-Xmx" + MAX_JAVA_HEAP_SIZE_MB + "M") - jvmArgs.add("-Xms" + MAX_JAVA_HEAP_SIZE_MB + "M") - jvmArgs.add("-XX:+AlwaysPreTouch") - - // Enable VisualVM connection - jvmArgs.add("-Dcom.sun.management.jmxremote=true") - jvmArgs.add("-Dcom.sun.management.jmxremote.port=1198") - jvmArgs.add("-Dcom.sun.management.jmxremote.local.only=false") - jvmArgs.add("-Dcom.sun.management.jmxremote.ssl=false") - jvmArgs.add("-Dcom.sun.management.jmxremote.authenticate=false") - jvmArgs.add("-Djava.rmi.server.hostname=10.23.63.2") } // Static files artifact frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') - directory = '/home/lvuser/deploy' - // Change to true to delete files on roboRIO that no - // longer exist in deploy directory on roboRIO + directory = '/home/systemcore/deploy' + // Change to true to delete files on systemcore that no + // longer exist in deploy directory of this project deleteOldFiles = false } } @@ -63,7 +44,7 @@ deploy { } } -def deployArtifact = deploy.targets.roborio.artifacts.frcJava +def deployArtifact = deploy.targets.systemcore.artifacts.frcJava // Set to true to use debug for JNI. wpi.java.debugJni = false @@ -84,11 +65,11 @@ dependencies { implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() - roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio) - roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio) + systemcoreDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.systemcore) + systemcoreDebug wpi.java.vendor.jniDebug(wpi.platforms.systemcore) - roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) - roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) + systemcoreRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.systemcore) + systemcoreRelease wpi.java.vendor.jniRelease(wpi.platforms.systemcore) nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) diff --git a/settings.gradle b/settings.gradle index 25f6f6e..64213ce 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,7 +4,7 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() - String frcYear = '2026' + String frcYear = '2027_alpha1' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') diff --git a/vendordeps/AdvantageKit.json b/vendordeps/AdvantageKit.json index 469ae54..d9f1512 100644 --- a/vendordeps/AdvantageKit.json +++ b/vendordeps/AdvantageKit.json @@ -1,9 +1,9 @@ { "fileName": "AdvantageKit.json", "name": "AdvantageKit", - "version": "26.0.2", + "version": "27.0.0-alpha-3", "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", - "frcYear": "2026", + "frcYear": "2027_alpha1", "mavenUrls": [ "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" ], @@ -12,18 +12,18 @@ { "groupId": "org.littletonrobotics.akit", "artifactId": "akit-java", - "version": "26.0.2" + "version": "27.0.0-alpha-3" } ], "jniDependencies": [ { "groupId": "org.littletonrobotics.akit", "artifactId": "akit-wpilibio", - "version": "26.0.2", + "version": "27.0.0-alpha-3", "skipInvalidPlatforms": false, "isJar": false, "validPlatforms": [ - "linuxathena", + "linuxsystemcore", "linuxx86-64", "linuxarm64", "osxuniversal", diff --git a/vendordeps/ChoreoLib2026.json b/vendordeps/ChoreoLib2027Alpha.json similarity index 72% rename from vendordeps/ChoreoLib2026.json rename to vendordeps/ChoreoLib2027Alpha.json index 7665da4..eb0adc5 100644 --- a/vendordeps/ChoreoLib2026.json +++ b/vendordeps/ChoreoLib2027Alpha.json @@ -1,19 +1,18 @@ { - "fileName": "ChoreoLib2026.json", + "fileName": "ChoreoLib2027Alpha.json", "name": "ChoreoLib", - "version": "2026.0.3", + "version": "2027.0.0-alpha-1", "uuid": "b5e23f0a-dac9-4ad2-8dd6-02767c520aca", - "frcYear": "2026", + "frcYear": "2027_alpha1", "mavenUrls": [ - "https://frcmaven.wpi.edu/artifactory/sleipnirgroup-mvn-release/", - "https://repo1.maven.org/maven2" + "https://frcmaven.wpi.edu/artifactory/sleipnirgroup-mvn-release/" ], - "jsonUrl": "https://choreo.autos/lib/ChoreoLib2026.json", + "jsonUrl": "https://choreo.autos/lib/ChoreoLib2027Alpha.json", "javaDependencies": [ { "groupId": "choreo", "artifactId": "ChoreoLib-java", - "version": "2026.0.3" + "version": "2027.0.0-alpha-1" }, { "groupId": "com.google.code.gson", @@ -26,7 +25,7 @@ { "groupId": "choreo", "artifactId": "ChoreoLib-cpp", - "version": "2026.0.3", + "version": "2027.0.0-alpha-1", "libName": "ChoreoLib", "headerClassifier": "headers", "sharedLibrary": false, @@ -35,9 +34,9 @@ "windowsx86-64", "linuxx86-64", "osxuniversal", - "linuxathena", "linuxarm32", - "linuxarm64" + "linuxarm64", + "linuxsystemcore" ] } ] diff --git a/vendordeps/PathplannerLib-2026.1.2.json b/vendordeps/PathplannerLibSystemCoreAlpha.json similarity index 75% rename from vendordeps/PathplannerLib-2026.1.2.json rename to vendordeps/PathplannerLibSystemCoreAlpha.json index 5f04ffa..7cc91a9 100644 --- a/vendordeps/PathplannerLib-2026.1.2.json +++ b/vendordeps/PathplannerLibSystemCoreAlpha.json @@ -1,18 +1,18 @@ { - "fileName": "PathplannerLib-2026.1.2.json", + "fileName": "PathplannerLibSystemCoreAlpha.json", "name": "PathplannerLib", - "version": "2026.1.2", + "version": "2027.0.0-alpha-2", "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", - "frcYear": "2026", + "frcYear": "2027_alpha1", "mavenUrls": [ "https://3015rangerrobotics.github.io/pathplannerlib/repo" ], - "jsonUrl": "https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib.json", + "jsonUrl": "https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLibSystemCoreAlpha.json", "javaDependencies": [ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-java", - "version": "2026.1.2" + "version": "2027.0.0-alpha-2" } ], "jniDependencies": [], @@ -20,7 +20,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-cpp", - "version": "2026.1.2", + "version": "2027.0.0-alpha-2", "libName": "PathplannerLib", "headerClassifier": "headers", "sharedLibrary": false, @@ -29,7 +29,7 @@ "windowsx86-64", "linuxx86-64", "osxuniversal", - "linuxathena", + "linuxsystemcore", "linuxarm32", "linuxarm64" ] diff --git a/vendordeps/Phoenix6-26.3.0.json b/vendordeps/Phoenix6-25.90.0-alpha-2.json similarity index 88% rename from vendordeps/Phoenix6-26.3.0.json rename to vendordeps/Phoenix6-25.90.0-alpha-2.json index e75902c..147699c 100644 --- a/vendordeps/Phoenix6-26.3.0.json +++ b/vendordeps/Phoenix6-25.90.0-alpha-2.json @@ -1,60 +1,60 @@ { - "fileName": "Phoenix6-26.3.0.json", + "fileName": "Phoenix6-25.90.0-alpha-2.json", "name": "CTRE-Phoenix (v6)", - "version": "26.3.0", - "frcYear": "2026", + "version": "25.90.0-alpha-2", + "frcYear": "2027_alpha1", "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "mavenUrls": [ "https://maven.ctr-electronics.com/release/" ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2026-latest.json", + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2025-latest.json", "conflictsWith": [ { "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", "errorMessage": "Users can not have both the replay and regular Phoenix 6 vendordeps in their robot program.", - "offlineFileName": "Phoenix6-replay-frc2026-latest.json" + "offlineFileName": "Phoenix6-replay-frc2025-latest.json" } ], "javaDependencies": [ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-java", - "version": "26.3.0" + "version": "25.90.0-alpha-2" } ], "jniDependencies": [ { "groupId": "com.ctre.phoenix6", "artifactId": "api-cpp", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", "linuxarm64", - "linuxathena" + "linuxsystemcore" ], "simMode": "hwsim" }, { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", "linuxarm64", - "linuxathena" + "linuxsystemcore" ], "simMode": "hwsim" }, { "groupId": "com.ctre.phoenix6.sim", "artifactId": "api-cpp-sim", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -68,7 +68,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -82,7 +82,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -96,7 +96,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -110,7 +110,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -124,7 +124,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -138,7 +138,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFXS", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -152,7 +152,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -166,7 +166,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -180,7 +180,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANrange", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -194,7 +194,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdi", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -208,7 +208,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdle", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -224,7 +224,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-cpp", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_Phoenix6_WPI", "headerClassifier": "headers", "sharedLibrary": true, @@ -233,14 +233,14 @@ "windowsx86-64", "linuxx86-64", "linuxarm64", - "linuxathena" + "linuxsystemcore" ], "simMode": "hwsim" }, { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_PhoenixTools", "headerClassifier": "headers", "sharedLibrary": true, @@ -249,14 +249,14 @@ "windowsx86-64", "linuxx86-64", "linuxarm64", - "linuxathena" + "linuxsystemcore" ], "simMode": "hwsim" }, { "groupId": "com.ctre.phoenix6.sim", "artifactId": "wpiapi-cpp-sim", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_Phoenix6_WPISim", "headerClassifier": "headers", "sharedLibrary": true, @@ -272,7 +272,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_PhoenixTools_Sim", "headerClassifier": "headers", "sharedLibrary": true, @@ -288,7 +288,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_SimTalonSRX", "headerClassifier": "headers", "sharedLibrary": true, @@ -304,7 +304,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_SimVictorSPX", "headerClassifier": "headers", "sharedLibrary": true, @@ -320,7 +320,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_SimPigeonIMU", "headerClassifier": "headers", "sharedLibrary": true, @@ -336,7 +336,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_SimProTalonFX", "headerClassifier": "headers", "sharedLibrary": true, @@ -352,7 +352,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFXS", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_SimProTalonFXS", "headerClassifier": "headers", "sharedLibrary": true, @@ -368,7 +368,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_SimProCANcoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -384,7 +384,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_SimProPigeon2", "headerClassifier": "headers", "sharedLibrary": true, @@ -400,7 +400,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANrange", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_SimProCANrange", "headerClassifier": "headers", "sharedLibrary": true, @@ -416,7 +416,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdi", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_SimProCANdi", "headerClassifier": "headers", "sharedLibrary": true, @@ -432,7 +432,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdle", - "version": "26.3.0", + "version": "25.90.0-alpha-2", "libName": "CTRE_SimProCANdle", "headerClassifier": "headers", "sharedLibrary": true, diff --git a/vendordeps/REVLib.json b/vendordeps/REVLib.json index e7a0655..83ead19 100644 --- a/vendordeps/REVLib.json +++ b/vendordeps/REVLib.json @@ -1,62 +1,32 @@ { "fileName": "REVLib.json", "name": "REVLib", - "version": "2026.0.5", - "frcYear": "2026", + "version": "2027.0.0-alpha-1", + "frcYear": "2027_alpha1", "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", "mavenUrls": [ "https://maven.revrobotics.com/" ], - "jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2026.json", + "jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2027.json", "javaDependencies": [ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-java", - "version": "2026.0.5" + "version": "2027.0.0-alpha-1" } ], "jniDependencies": [ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2026.0.5", + "version": "2027.0.0-alpha-1", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", - "osxuniversal" - ] - }, - { - "groupId": "com.revrobotics.frc", - "artifactId": "RevLibBackendDriver", - "version": "2026.0.5", - "skipInvalidPlatforms": true, - "isJar": false, - "validPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxathena", - "linuxarm32", - "osxuniversal" - ] - }, - { - "groupId": "com.revrobotics.frc", - "artifactId": "RevLibWpiBackendDriver", - "version": "2026.0.5", - "skipInvalidPlatforms": true, - "isJar": false, - "validPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxathena", + "linuxsystemcore", "linuxarm32", "osxuniversal" ] @@ -66,7 +36,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-cpp", - "version": "2026.0.5", + "version": "2027.0.0-alpha-1", "libName": "REVLib", "headerClassifier": "headers", "sharedLibrary": false, @@ -75,7 +45,7 @@ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", + "linuxsystemcore", "linuxarm32", "osxuniversal" ] @@ -83,7 +53,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2026.0.5", + "version": "2027.0.0-alpha-1", "libName": "REVLibDriver", "headerClassifier": "headers", "sharedLibrary": false, @@ -92,39 +62,7 @@ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", - "osxuniversal" - ] - }, - { - "groupId": "com.revrobotics.frc", - "artifactId": "RevLibBackendDriver", - "version": "2026.0.5", - "libName": "BackendDriver", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxathena", - "linuxarm32", - "osxuniversal" - ] - }, - { - "groupId": "com.revrobotics.frc", - "artifactId": "RevLibWpiBackendDriver", - "version": "2026.0.5", - "libName": "REVLibWpi", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxathena", + "linuxsystemcore", "linuxarm32", "osxuniversal" ] diff --git a/vendordeps/ReduxLib-2026.1.2.json b/vendordeps/ReduxLib-2027.0.0-alpha-2.json similarity index 76% rename from vendordeps/ReduxLib-2026.1.2.json rename to vendordeps/ReduxLib-2027.0.0-alpha-2.json index 431fe17..15d7cff 100644 --- a/vendordeps/ReduxLib-2026.1.2.json +++ b/vendordeps/ReduxLib-2027.0.0-alpha-2.json @@ -1,29 +1,29 @@ { - "fileName": "ReduxLib-2026.1.2.json", + "fileName": "ReduxLib-2027.0.0-alpha-2.json", "name": "ReduxLib", - "version": "2026.1.2", - "frcYear": "2026", + "version": "2027.0.0-alpha-2", + "frcYear": "2027_alpha1", "uuid": "151ecca8-670b-4026-8160-cdd2679ef2bd", "mavenUrls": [ "https://maven.reduxrobotics.com/" ], - "jsonUrl": "https://frcsdk.reduxrobotics.com/ReduxLib_2026.json", + "jsonUrl": "https://frcsdk.reduxrobotics.com/ReduxLib_2027.json", "javaDependencies": [ { "groupId": "com.reduxrobotics.frc", "artifactId": "ReduxLib-java", - "version": "2026.1.2" + "version": "2027.0.0-alpha-2" } ], "jniDependencies": [ { "groupId": "com.reduxrobotics.frc", "artifactId": "ReduxLib-fifo", - "version": "2026.1.2", + "version": "2027.0.0-alpha-2", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ - "linuxathena", + "linuxsystemcore", "linuxx86-64", "linuxarm64", "osxuniversal", @@ -35,14 +35,14 @@ { "groupId": "com.reduxrobotics.frc", "artifactId": "ReduxLib-cpp", - "version": "2026.1.2", + "version": "2027.0.0-alpha-2", "libName": "ReduxLib", "headerClassifier": "headers", "sourcesClassifier": "sources", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ - "linuxathena", + "linuxsystemcore", "linuxx86-64", "linuxarm64", "osxuniversal", @@ -52,13 +52,13 @@ { "groupId": "com.reduxrobotics.frc", "artifactId": "ReduxLib-fifo", - "version": "2026.1.2", + "version": "2027.0.0-alpha-2", "libName": "reduxfifo", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ - "linuxathena", + "linuxsystemcore", "linuxx86-64", "linuxarm64", "osxuniversal", diff --git a/vendordeps/WPILibNewCommands.json b/vendordeps/WPILibNewCommands.json index d90630e..fb7b37e 100644 --- a/vendordeps/WPILibNewCommands.json +++ b/vendordeps/WPILibNewCommands.json @@ -3,7 +3,7 @@ "name": "WPILib-New-Commands", "version": "1.0.0", "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266", - "frcYear": "2026", + "frcYear": "2027_alpha1", "mavenUrls": [], "jsonUrl": "", "javaDependencies": [ diff --git a/vendordeps/photonlib.json b/vendordeps/photonlib.json index 4280265..baa5913 100644 --- a/vendordeps/photonlib.json +++ b/vendordeps/photonlib.json @@ -3,7 +3,7 @@ "name": "photonlib", "version": "v2026.3.4", "uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004", - "frcYear": "2026", + "frcYear": "2027_alpha1", "mavenUrls": [ "https://maven.photonvision.org/repository/internal", "https://maven.photonvision.org/repository/snapshots" From c5bc40a26f8ca39ff8c9b8debb6e65d21c1f4bb5 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 10:01:38 -0400 Subject: [PATCH 02/35] Work around akit-autolog @AutoLog codegen not running in Gradle javapoet (required by the akit-autolog annotation processor) is declared as runtime-only in its Gradle module metadata, so Gradle's annotationProcessor configuration (java-api usage) doesn't pull it in automatically. Explicitly adding it ensures the @AutoLog processor can instantiate correctly. Additionally, even with javapoet on the path, compile errors prevent the processor from writing its output before Gradle aborts. As a workaround, the *AutoLogged classes are pre-generated and checked in under build/generated/sources/annotationProcessor/java/main/, and that directory is explicitly added as a source directory so Gradle picks them up. Co-Authored-By: Claude Sonnet 4.6 --- build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build.gradle b/build.gradle index 4fc9e71..93a27e9 100644 --- a/build.gradle +++ b/build.gradle @@ -58,6 +58,12 @@ task(replayWatch, type: JavaExec) { classpath = sourceSets.main.runtimeClasspath } +// The @AutoLog annotation processor (akit-autolog) doesn't generate classes during the Gradle +// build due to a class-loading issue in Gradle's Java compilation infrastructure. As a workaround, +// classes are pre-generated into build/generated/sources/annotationProcessor/java/main/ and that +// directory is explicitly added here so Gradle picks them up. +sourceSets.main.java.srcDir("${buildDir}/generated/sources/annotationProcessor/java/main") + // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 4. dependencies { @@ -84,6 +90,10 @@ dependencies { def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text) annotationProcessor "org.littletonrobotics.akit:akit-autolog:$akitJson.version" + // javapoet is declared as runtime-only in akit-autolog's Gradle module metadata, so Gradle's + // annotationProcessor config (java-api usage) doesn't pull it in automatically. + // Explicitly adding it ensures the @AutoLog processor can instantiate correctly. + annotationProcessor "com.squareup:javapoet:1.13.0" } test { From 20d9bc6fae465fafd5346e8269fa652bc2dfe2c1 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 10:03:54 -0400 Subject: [PATCH 03/35] Fix SwerveModule field renames for WPILib 2027 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SwerveModulePosition.distanceMeters → .distance (Drive.java) SwerveModuleState.speedMetersPerSecond → .speed (Module.java) Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/robot/subsystems/drive/Drive.java | 6 +++--- src/main/java/frc/robot/subsystems/drive/Module.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/drive/Drive.java b/src/main/java/frc/robot/subsystems/drive/Drive.java index b46a1ba..8237dc8 100644 --- a/src/main/java/frc/robot/subsystems/drive/Drive.java +++ b/src/main/java/frc/robot/subsystems/drive/Drive.java @@ -191,9 +191,9 @@ public void periodic() { for (int moduleIndex = 0; moduleIndex < 4; moduleIndex++) { modulePositions[moduleIndex] = modules[moduleIndex].getOdometryPositions()[i]; // Mutate pre-allocated delta objects to avoid allocations - moduleDeltas[moduleIndex].distanceMeters = - modulePositions[moduleIndex].distanceMeters - - lastModulePositions[moduleIndex].distanceMeters; + moduleDeltas[moduleIndex].distance = + modulePositions[moduleIndex].distance + - lastModulePositions[moduleIndex].distance; moduleDeltas[moduleIndex].angle = modulePositions[moduleIndex].angle; lastModulePositions[moduleIndex] = modulePositions[moduleIndex]; } diff --git a/src/main/java/frc/robot/subsystems/drive/Module.java b/src/main/java/frc/robot/subsystems/drive/Module.java index 2f264f5..d615296 100644 --- a/src/main/java/frc/robot/subsystems/drive/Module.java +++ b/src/main/java/frc/robot/subsystems/drive/Module.java @@ -97,7 +97,7 @@ public void runSetpoint(SwerveModuleState state) { state.cosineScale(inputs.turnPosition); // Apply setpoints - io.setDriveVelocity(state.speedMetersPerSecond / WHEEL_RADIUS_METERS); + io.setDriveVelocity(state.speed / WHEEL_RADIUS_METERS); io.setTurnPosition(state.angle); } From c272da79cb0e6bd34013d22bc6f57ca0e4023bd8 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 10:06:26 -0400 Subject: [PATCH 04/35] Fix ChassisSpeeds API changes for WPILib 2027 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Static methods became instance methods: - ChassisSpeeds.discretize(speeds, dt) → speeds.discretize(dt) (Drive.java) - ChassisSpeeds.fromFieldRelativeSpeeds(speeds, rot) → speeds.toRobotRelative(rot) (Drive.java and 4 occurrences in DriveCommands.java) Co-Authored-By: Claude Sonnet 4.6 --- .../java/frc/robot/commands/DriveCommands.java | 14 +++++--------- .../java/frc/robot/subsystems/drive/Drive.java | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/main/java/frc/robot/commands/DriveCommands.java b/src/main/java/frc/robot/commands/DriveCommands.java index c21333e..2162e4c 100644 --- a/src/main/java/frc/robot/commands/DriveCommands.java +++ b/src/main/java/frc/robot/commands/DriveCommands.java @@ -120,8 +120,7 @@ public static Command joystickDrive( // Convert to field relative speeds if (fieldRelativeSupplier.getAsBoolean()) { speeds = - ChassisSpeeds.fromFieldRelativeSpeeds( - speeds, + speeds.toRobotRelative( getDriverRelativeHeading(drive, fieldRotatedSupplier.getAsBoolean())); } @@ -159,8 +158,7 @@ public static Command fieldRelativeJoystickDrive( linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), omega * drive.getMaxAngularSpeedRadPerSec()); drive.runVelocity( - ChassisSpeeds.fromFieldRelativeSpeeds( - speeds, + speeds.toRobotRelative( getDriverRelativeHeading(drive, fieldRotatedSupplier.getAsBoolean()))); }, drive) @@ -239,8 +237,7 @@ public static Command joystickDriveAtFixedOrientation( linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), omega); drive.runVelocity( - ChassisSpeeds.fromFieldRelativeSpeeds( - speeds, + speeds.toRobotRelative( getDriverRelativeHeading(drive, fieldRotatedSupplier.getAsBoolean()))); }, drive) @@ -286,7 +283,7 @@ public static Command joystickDrivePointedForward( linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), omega); - drive.runVelocity(ChassisSpeeds.fromFieldRelativeSpeeds(speeds, driverHeading)); + drive.runVelocity(speeds.toRobotRelative(driverHeading)); }, drive) .withName("Forward Orientated Joystick Drive") @@ -326,8 +323,7 @@ public static Command pointAtTarget( // Convert to field relative speeds & send command ChassisSpeeds speeds = new ChassisSpeeds(0, 0, omega); drive.runVelocity( - ChassisSpeeds.fromFieldRelativeSpeeds( - speeds, + speeds.toRobotRelative( getDriverRelativeHeading(drive, fieldRotatedSupplier.getAsBoolean()))); }, drive) diff --git a/src/main/java/frc/robot/subsystems/drive/Drive.java b/src/main/java/frc/robot/subsystems/drive/Drive.java index 8237dc8..4dfbd21 100644 --- a/src/main/java/frc/robot/subsystems/drive/Drive.java +++ b/src/main/java/frc/robot/subsystems/drive/Drive.java @@ -265,7 +265,7 @@ public void runVelocity(ChassisSpeeds speeds) { ChassisSpeeds limitedSpeeds = kinematics.toChassisSpeeds(states); // 4: Now discretize the LIMITED speeds - ChassisSpeeds discreteSpeeds = ChassisSpeeds.discretize(limitedSpeeds, 0.02); + ChassisSpeeds discreteSpeeds = limitedSpeeds.discretize(0.02); // 5: Convert discretized speeds back to module states SwerveModuleState[] finalStates = kinematics.toSwerveModuleStates(discreteSpeeds); @@ -297,7 +297,7 @@ public void followTrajectory(SwerveSample sample) { + headingController.calculate(pose.getRotation().getRadians(), sample.heading)); // Apply the generated speeds - runVelocity(ChassisSpeeds.fromFieldRelativeSpeeds(speeds, pose.getRotation())); + runVelocity(speeds.toRobotRelative(pose.getRotation())); } /** Runs the drive in a straight line with the specified drive output. */ From 8af6adc0319818895af46f828243bbff008111a1 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 10:17:46 -0400 Subject: [PATCH 05/35] Migrate HAL usage reporting from FRCNetComm to 2027 API FRCNetComm (tResourceType/tInstances) was removed in WPILib 2027. Replace HAL.report() with HAL.reportUsage() string-based API. The "RobotDrive"/"SwerveAdvantageKit" strings match the pattern established by WPILib's own drive classes in 2027. Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/robot/subsystems/drive/Drive.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/drive/Drive.java b/src/main/java/frc/robot/subsystems/drive/Drive.java index 4dfbd21..410e2f2 100644 --- a/src/main/java/frc/robot/subsystems/drive/Drive.java +++ b/src/main/java/frc/robot/subsystems/drive/Drive.java @@ -20,8 +20,6 @@ import com.pathplanner.lib.controllers.PPHolonomicDriveController; import com.pathplanner.lib.pathfinding.Pathfinding; import com.pathplanner.lib.util.PathPlannerLogging; -import edu.wpi.first.hal.FRCNetComm.tInstances; -import edu.wpi.first.hal.FRCNetComm.tResourceType; import edu.wpi.first.hal.HAL; import edu.wpi.first.math.Matrix; import edu.wpi.first.math.controller.PIDController; @@ -110,7 +108,8 @@ public Drive( modules[3] = new Module(brModuleIO, "BackRight"); // Usage reporting for swerve template - HAL.report(tResourceType.kResourceType_RobotDrive, tInstances.kRobotDriveSwerve_AdvantageKit); + // TODO: update instance string to match the official 2027 AKit template when released. + HAL.reportUsage("RobotDrive", "SwerveAdvantageKit"); // Start odometry thread PhoenixOdometryThread.getInstance().start(); From 00771ae8786f7a8b1b09255308be60104060647c Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 10:18:52 -0400 Subject: [PATCH 06/35] Fix DCMotor.freeSpeedRadPerSec field rename for WPILib 2027 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DCMotor.freeSpeedRadPerSec → .freeSpeed Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/robot/subsystems/drive/DriveConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/drive/DriveConstants.java b/src/main/java/frc/robot/subsystems/drive/DriveConstants.java index 516fa7f..879bd68 100644 --- a/src/main/java/frc/robot/subsystems/drive/DriveConstants.java +++ b/src/main/java/frc/robot/subsystems/drive/DriveConstants.java @@ -74,7 +74,7 @@ public class DriveConstants { MetersPerSecond.of( 0.9 * (WHEEL_RADIUS_METERS * 2.0 * Math.PI) - * DRIVE_GEARBOX.freeSpeedRadPerSec + * DRIVE_GEARBOX.freeSpeed / (2.0 * Math.PI) / DRIVE_MOTOR_REDUCTION); From def73164bd12cbb9c1b140ba39afb2f35e319738 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 10:20:52 -0400 Subject: [PATCH 07/35] Fix AprilTagFields constant for WPILib 2027 k2026RebuiltAndymark no longer exists in 2027 alpha-2; the 2026 game field layout was not included. Use kDefaultField (currently k2025ReefscapeAndyMark) as a placeholder until a 2027 field is released. Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/robot/subsystems/vision/VisionConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/vision/VisionConstants.java b/src/main/java/frc/robot/subsystems/vision/VisionConstants.java index a5bf33e..6c943de 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionConstants.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionConstants.java @@ -23,7 +23,7 @@ public class VisionConstants { public static String CUSTOM_APRIL_TAG_LAYOUT_PATH = Filesystem.getDeployDirectory() + "/stemgym-2026.json"; public static Boolean USE_CUSTOM_APRIL_TAG_LAYOUT = false; - public static AprilTagFields DEFAULT_APRIL_TAG_FIELD_LAYOUT = AprilTagFields.k2026RebuiltAndymark; + public static AprilTagFields DEFAULT_APRIL_TAG_FIELD_LAYOUT = AprilTagFields.kDefaultField; /** Pairs a camera's coprocessor name with its robot-to-camera transform. */ public record CameraConfig(String name, Transform3d robotToCamera) {} From e2042f4cb1c1f0809e611dcde871b61c3174abc0 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 10:27:36 -0400 Subject: [PATCH 08/35] Fix DriverStation.getStickPOV() type change for WPILib 2027 getStickPOV() now returns POVDirection enum instead of long/int. Log direction name strings ("Up", "Down", "Center", etc.) which are more readable than the old degree values in AKit log viewer. Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/robot/Robot.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index e969e7e..26869b8 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -538,8 +538,8 @@ private static void logHIDs() { for (int i = 0; i < buttonCount; i++) buttons[i] = DriverStation.getStickButton(port, i + 1); Logger.recordOutput(prefix + "/Buttons", buttons); int povCount = DriverStation.getStickPOVCount(port); - long[] povs = new long[povCount]; - for (int i = 0; i < povCount; i++) povs[i] = DriverStation.getStickPOV(port, i); + String[] povs = new String[povCount]; + for (int i = 0; i < povCount; i++) povs[i] = DriverStation.getStickPOV(port, i).name(); Logger.recordOutput(prefix + "/POVs", povs); } } From 06bada1b1ce5c26094c922867442100aaac16884 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 10:33:50 -0400 Subject: [PATCH 09/35] =?UTF-8?q?Remove=20LiveWindow.disableAllTelemetry()?= =?UTF-8?q?=20=E2=80=94=20package=20removed=20in=202027?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LiveWindow and SmartDashboard were removed in WPILib 2027, so the call to suppress SmartDashboard overhead is no longer needed or valid. Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/robot/Robot.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 26869b8..0460039 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -216,9 +216,6 @@ public Robot() { // Start AdvantageKit logger Logger.start(); - // Disable LiveWindow telemetry (subsystem motor sendables) — eliminates SmartDashboard overhead - edu.wpi.first.wpilibj.livewindow.LiveWindow.disableAllTelemetry(); - configureControlPanelBindings(); configureAutoOptions(); From aefe547e6f7319633b819146ea745d82c7c6ca07 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 10:37:31 -0400 Subject: [PATCH 10/35] Fix AddressableLED.start() removed in WPILib 2027 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AddressableLED.start() no longer exists — LED output begins automatically when setData() is called. Remove start()/startAll() from LEDStrip and the corresponding startAll() call from LEDController. Co-Authored-By: Claude Sonnet 4.6 --- .../robot/subsystems/leds/LEDController.java | 4 +--- .../frc/robot/subsystems/leds/LEDStrip.java | 18 ------------------ 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/leds/LEDController.java b/src/main/java/frc/robot/subsystems/leds/LEDController.java index 4627cd7..7cf44ec 100644 --- a/src/main/java/frc/robot/subsystems/leds/LEDController.java +++ b/src/main/java/frc/robot/subsystems/leds/LEDController.java @@ -47,9 +47,7 @@ public static synchronized LEDController getInstance() { return instance; } - private LEDController() { - LEDStrip.startAll(); - } + private LEDController() {} /** Pushes LED buffer data to all physical strips each cycle. */ @Override diff --git a/src/main/java/frc/robot/subsystems/leds/LEDStrip.java b/src/main/java/frc/robot/subsystems/leds/LEDStrip.java index 02d46c8..0891d74 100644 --- a/src/main/java/frc/robot/subsystems/leds/LEDStrip.java +++ b/src/main/java/frc/robot/subsystems/leds/LEDStrip.java @@ -27,8 +27,6 @@ public enum LEDStrip { private final int length; private AddressableLED led; private AddressableLEDBuffer buffer; - private boolean started = false; - LEDStrip(int port, int length) { this.port = port; this.length = length; @@ -58,15 +56,6 @@ public AddressableLEDBufferView createReversedView(int start, int end) { return getBuffer().createView(start, end).reversed(); } - /** Starts this strip. Must be called before the strip will display anything. */ - public void start() { - if (!started) { - getBuffer(); // Ensure LED and buffer are created - led.start(); - started = true; - } - } - /** Pushes buffer data to the physical LED strip. */ public void update() { if (led != null) { @@ -74,13 +63,6 @@ public void update() { } } - /** Starts all physical LED strips. Call once during robot initialization. */ - public static void startAll() { - for (LEDStrip strip : values()) { - strip.start(); - } - } - /** Updates all physical LED strips with their current buffer data. */ public static void updateAll() { for (LEDStrip strip : values()) { From 9cce491e71cfa4ff4889ad542535dd240c8b90c7 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 11:06:26 -0400 Subject: [PATCH 11/35] Reorganize CAN buses for SystemCore; fix PD/Compressor constructors Replaces the single roboRIO CAN bus with two named SystemCore CAN buses: - SC0 (bus 0): low-speed bus for PD and gyro (replaces CAN2/roboRIO) - SC1 (bus 1): high-speed bus for TalonFX and CANcoders (replaces CANHD/canivore) Uses CANBus.systemCore(int) from Phoenix6 25.90.0-alpha-2 and adds NAME/BUS_ID constants to each class. Updates PowerDistribution and Compressor wrappers to accept busId as an explicit constructor parameter, matching the new 3-arg/2-arg WPILib 2027 constructors. CAN bus log keys now use the NAME constant (CANBus/SC0/..., CANBus/SC1/...) instead of the Phoenix-internal bus name. Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/lib/LoggedCompressor.java | 11 ++++++-- .../java/frc/lib/LoggedPowerDistribution.java | 12 ++++++-- src/main/java/frc/robot/Constants.java | 22 +++++++++++---- src/main/java/frc/robot/Robot.java | 8 +++--- .../subsystems/drive/DriveConstants.java | 28 +++++++++---------- .../robot/subsystems/drive/GyroIOBoron.java | 4 +-- .../subsystems/drive/ModuleIOTalonFX.java | 8 +++--- 7 files changed, 59 insertions(+), 34 deletions(-) diff --git a/src/main/java/frc/lib/LoggedCompressor.java b/src/main/java/frc/lib/LoggedCompressor.java index 8e47b0f..382d986 100644 --- a/src/main/java/frc/lib/LoggedCompressor.java +++ b/src/main/java/frc/lib/LoggedCompressor.java @@ -7,8 +7,15 @@ public class LoggedCompressor extends Compressor { private final String key; - public LoggedCompressor(PneumaticsModuleType moduleType, String logKey) { - super(moduleType); + /** + * Creates a logged compressor. + * + * @param busId the CAN bus ID (SystemCore transceiver number) + * @param moduleType the type of pneumatics module + * @param logKey the AdvantageKit log key prefix + */ + public LoggedCompressor(int busId, PneumaticsModuleType moduleType, String logKey) { + super(busId, moduleType); this.key = logKey; } diff --git a/src/main/java/frc/lib/LoggedPowerDistribution.java b/src/main/java/frc/lib/LoggedPowerDistribution.java index c57e28a..73a2f11 100644 --- a/src/main/java/frc/lib/LoggedPowerDistribution.java +++ b/src/main/java/frc/lib/LoggedPowerDistribution.java @@ -6,8 +6,16 @@ public class LoggedPowerDistribution extends PowerDistribution { private final String key; - public LoggedPowerDistribution(int module, ModuleType moduleType, String logKey) { - super(module, moduleType); + /** + * Creates a logged power distribution module. + * + * @param busId the CAN bus ID (SystemCore transceiver number) + * @param module the CAN device ID of the power distribution module + * @param moduleType the type of power distribution module + * @param logKey the AdvantageKit log key prefix + */ + public LoggedPowerDistribution(int busId, int module, ModuleType moduleType, String logKey) { + super(busId, module, moduleType); this.key = logKey; } diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index c1a0f37..fe20af6 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -76,8 +76,14 @@ public static final class DIOPorts { public static final class CANBusPorts { - public static final class CAN2 { - public static final CANBus BUS = CANBus.roboRIO(); + /** + * SystemCore CAN bus 0 — low-speed bus for support/sensing devices. + * Supports the power distribution and gyro. + */ + public static final class SC0 { + public static final String NAME = "SC0"; + public static final int BUS_ID = 0; + public static final CANBus BUS = CANBus.systemCore(BUS_ID); // Power distribution public static final int PD = 1; @@ -86,10 +92,14 @@ public static final class CAN2 { public static final int GYRO = 0; } - public static final class CANHD { - // CAN bus that the devices are located on; - // All swerve devices must share the same CAN bus - public static final CANBus BUS = new CANBus("canivore"); + /** + * SystemCore CAN bus 1 — high-speed bus for swerve drivetrain devices. + * Supports TalonFX motor controllers and CANcoders. + */ + public static final class SC1 { + public static final String NAME = "SC1"; + public static final int BUS_ID = 1; + public static final CANBus BUS = CANBus.systemCore(BUS_ID); // Drivetrain public static final int BACK_LEFT_DRIVE = 10; diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 0460039..0507c87 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -40,7 +40,7 @@ import frc.lib.ControllerSelector.DriverController; import frc.lib.ControllerSelector.OperatorConfig; import frc.lib.LoggedPowerDistribution; -import frc.robot.Constants.CANBusPorts.CAN2; +import frc.robot.Constants.CANBusPorts.SC0; import frc.robot.Constants.DIOPorts; import frc.robot.Constants.FeatureFlags; import frc.robot.commands.DriveCommands; @@ -93,7 +93,7 @@ public class Robot extends LoggedRobot { public static final AutoSelector autoSelector = new AutoSelector(DIOPorts.AUTONOMOUS_MODE_SELECTOR, allianceSelector::getAllianceColor); public final LoggedPowerDistribution powerDistribution = - new LoggedPowerDistribution(CAN2.PD, ModuleType.kRev, "PD"); + new LoggedPowerDistribution(SC0.BUS_ID, SC0.PD, ModuleType.kRev, "PD"); private final java.util.Set activeCommands = new java.util.LinkedHashSet<>(); @@ -246,8 +246,8 @@ public void robotPeriodic() { CommandScheduler.getInstance().run(); long t1 = FeatureFlags.PROFILING_ENABLED ? System.nanoTime() : 0; - logCANBus("CAN2", Constants.CANBusPorts.CAN2.BUS); - logCANBus("CANHD", Constants.CANBusPorts.CANHD.BUS); + logCANBus(Constants.CANBusPorts.SC0.NAME, Constants.CANBusPorts.SC0.BUS); + logCANBus(Constants.CANBusPorts.SC1.NAME, Constants.CANBusPorts.SC1.BUS); powerDistribution.log(); logHIDs(); logScheduler(); diff --git a/src/main/java/frc/robot/subsystems/drive/DriveConstants.java b/src/main/java/frc/robot/subsystems/drive/DriveConstants.java index 879bd68..26250ea 100644 --- a/src/main/java/frc/robot/subsystems/drive/DriveConstants.java +++ b/src/main/java/frc/robot/subsystems/drive/DriveConstants.java @@ -41,7 +41,7 @@ import edu.wpi.first.units.measure.Mass; import edu.wpi.first.units.measure.MomentOfInertia; import edu.wpi.first.units.measure.Voltage; -import frc.robot.Constants.CANBusPorts.CANHD; +import frc.robot.Constants.CANBusPorts.SC1; import frc.robot.Constants.MotorConstants.KrakenX60Constants; public class DriveConstants { @@ -208,7 +208,7 @@ public class DriveConstants { private static final Voltage DRIVE_FRICTION_VOLTAGE = Volts.of(0.2); public static final SwerveDrivetrainConstants DRIVETRAIN_CONSTANTS = - new SwerveDrivetrainConstants().withCANBusName(CANHD.BUS.getName()); + new SwerveDrivetrainConstants().withCANBusName(SC1.BUS.getName()); private static final SwerveModuleConstantsFactory< TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> @@ -239,9 +239,9 @@ public class DriveConstants { TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> FRONT_LEFT = CONSTANT_CREATOR.createModuleConstants( - CANHD.FRONT_LEFT_TURN, - CANHD.FRONT_LEFT_DRIVE, - CANHD.FRONT_LEFT_TURN_ABS_ENC, + SC1.FRONT_LEFT_TURN, + SC1.FRONT_LEFT_DRIVE, + SC1.FRONT_LEFT_TURN_ABS_ENC, Rotations.of(0), WHEEL_BASE.div(2.0), TRACK_WIDTH.div(2.0), @@ -252,9 +252,9 @@ public class DriveConstants { TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> FRONT_RIGHT = CONSTANT_CREATOR.createModuleConstants( - CANHD.FRONT_RIGHT_TURN, - CANHD.FRONT_RIGHT_DRIVE, - CANHD.FRONT_RIGHT_TURN_ABS_ENC, + SC1.FRONT_RIGHT_TURN, + SC1.FRONT_RIGHT_DRIVE, + SC1.FRONT_RIGHT_TURN_ABS_ENC, Rotations.of(0), WHEEL_BASE.div(2.0), TRACK_WIDTH.div(-2.0), @@ -265,9 +265,9 @@ public class DriveConstants { TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> BACK_LEFT = CONSTANT_CREATOR.createModuleConstants( - CANHD.BACK_LEFT_TURN, - CANHD.BACK_LEFT_DRIVE, - CANHD.BACK_LEFT_TURN_ABS_ENC, + SC1.BACK_LEFT_TURN, + SC1.BACK_LEFT_DRIVE, + SC1.BACK_LEFT_TURN_ABS_ENC, Rotations.of(0), WHEEL_BASE.div(-2.0), TRACK_WIDTH.div(2.0), @@ -278,9 +278,9 @@ public class DriveConstants { TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> BACK_RIGHT = CONSTANT_CREATOR.createModuleConstants( - CANHD.BACK_RIGHT_TURN, - CANHD.BACK_RIGHT_DRIVE, - CANHD.BACK_RIGHT_TURN_ABS_ENC, + SC1.BACK_RIGHT_TURN, + SC1.BACK_RIGHT_DRIVE, + SC1.BACK_RIGHT_TURN_ABS_ENC, Rotations.of(0), WHEEL_BASE.div(-2.0), TRACK_WIDTH.div(-2.0), diff --git a/src/main/java/frc/robot/subsystems/drive/GyroIOBoron.java b/src/main/java/frc/robot/subsystems/drive/GyroIOBoron.java index ce0884d..c614c1f 100644 --- a/src/main/java/frc/robot/subsystems/drive/GyroIOBoron.java +++ b/src/main/java/frc/robot/subsystems/drive/GyroIOBoron.java @@ -10,7 +10,7 @@ import com.reduxrobotics.sensors.canandgyro.Canandgyro; import edu.wpi.first.math.geometry.Rotation2d; import edu.wpi.first.math.util.Units; -import frc.robot.Constants.CANBusPorts.CAN2; +import frc.robot.Constants.CANBusPorts.SC0; import frc.robot.util.CanandgyroThread; import frc.robot.util.CanandgyroThread.GyroInputs; import java.util.Queue; @@ -23,7 +23,7 @@ public class GyroIOBoron implements GyroIO { private final Queue yawPositionQueue; public GyroIOBoron() { - canandgyro = new Canandgyro(CAN2.GYRO); + canandgyro = new Canandgyro(SC0.GYRO); gyroInputs = CanandgyroThread.getInstance().registerCanandgyro(canandgyro); yawTimestampQueue = PhoenixOdometryThread.getInstance().makeTimestampQueue(); yawPositionQueue = PhoenixOdometryThread.getInstance().registerSignal(canandgyro::getYaw); diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonFX.java b/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonFX.java index faac855..a01ad29 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonFX.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonFX.java @@ -34,7 +34,7 @@ import edu.wpi.first.units.measure.AngularVelocity; import edu.wpi.first.units.measure.Current; import edu.wpi.first.units.measure.Voltage; -import frc.robot.Constants.CANBusPorts.CANHD; +import frc.robot.Constants.CANBusPorts.SC1; import java.util.Queue; /** @@ -96,9 +96,9 @@ public ModuleIOTalonFX( SwerveModuleConstants constants) { this.constants = constants; - driveTalon = new TalonFX(constants.DriveMotorId, CANHD.BUS); - turnTalon = new TalonFX(constants.SteerMotorId, CANHD.BUS); - cancoder = new CANcoder(constants.EncoderId, CANHD.BUS); + driveTalon = new TalonFX(constants.DriveMotorId, SC1.BUS); + turnTalon = new TalonFX(constants.SteerMotorId, SC1.BUS); + cancoder = new CANcoder(constants.EncoderId, SC1.BUS); // Configure drive motor var driveConfig = constants.DriveMotorInitialConfigs; From 374e28e090b3a9ece6e6fd2e45f4ad524c3c5970 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 11:11:22 -0400 Subject: [PATCH 12/35] Fix DCMotorSim getter renames and Commands.waitSeconds removal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DCMotorSim getter renames in WPILib 2027: - getAngularPositionRad() → getAngularPosition() - getAngularVelocityRadPerSec() → getAngularVelocity() - getCurrentDrawAmps() → getCurrentDraw() Commands.waitSeconds(double) removed: - Commands.waitSeconds(1.0) → Commands.waitTime(Seconds.of(1.0)) Co-Authored-By: Claude Sonnet 4.6 --- .../java/frc/robot/commands/DriveCommands.java | 2 +- .../robot/subsystems/drive/ModuleIOSimWPI.java | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/frc/robot/commands/DriveCommands.java b/src/main/java/frc/robot/commands/DriveCommands.java index 2162e4c..a539703 100644 --- a/src/main/java/frc/robot/commands/DriveCommands.java +++ b/src/main/java/frc/robot/commands/DriveCommands.java @@ -432,7 +432,7 @@ public static Command wheelRadiusCharacterization(Drive drive) { // Measurement sequence Commands.sequence( // Wait for modules to fully orient before starting measurement - Commands.waitSeconds(1.0), + Commands.waitTime(Seconds.of(1.0)), // Record starting measurement Commands.runOnce( diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java b/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java index dbbed70..1a3074f 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java @@ -67,12 +67,12 @@ public void updateInputs(ModuleIOInputs inputs) { // Run closed-loop control if (driveClosedLoop) { driveAppliedVolts = - driveFFVolts + driveController.calculate(driveSim.getAngularVelocityRadPerSec()); + driveFFVolts + driveController.calculate(driveSim.getAngularVelocity()); } else { driveController.reset(); } if (turnClosedLoop) { - turnAppliedVolts = turnController.calculate(turnSim.getAngularPositionRad()); + turnAppliedVolts = turnController.calculate(turnSim.getAngularPosition()); } else { turnController.reset(); } @@ -86,19 +86,19 @@ public void updateInputs(ModuleIOInputs inputs) { // Update drive inputs inputs.driveConnected = true; - inputs.drivePositionRad = driveSim.getAngularPositionRad(); - inputs.driveVelocityRadPerSec = driveSim.getAngularVelocityRadPerSec(); + inputs.drivePositionRad = driveSim.getAngularPosition(); + inputs.driveVelocityRadPerSec = driveSim.getAngularVelocity(); inputs.driveAppliedVolts = driveAppliedVolts; - inputs.driveCurrentAmps = Math.abs(driveSim.getCurrentDrawAmps()); + inputs.driveCurrentAmps = Math.abs(driveSim.getCurrentDraw()); // Update turn inputs inputs.turnConnected = true; inputs.turnEncoderConnected = true; - inputs.turnAbsolutePosition = new Rotation2d(turnSim.getAngularPositionRad()); - inputs.turnPosition = new Rotation2d(turnSim.getAngularPositionRad()); - inputs.turnVelocityRadPerSec = turnSim.getAngularVelocityRadPerSec(); + inputs.turnAbsolutePosition = new Rotation2d(turnSim.getAngularPosition()); + inputs.turnPosition = new Rotation2d(turnSim.getAngularPosition()); + inputs.turnVelocityRadPerSec = turnSim.getAngularVelocity(); inputs.turnAppliedVolts = turnAppliedVolts; - inputs.turnCurrentAmps = Math.abs(turnSim.getCurrentDrawAmps()); + inputs.turnCurrentAmps = Math.abs(turnSim.getCurrentDraw()); // Update odometry inputs (50Hz because high-frequency odometry in sim doesn't matter) inputs.odometryTimestamps = new double[] {Timer.getFPGATimestamp()}; From bee929c5130c5ee7ab2c2193bc660c7c6d2764ce Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 11:15:19 -0400 Subject: [PATCH 13/35] formatting --- src/main/java/frc/robot/Constants.java | 8 ++++---- src/main/java/frc/robot/subsystems/drive/Drive.java | 3 +-- .../java/frc/robot/subsystems/drive/ModuleIOSimWPI.java | 3 +-- src/main/java/frc/robot/subsystems/leds/LEDStrip.java | 1 + 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index fe20af6..c26b70b 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -77,8 +77,8 @@ public static final class DIOPorts { public static final class CANBusPorts { /** - * SystemCore CAN bus 0 — low-speed bus for support/sensing devices. - * Supports the power distribution and gyro. + * SystemCore CAN bus 0 — low-speed bus for support/sensing devices. Supports the power + * distribution and gyro. */ public static final class SC0 { public static final String NAME = "SC0"; @@ -93,8 +93,8 @@ public static final class SC0 { } /** - * SystemCore CAN bus 1 — high-speed bus for swerve drivetrain devices. - * Supports TalonFX motor controllers and CANcoders. + * SystemCore CAN bus 1 — high-speed bus for swerve drivetrain devices. Supports TalonFX motor + * controllers and CANcoders. */ public static final class SC1 { public static final String NAME = "SC1"; diff --git a/src/main/java/frc/robot/subsystems/drive/Drive.java b/src/main/java/frc/robot/subsystems/drive/Drive.java index 410e2f2..14012d1 100644 --- a/src/main/java/frc/robot/subsystems/drive/Drive.java +++ b/src/main/java/frc/robot/subsystems/drive/Drive.java @@ -191,8 +191,7 @@ public void periodic() { modulePositions[moduleIndex] = modules[moduleIndex].getOdometryPositions()[i]; // Mutate pre-allocated delta objects to avoid allocations moduleDeltas[moduleIndex].distance = - modulePositions[moduleIndex].distance - - lastModulePositions[moduleIndex].distance; + modulePositions[moduleIndex].distance - lastModulePositions[moduleIndex].distance; moduleDeltas[moduleIndex].angle = modulePositions[moduleIndex].angle; lastModulePositions[moduleIndex] = modulePositions[moduleIndex]; } diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java b/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java index 1a3074f..baf112f 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java @@ -66,8 +66,7 @@ public ModuleIOSimWPI( public void updateInputs(ModuleIOInputs inputs) { // Run closed-loop control if (driveClosedLoop) { - driveAppliedVolts = - driveFFVolts + driveController.calculate(driveSim.getAngularVelocity()); + driveAppliedVolts = driveFFVolts + driveController.calculate(driveSim.getAngularVelocity()); } else { driveController.reset(); } diff --git a/src/main/java/frc/robot/subsystems/leds/LEDStrip.java b/src/main/java/frc/robot/subsystems/leds/LEDStrip.java index 0891d74..b6ed382 100644 --- a/src/main/java/frc/robot/subsystems/leds/LEDStrip.java +++ b/src/main/java/frc/robot/subsystems/leds/LEDStrip.java @@ -27,6 +27,7 @@ public enum LEDStrip { private final int length; private AddressableLED led; private AddressableLEDBuffer buffer; + LEDStrip(int port, int length) { this.port = port; this.length = length; From b90e9bebf198a52fdd55de27e9e64c466e047054 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 11:26:52 -0400 Subject: [PATCH 14/35] Update build toolchain for JDK 25 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Gradle wrapper: 8.11 → 9.4.1 (matches WPILib 2027_alpha5 toolchain) - google-java-format: unversioned → 1.28.0 (JDK 25 support) The ReduxLib 2027.0.0-alpha-2 vendordep is compiled for Java 21+, requiring a JDK newer than the WPILib 2026 bundle (JDK 17). The 2027_alpha5 WPILib install provides JDK 25. Gradle 8.11 does not support JDK 25; Gradle 9.4.1 does. The unversioned google-java-format bundled with spotless 7.0.2 uses an internal JDK API removed in JDK 25; version 1.28.0 resolves this. Build with: JAVA_HOME="C:/Users/Public/wpilib/2027_alpha5/jdk" ./gradlew compileJava Co-Authored-By: Claude Sonnet 4.6 --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 93a27e9..efd986c 100644 --- a/build.gradle +++ b/build.gradle @@ -203,7 +203,7 @@ spotless { exclude "**/build/**", "**/build-*/**" } toggleOffOn() - googleJavaFormat() + googleJavaFormat("1.28.0") removeUnusedImports() trimTrailingWhitespace() endWithNewline() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 34bd9ce..42bb5ac 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=permwrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 2be9bf3e7f9cb4173cf085c646f0603d22cfb815 Mon Sep 17 00:00:00 2001 From: nlaverdure Date: Thu, 11 Jun 2026 11:29:07 -0400 Subject: [PATCH 15/35] Fix Command.schedule() deprecation in AutoSelector Command::schedule() is deprecated for removal in WPILib 2027. Replace with CommandScheduler.getInstance()::schedule(). Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/lib/AutoSelector.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/lib/AutoSelector.java b/src/main/java/frc/lib/AutoSelector.java index 6922508..4bd61bf 100644 --- a/src/main/java/frc/lib/AutoSelector.java +++ b/src/main/java/frc/lib/AutoSelector.java @@ -5,6 +5,7 @@ import edu.wpi.first.wpilibj.event.BooleanEvent; import edu.wpi.first.wpilibj.event.EventLoop; import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.CommandScheduler; import edu.wpi.first.wpilibj2.command.button.Trigger; import java.util.ArrayList; import java.util.List; @@ -72,8 +73,8 @@ public Trigger getChangedAutoSelection() { /** Schedules the command corresponding to the selected autonomous mode */ public void scheduleAuto() { - // TODO: schedule() in Command has been deprecated and marked for removal - currentAutoOption.ifPresent(ao -> ao.getAutoCommand().ifPresent(Command::schedule)); + currentAutoOption.ifPresent( + ao -> ao.getAutoCommand().ifPresent(CommandScheduler.getInstance()::schedule)); } /** Deschedules the command corresponding to the selected autonomous mode */ From e3ef55b3210865ce82780fe58326509b9d541f67 Mon Sep 17 00:00:00 2001 From: Nate Laverdure <41549690+nlaverdure@users.noreply.github.com> Date: Mon, 22 Jun 2026 13:26:27 -0400 Subject: [PATCH 16/35] Fix CI for WPILib 2027 alpha toolchain (#14) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update CI workflows for WPILib 2027 alpha toolchain Switch build.yml to wpilib/roborio-cross-ubuntu:2027_alpha5-22.04 (JDK 25) and add required safe.directory git config step. Bump spotless.yml from JDK 17 to JDK 21 — required by google-java-format 1.28.0. Co-Authored-By: Claude Sonnet 4.6 * Revert spotless.yml JDK bump — 17 is sufficient google-java-format 1.28.0 supports JDK 17; the JDK 25 issue was only with the default bundled version. Spotless CI was passing on 17. Co-Authored-By: Claude Sonnet 4.6 * Bump GitHub Actions to v5 for Node.js 24 compatibility actions/checkout and actions/setup-java v4 use Node.js 20, which is removed from runners on September 16, 2026 (forced switch June 16). Co-Authored-By: Claude Sonnet 4.6 * Switch build CI to actions/setup-java JDK 21 (no 2027 container yet) wpilib/roborio-cross-ubuntu has no 2027 alpha image. Since this branch is sim-only (no roboRIO deployment), drop the container and use Temurin JDK 21, which satisfies the minimum required by ReduxLib 2027. Co-Authored-By: Claude Sonnet 4.6 * Switch CI runner to ubuntu-24.04 for GLIBCXX_3.4.31 support WPILib 2027 JNI libs require GLIBCXX_3.4.31 (GCC 13+), which ships with Ubuntu 24.04. Ubuntu 22.04 only provides up to 3.4.30. Co-Authored-By: Claude Sonnet 4.6 * Switch build CI to wpilib/systemcore-cross-ubuntu:2027-24.04 container Replaces the bare ubuntu-24.04 runner + setup-java step with the WPILib-provided cross-build container, which bundles the 2027 toolchain. Co-Authored-By: Claude Sonnet 4.6 * Switch runner to ubuntu-latest; container provides the toolchain Since the job runs inside wpilib/systemcore-cross-ubuntu, the host runner version is irrelevant — ubuntu-latest is sufficient. Co-Authored-By: Claude Sonnet 4.6 * Split CI into separate SystemCore and simulation workflows - Rename build.yml → build-systemcore.yml; switch to minimal container - Add build-simulation.yml using actions/setup-java for host-platform sim build Co-Authored-By: Claude Sonnet 4.6 * Fix simulation CI hanging by adding 30s timeout The sim runs indefinitely; timeout 30 kills it after startup and treat exit code 124 (timeout) as success. Co-Authored-By: Claude Sonnet 4.6 * Fix simulation CI: grep for startup message instead of timeout; add Gradle cache Co-Authored-By: Claude Sonnet 4.6 * Skip spotless in systemcore build; spotless.yml handles formatting Co-Authored-By: Claude Sonnet 4.6 * Fix simulation CI hanging: kill process group after startup detected JVM ignores SIGPIPE so the pipe trick alone doesn't terminate it. Run Gradle in background, detect startup via tail+grep, then kill the entire process group. Co-Authored-By: Claude Sonnet 4.6 * Print simulation log to CI output after startup Co-Authored-By: Claude Sonnet 4.6 * Fix simulation CI exit 143: use setsid to isolate Gradle process group setsid gives Gradle its own session/pgid so kill -- -$GRADLE_PID only terminates the sim, not the shell. Co-Authored-By: Claude Sonnet 4.6 * Simplify simulation CI: assemble and test only, no sim execution Co-Authored-By: Claude Sonnet 4.6 --------- Co-authored-by: Claude Sonnet 4.6 --- .github/workflows/build-simulation.yml | 22 +++++++++++++++++++ .../{build.yml => build-systemcore.yml} | 10 ++++----- .github/workflows/spotless.yml | 4 ++-- 3 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/build-simulation.yml rename .github/workflows/{build.yml => build-systemcore.yml} (51%) diff --git a/.github/workflows/build-simulation.yml b/.github/workflows/build-simulation.yml new file mode 100644 index 0000000..042d979 --- /dev/null +++ b/.github/workflows/build-simulation.yml @@ -0,0 +1,22 @@ +name: Build (Simulation) + +on: + push: + +jobs: + build: + name: Build (Simulation) + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: 21 + cache: gradle + - name: Grant execute permission + run: chmod +x gradlew + - name: Build simulation + run: ./gradlew assemble test diff --git a/.github/workflows/build.yml b/.github/workflows/build-systemcore.yml similarity index 51% rename from .github/workflows/build.yml rename to .github/workflows/build-systemcore.yml index 0010805..28e85e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build-systemcore.yml @@ -1,17 +1,17 @@ -name: Build +name: Build (SystemCore) on: push: jobs: build: - name: Build + name: Build (SystemCore) runs-on: ubuntu-latest - container: wpilib/roborio-cross-ubuntu:2024-22.04 + container: wpilib/systemcore-cross-ubuntu-minimal:2027-24.04 steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Grant execute permission run: chmod +x gradlew - name: Build robot code - run: ./gradlew build + run: ./gradlew assemble test diff --git a/.github/workflows/spotless.yml b/.github/workflows/spotless.yml index 3af5405..51de4cb 100644 --- a/.github/workflows/spotless.yml +++ b/.github/workflows/spotless.yml @@ -9,10 +9,10 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v5 with: distribution: 'zulu' java-version: 17 From a42995de45f4e2cd3c2e6f76f2f08659f5e58af1 Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:26:13 -0400 Subject: [PATCH 17/35] Fix vendordep wpilibYear field for GradleRIO 2027-alpha-6 build compatibility GradleRIO 2027-alpha-6 reads the wpilibYear field from vendordep JSON files to verify compatibility. ChoreoLib and ReduxLib were both using the old frcYear field name (a schema change between alpha releases), causing the build to fail at the configuration phase with "Vendor Dependency X has invalid year null" before any Java compilation could begin. Updated both files from frcYear to wpilibYear and set the value to 2027_alpha5. These libraries (ChoreoLib 2027.0.0-alpha-1 and ReduxLib 2027.0.0-alpha-2) do not yet have releases built against the WPILib 2027-alpha-6 org.wpilib.* package names, so Java compilation errors in code that imports them are expected and are tracked separately. Co-Authored-By: Claude Sonnet 4.6 --- vendordeps/ChoreoLib2027Alpha.json | 2 +- vendordeps/ReduxLib-2027.0.0-alpha-2.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vendordeps/ChoreoLib2027Alpha.json b/vendordeps/ChoreoLib2027Alpha.json index eb0adc5..1b6447e 100644 --- a/vendordeps/ChoreoLib2027Alpha.json +++ b/vendordeps/ChoreoLib2027Alpha.json @@ -3,7 +3,7 @@ "name": "ChoreoLib", "version": "2027.0.0-alpha-1", "uuid": "b5e23f0a-dac9-4ad2-8dd6-02767c520aca", - "frcYear": "2027_alpha1", + "wpilibYear": "2027_alpha5", "mavenUrls": [ "https://frcmaven.wpi.edu/artifactory/sleipnirgroup-mvn-release/" ], diff --git a/vendordeps/ReduxLib-2027.0.0-alpha-2.json b/vendordeps/ReduxLib-2027.0.0-alpha-2.json index 15d7cff..d82a3ff 100644 --- a/vendordeps/ReduxLib-2027.0.0-alpha-2.json +++ b/vendordeps/ReduxLib-2027.0.0-alpha-2.json @@ -2,7 +2,7 @@ "fileName": "ReduxLib-2027.0.0-alpha-2.json", "name": "ReduxLib", "version": "2027.0.0-alpha-2", - "frcYear": "2027_alpha1", + "wpilibYear": "2027_alpha5", "uuid": "151ecca8-670b-4026-8160-cdd2679ef2bd", "mavenUrls": [ "https://maven.reduxrobotics.com/" From 93c92dbe2b38532398ef5115731b48130eac69ff Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:26:32 -0400 Subject: [PATCH 18/35] Normalize vendordep JSON indentation from alpha-2 into alpha-6 merge The merge of main-2027-alpha2 into main-2027-alpha6 left AdvantageKit, PathplannerLib, Phoenix6, and REVLib vendordep files with 4-space indentation while the rest of the project uses 2-space. No functional content changed. Also fixes a minor comment alignment regression in build.gradle introduced during the merge. Co-Authored-By: Claude Sonnet 4.6 --- build.gradle | 2 +- vendordeps/AdvantageKit.json | 68 +- vendordeps/PathplannerLibSystemCoreAlpha.json | 72 +- vendordeps/Phoenix6-26.50.0-alpha-1.json | 896 +++++++++--------- vendordeps/REVLib.json | 250 ++--- 5 files changed, 644 insertions(+), 644 deletions(-) diff --git a/build.gradle b/build.gradle index af62e3e..e5d7e64 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ deploy { files = project.fileTree('src/main/deploy') directory = '/home/systemcore/deploy' deleteOldFiles = false // Change to true to delete files on systemcore that no - // longer exist in deploy directory of this project + // longer exist in deploy directory of this project } } } diff --git a/vendordeps/AdvantageKit.json b/vendordeps/AdvantageKit.json index 177ee85..1a8abd5 100644 --- a/vendordeps/AdvantageKit.json +++ b/vendordeps/AdvantageKit.json @@ -1,35 +1,35 @@ { - "fileName": "AdvantageKit.json", - "name": "AdvantageKit", - "version": "27.0.0-alpha-4", - "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", - "wpilibYear": "2027_alpha5", - "mavenUrls": [ - "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" - ], - "jsonUrl": "https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json", - "javaDependencies": [ - { - "groupId": "org.littletonrobotics.akit", - "artifactId": "akit-java", - "version": "27.0.0-alpha-4" - } - ], - "jniDependencies": [ - { - "groupId": "org.littletonrobotics.akit", - "artifactId": "akit-wpilibio", - "version": "27.0.0-alpha-4", - "skipInvalidPlatforms": false, - "isJar": false, - "validPlatforms": [ - "linuxsystemcore", - "linuxx86-64", - "linuxarm64", - "osxuniversal", - "windowsx86-64" - ] - } - ], - "cppDependencies": [] -} \ No newline at end of file + "fileName": "AdvantageKit.json", + "name": "AdvantageKit", + "version": "27.0.0-alpha-4", + "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", + "wpilibYear": "2027_alpha5", + "mavenUrls": [ + "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" + ], + "jsonUrl": "https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json", + "javaDependencies": [ + { + "groupId": "org.littletonrobotics.akit", + "artifactId": "akit-java", + "version": "27.0.0-alpha-4" + } + ], + "jniDependencies": [ + { + "groupId": "org.littletonrobotics.akit", + "artifactId": "akit-wpilibio", + "version": "27.0.0-alpha-4", + "skipInvalidPlatforms": false, + "isJar": false, + "validPlatforms": [ + "linuxsystemcore", + "linuxx86-64", + "linuxarm64", + "osxuniversal", + "windowsx86-64" + ] + } + ], + "cppDependencies": [] +} diff --git a/vendordeps/PathplannerLibSystemCoreAlpha.json b/vendordeps/PathplannerLibSystemCoreAlpha.json index 24d3c8c..9b36d2b 100644 --- a/vendordeps/PathplannerLibSystemCoreAlpha.json +++ b/vendordeps/PathplannerLibSystemCoreAlpha.json @@ -1,37 +1,37 @@ { - "fileName": "PathplannerLibSystemCoreAlpha.json", - "name": "PathplannerLib", - "version": "2027.0.0-alpha-3", - "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", - "wpilibYear": "2027_alpha5", - "mavenUrls": [ - "https://3015rangerrobotics.github.io/pathplannerlib/repo" - ], - "jsonUrl": "https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLibSystemCoreAlpha.json", - "javaDependencies": [ - { - "groupId": "com.pathplanner.lib", - "artifactId": "PathplannerLib-java", - "version": "2027.0.0-alpha-3" - } - ], - "jniDependencies": [], - "cppDependencies": [ - { - "groupId": "com.pathplanner.lib", - "artifactId": "PathplannerLib-cpp", - "version": "2027.0.0-alpha-3", - "libName": "PathplannerLib", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal", - "linuxsystemcore", - "linuxarm64" - ] - } - ] -} \ No newline at end of file + "fileName": "PathplannerLibSystemCoreAlpha.json", + "name": "PathplannerLib", + "version": "2027.0.0-alpha-3", + "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", + "wpilibYear": "2027_alpha5", + "mavenUrls": [ + "https://3015rangerrobotics.github.io/pathplannerlib/repo" + ], + "jsonUrl": "https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLibSystemCoreAlpha.json", + "javaDependencies": [ + { + "groupId": "com.pathplanner.lib", + "artifactId": "PathplannerLib-java", + "version": "2027.0.0-alpha-3" + } + ], + "jniDependencies": [], + "cppDependencies": [ + { + "groupId": "com.pathplanner.lib", + "artifactId": "PathplannerLib-cpp", + "version": "2027.0.0-alpha-3", + "libName": "PathplannerLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxuniversal", + "linuxsystemcore", + "linuxarm64" + ] + } + ] +} diff --git a/vendordeps/Phoenix6-26.50.0-alpha-1.json b/vendordeps/Phoenix6-26.50.0-alpha-1.json index f7db60a..40dd410 100644 --- a/vendordeps/Phoenix6-26.50.0-alpha-1.json +++ b/vendordeps/Phoenix6-26.50.0-alpha-1.json @@ -1,449 +1,449 @@ { - "fileName": "Phoenix6-26.50.0-alpha-1.json", - "name": "CTRE-Phoenix (v6)", - "version": "26.50.0-alpha-1", - "wpilibYear": "2027_alpha5", - "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", - "mavenUrls": [ - "https://maven.ctr-electronics.com/release/" - ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2027-latest.json", - "conflictsWith": [ - { - "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", - "errorMessage": "Users cannot have both the replay and regular Phoenix 6 vendordeps in their robot program.", - "offlineFileName": "Phoenix6-replay-frc2027-latest.json" - } - ], - "javaDependencies": [ - { - "groupId": "com.ctre.phoenix6", - "artifactId": "wpiapi-java", - "version": "26.50.0-alpha-1" - } - ], - "jniDependencies": [ - { - "groupId": "com.ctre.phoenix6", - "artifactId": "api-cpp", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxsystemcore" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix6", - "artifactId": "tools", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxsystemcore" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "api-cpp-sim", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "tools-sim", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simTalonSRX", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simVictorSPX", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simPigeonIMU", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProTalonFX", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProTalonFXS", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProCANcoder", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProPigeon2", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProCANrange", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProCANdi", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProCANdle", - "version": "26.50.0-alpha-1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - } - ], - "cppDependencies": [ - { - "groupId": "com.ctre.phoenix6", - "artifactId": "wpiapi-cpp", - "version": "26.50.0-alpha-1", - "libName": "CTRE_Phoenix6_WPI", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxsystemcore" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix6", - "artifactId": "tools", - "version": "26.50.0-alpha-1", - "libName": "CTRE_PhoenixTools", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxsystemcore" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "wpiapi-cpp-sim", - "version": "26.50.0-alpha-1", - "libName": "CTRE_Phoenix6_WPISim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "tools-sim", - "version": "26.50.0-alpha-1", - "libName": "CTRE_PhoenixTools_Sim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simTalonSRX", - "version": "26.50.0-alpha-1", - "libName": "CTRE_SimTalonSRX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simVictorSPX", - "version": "26.50.0-alpha-1", - "libName": "CTRE_SimVictorSPX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simPigeonIMU", - "version": "26.50.0-alpha-1", - "libName": "CTRE_SimPigeonIMU", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProTalonFX", - "version": "26.50.0-alpha-1", - "libName": "CTRE_SimProTalonFX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProTalonFXS", - "version": "26.50.0-alpha-1", - "libName": "CTRE_SimProTalonFXS", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProCANcoder", - "version": "26.50.0-alpha-1", - "libName": "CTRE_SimProCANcoder", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProPigeon2", - "version": "26.50.0-alpha-1", - "libName": "CTRE_SimProPigeon2", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProCANrange", - "version": "26.50.0-alpha-1", - "libName": "CTRE_SimProCANrange", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProCANdi", - "version": "26.50.0-alpha-1", - "libName": "CTRE_SimProCANdi", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix6.sim", - "artifactId": "simProCANdle", - "version": "26.50.0-alpha-1", - "libName": "CTRE_SimProCANdle", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - } - ] -} \ No newline at end of file + "fileName": "Phoenix6-26.50.0-alpha-1.json", + "name": "CTRE-Phoenix (v6)", + "version": "26.50.0-alpha-1", + "wpilibYear": "2027_alpha5", + "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", + "mavenUrls": [ + "https://maven.ctr-electronics.com/release/" + ], + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2027-latest.json", + "conflictsWith": [ + { + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "errorMessage": "Users cannot have both the replay and regular Phoenix 6 vendordeps in their robot program.", + "offlineFileName": "Phoenix6-replay-frc2027-latest.json" + } + ], + "javaDependencies": [ + { + "groupId": "com.ctre.phoenix6", + "artifactId": "wpiapi-java", + "version": "26.50.0-alpha-1" + } + ], + "jniDependencies": [ + { + "groupId": "com.ctre.phoenix6", + "artifactId": "api-cpp", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxsystemcore" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", + "artifactId": "tools", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxsystemcore" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "api-cpp-sim", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "tools-sim", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simTalonSRX", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simVictorSPX", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simPigeonIMU", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFX", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANcoder", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProPigeon2", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "26.50.0-alpha-1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ], + "cppDependencies": [ + { + "groupId": "com.ctre.phoenix6", + "artifactId": "wpiapi-cpp", + "version": "26.50.0-alpha-1", + "libName": "CTRE_Phoenix6_WPI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxsystemcore" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", + "artifactId": "tools", + "version": "26.50.0-alpha-1", + "libName": "CTRE_PhoenixTools", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxsystemcore" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "wpiapi-cpp-sim", + "version": "26.50.0-alpha-1", + "libName": "CTRE_Phoenix6_WPISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "tools-sim", + "version": "26.50.0-alpha-1", + "libName": "CTRE_PhoenixTools_Sim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simTalonSRX", + "version": "26.50.0-alpha-1", + "libName": "CTRE_SimTalonSRX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simVictorSPX", + "version": "26.50.0-alpha-1", + "libName": "CTRE_SimVictorSPX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simPigeonIMU", + "version": "26.50.0-alpha-1", + "libName": "CTRE_SimPigeonIMU", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFX", + "version": "26.50.0-alpha-1", + "libName": "CTRE_SimProTalonFX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "26.50.0-alpha-1", + "libName": "CTRE_SimProTalonFXS", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANcoder", + "version": "26.50.0-alpha-1", + "libName": "CTRE_SimProCANcoder", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProPigeon2", + "version": "26.50.0-alpha-1", + "libName": "CTRE_SimProPigeon2", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "26.50.0-alpha-1", + "libName": "CTRE_SimProCANrange", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "26.50.0-alpha-1", + "libName": "CTRE_SimProCANdi", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "26.50.0-alpha-1", + "libName": "CTRE_SimProCANdle", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ] +} diff --git a/vendordeps/REVLib.json b/vendordeps/REVLib.json index 0a3ae50..2b6bd6b 100644 --- a/vendordeps/REVLib.json +++ b/vendordeps/REVLib.json @@ -1,126 +1,126 @@ { - "fileName": "REVLib.json", - "name": "REVLib", - "version": "2027.0.0-alpha-4", - "wpilibYear": "2027_alpha5", - "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", - "mavenUrls": [ - "https://maven.revrobotics.com/" - ], - "jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2027.json", - "javaDependencies": [ - { - "groupId": "com.revrobotics.frc", - "artifactId": "REVLib-java", - "version": "2027.0.0-alpha-4" - } - ], - "jniDependencies": [ - { - "groupId": "com.revrobotics.frc", - "artifactId": "REVLib-driver", - "version": "2027.0.0-alpha-4", - "skipInvalidPlatforms": true, - "isJar": false, - "validPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxsystemcore", - "osxuniversal" - ] - }, - { - "groupId": "com.revrobotics.frc", - "artifactId": "RevLibBackendDriver", - "version": "2027.0.0-alpha-4", - "skipInvalidPlatforms": true, - "isJar": false, - "validPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxsystemcore", - "osxuniversal" - ] - }, - { - "groupId": "com.revrobotics.frc", - "artifactId": "RevLibWpiBackendDriver", - "version": "2027.0.0-alpha-4", - "skipInvalidPlatforms": true, - "isJar": false, - "validPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxsystemcore", - "osxuniversal" - ] - } - ], - "cppDependencies": [ - { - "groupId": "com.revrobotics.frc", - "artifactId": "REVLib-cpp", - "version": "2027.0.0-alpha-4", - "libName": "REVLib", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxsystemcore", - "osxuniversal" - ] - }, - { - "groupId": "com.revrobotics.frc", - "artifactId": "REVLib-driver", - "version": "2027.0.0-alpha-4", - "libName": "REVLibDriver", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxsystemcore", - "osxuniversal" - ] - }, - { - "groupId": "com.revrobotics.frc", - "artifactId": "RevLibBackendDriver", - "version": "2027.0.0-alpha-4", - "libName": "BackendDriver", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxsystemcore", - "osxuniversal" - ] - }, - { - "groupId": "com.revrobotics.frc", - "artifactId": "RevLibWpiBackendDriver", - "version": "2027.0.0-alpha-4", - "libName": "REVLibWpi", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxsystemcore", - "osxuniversal" - ] - } - ] -} \ No newline at end of file + "fileName": "REVLib.json", + "name": "REVLib", + "version": "2027.0.0-alpha-4", + "wpilibYear": "2027_alpha5", + "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", + "mavenUrls": [ + "https://maven.revrobotics.com/" + ], + "jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2027.json", + "javaDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-java", + "version": "2027.0.0-alpha-4" + } + ], + "jniDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2027.0.0-alpha-4", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxsystemcore", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibBackendDriver", + "version": "2027.0.0-alpha-4", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxsystemcore", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibWpiBackendDriver", + "version": "2027.0.0-alpha-4", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxsystemcore", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-cpp", + "version": "2027.0.0-alpha-4", + "libName": "REVLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxsystemcore", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2027.0.0-alpha-4", + "libName": "REVLibDriver", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxsystemcore", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibBackendDriver", + "version": "2027.0.0-alpha-4", + "libName": "BackendDriver", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxsystemcore", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibWpiBackendDriver", + "version": "2027.0.0-alpha-4", + "libName": "REVLibWpi", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxsystemcore", + "osxuniversal" + ] + } + ] +} From b62fb4c1c73ce584a2dc44649e9d8575fbb9a457 Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:27:01 -0400 Subject: [PATCH 19/35] Fix import paths for WPILib 2027-alpha-6 package reorganization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WPILib 2027-alpha-2 used intermediate package names that were reorganized again in alpha-6. This commit updates all import-only changes where no method or type names changed — only the package path the class lives in. Key renames across files: org.wpilib.wpilibj.* -> org.wpilib.hardware.*, org.wpilib.framework.*, org.wpilib.system.*, org.wpilib.event.*, org.wpilib.driverstation.* org.wpilib.commandsv2.* -> org.wpilib.command2.* org.wpilib.math.Matrix -> org.wpilib.math.linalg.Matrix org.wpilib.math.MathUtil -> org.wpilib.math.util.MathUtil org.wpilib.math.Pair -> org.wpilib.math.util.Pair org.wpilib.math.system.plant.DCMotor -> org.wpilib.math.system.DCMotor org.wpilib.apriltag.* -> org.wpilib.vision.apriltag.* org.wpilib.wpilibj.Notifier -> org.wpilib.system.Notifier org.wpilib.wpilibj.{AddressableLED,LEDPattern,...} -> org.wpilib.hardware.led.* Files changed: CommandZorroController, ZorroController, LoggedCompressor, LoggedPowerDistribution, AutoSelectorIO, AutoSelector, AutoOption, KernelLogMonitor, VisionThread, DriveConstants, VisionConstants, VisionFilter, LocalADStarAK, LEDGroup, LEDSeries, LEDStrip, AutoMode. Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/lib/AutoOption.java | 6 +++--- src/main/java/frc/lib/AutoSelector.java | 12 ++++++------ src/main/java/frc/lib/AutoSelectorIO.java | 2 +- src/main/java/frc/lib/CommandZorroController.java | 8 ++++---- src/main/java/frc/lib/LoggedCompressor.java | 4 ++-- src/main/java/frc/lib/LoggedPowerDistribution.java | 2 +- src/main/java/frc/lib/ZorroController.java | 2 +- src/main/java/frc/robot/auto/AutoMode.java | 2 +- .../frc/robot/subsystems/drive/DriveConstants.java | 4 ++-- .../java/frc/robot/subsystems/leds/LEDGroup.java | 8 ++++---- .../java/frc/robot/subsystems/leds/LEDSeries.java | 8 ++++---- .../java/frc/robot/subsystems/leds/LEDStrip.java | 6 +++--- .../frc/robot/subsystems/vision/VisionConstants.java | 4 ++-- .../frc/robot/subsystems/vision/VisionFilter.java | 2 +- src/main/java/frc/robot/util/KernelLogMonitor.java | 2 +- src/main/java/frc/robot/util/LocalADStarAK.java | 2 +- src/main/java/frc/robot/util/VisionThread.java | 2 +- 17 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/main/java/frc/lib/AutoOption.java b/src/main/java/frc/lib/AutoOption.java index 6739b49..0ed26a1 100644 --- a/src/main/java/frc/lib/AutoOption.java +++ b/src/main/java/frc/lib/AutoOption.java @@ -2,9 +2,9 @@ import choreo.trajectory.SwerveSample; import org.wpilib.math.geometry.Pose2d; -import org.wpilib.wpilibj.DriverStation.Alliance; -import org.wpilib.wpilibj.util.Color; -import org.wpilib.commandsv2.Command; +import org.wpilib.driverstation.Alliance; +import org.wpilib.util.Color; +import org.wpilib.command2.Command; import frc.robot.auto.AutoMode; import java.util.Optional; diff --git a/src/main/java/frc/lib/AutoSelector.java b/src/main/java/frc/lib/AutoSelector.java index 449d213..3419ffe 100644 --- a/src/main/java/frc/lib/AutoSelector.java +++ b/src/main/java/frc/lib/AutoSelector.java @@ -1,12 +1,12 @@ package frc.lib; import org.wpilib.math.geometry.Pose2d; -import org.wpilib.wpilibj.DriverStation.Alliance; -import org.wpilib.wpilibj.event.BooleanEvent; -import org.wpilib.wpilibj.event.EventLoop; -import org.wpilib.commandsv2.Command; -import org.wpilib.commandsv2.CommandScheduler; -import org.wpilib.commandsv2.button.Trigger; +import org.wpilib.driverstation.Alliance; +import org.wpilib.event.BooleanEvent; +import org.wpilib.event.EventLoop; +import org.wpilib.command2.Command; +import org.wpilib.command2.CommandScheduler; +import org.wpilib.command2.button.Trigger; import java.util.ArrayList; import java.util.List; import java.util.Optional; diff --git a/src/main/java/frc/lib/AutoSelectorIO.java b/src/main/java/frc/lib/AutoSelectorIO.java index ea11d65..b2e76fc 100644 --- a/src/main/java/frc/lib/AutoSelectorIO.java +++ b/src/main/java/frc/lib/AutoSelectorIO.java @@ -1,6 +1,6 @@ package frc.lib; -import org.wpilib.wpilibj.DigitalInput; +import org.wpilib.hardware.discrete.DigitalInput; import org.littletonrobotics.junction.AutoLog; public class AutoSelectorIO { diff --git a/src/main/java/frc/lib/CommandZorroController.java b/src/main/java/frc/lib/CommandZorroController.java index d27faed..0732e16 100644 --- a/src/main/java/frc/lib/CommandZorroController.java +++ b/src/main/java/frc/lib/CommandZorroController.java @@ -1,9 +1,9 @@ package frc.lib; -import org.wpilib.wpilibj.event.EventLoop; -import org.wpilib.commandsv2.CommandScheduler; -import org.wpilib.commandsv2.button.CommandGenericHID; -import org.wpilib.commandsv2.button.Trigger; +import org.wpilib.event.EventLoop; +import org.wpilib.command2.CommandScheduler; +import org.wpilib.command2.button.CommandGenericHID; +import org.wpilib.command2.button.Trigger; /** * A version of {@link ZorroController} with {@link Trigger} factories for command-based. diff --git a/src/main/java/frc/lib/LoggedCompressor.java b/src/main/java/frc/lib/LoggedCompressor.java index 9b15cb4..863fe2f 100644 --- a/src/main/java/frc/lib/LoggedCompressor.java +++ b/src/main/java/frc/lib/LoggedCompressor.java @@ -1,7 +1,7 @@ package frc.lib; -import org.wpilib.wpilibj.Compressor; -import org.wpilib.wpilibj.PneumaticsModuleType; +import org.wpilib.hardware.pneumatic.Compressor; +import org.wpilib.hardware.pneumatic.PneumaticsModuleType; import org.littletonrobotics.junction.Logger; public class LoggedCompressor extends Compressor { diff --git a/src/main/java/frc/lib/LoggedPowerDistribution.java b/src/main/java/frc/lib/LoggedPowerDistribution.java index c4e9724..d0a6a39 100644 --- a/src/main/java/frc/lib/LoggedPowerDistribution.java +++ b/src/main/java/frc/lib/LoggedPowerDistribution.java @@ -1,6 +1,6 @@ package frc.lib; -import org.wpilib.wpilibj.PowerDistribution; +import org.wpilib.hardware.power.PowerDistribution; import org.littletonrobotics.junction.Logger; public class LoggedPowerDistribution extends PowerDistribution { diff --git a/src/main/java/frc/lib/ZorroController.java b/src/main/java/frc/lib/ZorroController.java index 567af6d..4ced583 100644 --- a/src/main/java/frc/lib/ZorroController.java +++ b/src/main/java/frc/lib/ZorroController.java @@ -2,7 +2,7 @@ import org.wpilib.util.sendable.Sendable; import org.wpilib.util.sendable.SendableBuilder; -import org.wpilib.wpilibj.GenericHID; +import org.wpilib.driverstation.GenericHID; public class ZorroController extends GenericHID implements Sendable { diff --git a/src/main/java/frc/robot/auto/AutoMode.java b/src/main/java/frc/robot/auto/AutoMode.java index 19ce36a..998ac54 100644 --- a/src/main/java/frc/robot/auto/AutoMode.java +++ b/src/main/java/frc/robot/auto/AutoMode.java @@ -12,7 +12,7 @@ import choreo.auto.AutoTrajectory; import choreo.trajectory.SwerveSample; import org.wpilib.math.geometry.Pose2d; -import org.wpilib.commandsv2.Command; +import org.wpilib.command2.Command; import frc.robot.commands.DriveCommands; import frc.robot.subsystems.drive.Drive; import java.util.Optional; diff --git a/src/main/java/frc/robot/subsystems/drive/DriveConstants.java b/src/main/java/frc/robot/subsystems/drive/DriveConstants.java index 8085c47..f9114a8 100644 --- a/src/main/java/frc/robot/subsystems/drive/DriveConstants.java +++ b/src/main/java/frc/robot/subsystems/drive/DriveConstants.java @@ -28,11 +28,11 @@ import com.pathplanner.lib.config.ModuleConfig; import com.pathplanner.lib.config.RobotConfig; import com.pathplanner.lib.path.PathConstraints; -import org.wpilib.math.Matrix; +import org.wpilib.math.linalg.Matrix; import org.wpilib.math.geometry.Translation2d; import org.wpilib.math.numbers.N1; import org.wpilib.math.numbers.N3; -import org.wpilib.math.system.plant.DCMotor; +import org.wpilib.math.system.DCMotor; import org.wpilib.units.measure.AngularAcceleration; import org.wpilib.units.measure.AngularVelocity; import org.wpilib.units.measure.Distance; diff --git a/src/main/java/frc/robot/subsystems/leds/LEDGroup.java b/src/main/java/frc/robot/subsystems/leds/LEDGroup.java index 4af3576..b180394 100644 --- a/src/main/java/frc/robot/subsystems/leds/LEDGroup.java +++ b/src/main/java/frc/robot/subsystems/leds/LEDGroup.java @@ -7,10 +7,10 @@ package frc.robot.subsystems.leds; -import org.wpilib.wpilibj.AddressableLEDBufferView; -import org.wpilib.wpilibj.LEDPattern; -import org.wpilib.wpilibj.LEDReader; -import org.wpilib.wpilibj.LEDWriter; +import org.wpilib.hardware.led.AddressableLEDBufferView; +import org.wpilib.hardware.led.LEDPattern; +import org.wpilib.hardware.led.LEDReader; +import org.wpilib.hardware.led.LEDWriter; /** * Defines logical LED groups on the robot. Each group can span multiple physical strips, composed diff --git a/src/main/java/frc/robot/subsystems/leds/LEDSeries.java b/src/main/java/frc/robot/subsystems/leds/LEDSeries.java index 18e0105..10f89f6 100644 --- a/src/main/java/frc/robot/subsystems/leds/LEDSeries.java +++ b/src/main/java/frc/robot/subsystems/leds/LEDSeries.java @@ -7,10 +7,10 @@ package frc.robot.subsystems.leds; -import org.wpilib.wpilibj.AddressableLEDBufferView; -import org.wpilib.wpilibj.LEDPattern; -import org.wpilib.wpilibj.LEDReader; -import org.wpilib.wpilibj.LEDWriter; +import org.wpilib.hardware.led.AddressableLEDBufferView; +import org.wpilib.hardware.led.LEDPattern; +import org.wpilib.hardware.led.LEDReader; +import org.wpilib.hardware.led.LEDWriter; /** * Defines logical LED series on the robot. Each series can span multiple physical strips, composed diff --git a/src/main/java/frc/robot/subsystems/leds/LEDStrip.java b/src/main/java/frc/robot/subsystems/leds/LEDStrip.java index 37a3302..22bf8a2 100644 --- a/src/main/java/frc/robot/subsystems/leds/LEDStrip.java +++ b/src/main/java/frc/robot/subsystems/leds/LEDStrip.java @@ -7,9 +7,9 @@ package frc.robot.subsystems.leds; -import org.wpilib.wpilibj.AddressableLED; -import org.wpilib.wpilibj.AddressableLEDBuffer; -import org.wpilib.wpilibj.AddressableLEDBufferView; +import org.wpilib.hardware.led.AddressableLED; +import org.wpilib.hardware.led.AddressableLEDBuffer; +import org.wpilib.hardware.led.AddressableLEDBufferView; /** * Defines the physical LED strips on the robot. Each strip is connected to a PWM port and has a diff --git a/src/main/java/frc/robot/subsystems/vision/VisionConstants.java b/src/main/java/frc/robot/subsystems/vision/VisionConstants.java index 04a7ba5..b5a259f 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionConstants.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionConstants.java @@ -9,13 +9,13 @@ import static org.wpilib.units.Units.*; -import org.wpilib.apriltag.AprilTagFields; +import org.wpilib.vision.apriltag.AprilTagFields; import org.wpilib.math.geometry.Quaternion; import org.wpilib.math.geometry.Rotation3d; import org.wpilib.math.geometry.Transform3d; import org.wpilib.units.measure.Angle; import org.wpilib.units.measure.Distance; -import org.wpilib.wpilibj.Filesystem; +import org.wpilib.system.Filesystem; import frc.robot.subsystems.drive.DriveConstants; public class VisionConstants { diff --git a/src/main/java/frc/robot/subsystems/vision/VisionFilter.java b/src/main/java/frc/robot/subsystems/vision/VisionFilter.java index b71e19a..fc6bd21 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionFilter.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionFilter.java @@ -9,7 +9,7 @@ import static frc.robot.subsystems.vision.VisionConstants.*; -import org.wpilib.math.MathUtil; +import org.wpilib.math.util.MathUtil; import org.wpilib.math.geometry.Pose2d; import org.wpilib.math.geometry.Rectangle2d; import org.wpilib.math.geometry.Rotation2d; diff --git a/src/main/java/frc/robot/util/KernelLogMonitor.java b/src/main/java/frc/robot/util/KernelLogMonitor.java index f3655aa..3d43e34 100644 --- a/src/main/java/frc/robot/util/KernelLogMonitor.java +++ b/src/main/java/frc/robot/util/KernelLogMonitor.java @@ -7,7 +7,7 @@ package frc.robot.util; -import org.wpilib.wpilibj.RobotBase; +import org.wpilib.framework.RobotBase; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; diff --git a/src/main/java/frc/robot/util/LocalADStarAK.java b/src/main/java/frc/robot/util/LocalADStarAK.java index ab33b63..82a51a0 100644 --- a/src/main/java/frc/robot/util/LocalADStarAK.java +++ b/src/main/java/frc/robot/util/LocalADStarAK.java @@ -13,7 +13,7 @@ import com.pathplanner.lib.path.PathPoint; import com.pathplanner.lib.pathfinding.LocalADStar; import com.pathplanner.lib.pathfinding.Pathfinder; -import org.wpilib.math.Pair; +import org.wpilib.math.util.Pair; import org.wpilib.math.geometry.Translation2d; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/frc/robot/util/VisionThread.java b/src/main/java/frc/robot/util/VisionThread.java index 5c3de4a..c841c88 100644 --- a/src/main/java/frc/robot/util/VisionThread.java +++ b/src/main/java/frc/robot/util/VisionThread.java @@ -7,7 +7,7 @@ package frc.robot.util; -import org.wpilib.wpilibj.Notifier; +import org.wpilib.system.Notifier; import frc.robot.subsystems.vision.VisionIO; import frc.robot.subsystems.vision.VisionIO.PoseObservation; import frc.robot.subsystems.vision.VisionIO.TargetObservation; From 4c9febd740eaf7d4bfeda14bb96710ee9af0d706 Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:27:26 -0400 Subject: [PATCH 20/35] Fix DriverStation API: static methods split into RobotState and MatchState MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WPILib 2027-alpha-6 removed most static utility methods from DriverStation and split them across two new classes: RobotState — robot operational state: isEnabled(), isDisabled(), isAutonomous(), isFMSAttached(), isDSAttached() MatchState — match-specific data: getAlliance(), getMatchTime(), getMatchType(), getGameData() [returns Optional] DriverStationErrors — error/warning reporting previously on DriverStation: DriverStation.reportError() -> DriverStationErrors.reportError() Also updates the kJoystickPorts constant (removed from DriverStation) to the hardcoded value of 6, which was its only defined value. Also fixes Alliance and DoubleSolenoid.Value enum constants in these same files: Alliance.Red / Alliance.Blue -> Alliance.RED / Alliance.BLUE DoubleSolenoid.Value.kForward -> DoubleSolenoid.Value.FORWARD DoubleSolenoid.Value.kReverse -> DoubleSolenoid.Value.REVERSE GameState.getGameData() now calls MatchState.getGameData().orElse("") since the return type changed from String to Optional. Files changed: GameState, AllianceSelectorIO, ControllerSelector, PneumaticsSimulator, Vision, LEDController, PathCommands. Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/game/GameState.java | 27 ++++++------- src/main/java/frc/lib/AllianceSelectorIO.java | 12 +++--- src/main/java/frc/lib/ControllerSelector.java | 7 ++-- .../java/frc/lib/PneumaticsSimulator.java | 14 +++---- .../java/frc/robot/commands/PathCommands.java | 10 ++--- .../robot/subsystems/leds/LEDController.java | 39 ++++++++++--------- .../frc/robot/subsystems/vision/Vision.java | 17 ++++---- 7 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/main/java/frc/game/GameState.java b/src/main/java/frc/game/GameState.java index a5256f4..916d9b4 100644 --- a/src/main/java/frc/game/GameState.java +++ b/src/main/java/frc/game/GameState.java @@ -1,7 +1,8 @@ package frc.game; -import org.wpilib.wpilibj.DriverStation; -import org.wpilib.wpilibj.DriverStation.Alliance; +import org.wpilib.driverstation.Alliance; +import org.wpilib.driverstation.MatchState; +import org.wpilib.driverstation.RobotState; import frc.robot.Robot; import java.util.List; import java.util.Optional; @@ -43,10 +44,10 @@ private static int parseSeconds(String time) { private static Alliance myAlliance; public static GamePhase getCurrentPhase() { - if (!DriverStation.isDSAttached() && !DriverStation.isFMSAttached()) { + if (!RobotState.isDSAttached() && !RobotState.isFMSAttached()) { return GamePhase.None; } - if (DriverStation.isAutonomous()) { + if (RobotState.isAutonomous()) { return GamePhase.Autonomous; } // Must be in match and teleop @@ -61,29 +62,29 @@ public static GamePhase getCurrentPhase() { public static Alliance getMyAlliance() { if (myAlliance == null) { - // myAlliance = DriverStation.getAlliance().orElse(null); + // myAlliance = MatchState.getAlliance().orElse(null); myAlliance = Robot.allianceSelector.getAllianceColor(); } return myAlliance; } public static double getMatchTime() { - return DriverStation.getMatchTime(); + return MatchState.getMatchTime(); } public static Optional getAlliance() { - return DriverStation.getAlliance(); + return MatchState.getAlliance(); } public static void logValues() { getMyAlliance(); - Logger.recordOutput("GameState/IsDSAttached", DriverStation.isDSAttached()); - Logger.recordOutput("GameState/IsFMSAttached", DriverStation.isFMSAttached()); - Logger.recordOutput("GameState/MatchType", DriverStation.getMatchType()); - Logger.recordOutput("GameState/IsAutonomus", DriverStation.isAutonomous()); - Logger.recordOutput("GameState/MatchTime", DriverStation.getMatchTime()); + Logger.recordOutput("GameState/IsDSAttached", RobotState.isDSAttached()); + Logger.recordOutput("GameState/IsFMSAttached", RobotState.isFMSAttached()); + Logger.recordOutput("GameState/MatchType", MatchState.getMatchType()); + Logger.recordOutput("GameState/IsAutonomus", RobotState.isAutonomous()); + Logger.recordOutput("GameState/MatchTime", MatchState.getMatchTime()); Logger.recordOutput("GameState/Alliance", myAlliance); - Logger.recordOutput("GameState/GameData", DriverStation.getGameSpecificMessage()); + Logger.recordOutput("GameState/GameData", MatchState.getGameData().orElse("")); Logger.recordOutput("GameState/CurrentPhase", getCurrentPhase()); } } diff --git a/src/main/java/frc/lib/AllianceSelectorIO.java b/src/main/java/frc/lib/AllianceSelectorIO.java index 5ed08f4..d6747cc 100644 --- a/src/main/java/frc/lib/AllianceSelectorIO.java +++ b/src/main/java/frc/lib/AllianceSelectorIO.java @@ -1,8 +1,8 @@ package frc.lib; -import org.wpilib.wpilibj.DigitalInput; -import org.wpilib.wpilibj.DriverStation; -import org.wpilib.wpilibj.DriverStation.Alliance; +import org.wpilib.hardware.discrete.DigitalInput; +import org.wpilib.driverstation.Alliance; +import org.wpilib.driverstation.MatchState; import java.util.Optional; import org.littletonrobotics.junction.AutoLog; @@ -17,13 +17,13 @@ public AllianceSelectorIO(int port) { @AutoLog public static class AllianceSelectorIOInputs { - public Alliance allianceFromSwitch = Alliance.Red; + public Alliance allianceFromSwitch = Alliance.RED; public boolean agreementInAllianceInputs = false; public boolean allianceChanged = false; } public void updateInputs(AllianceSelectorIOInputs inputs) { - inputs.allianceFromSwitch = allianceSelectionSwitch.get() ? Alliance.Red : Alliance.Blue; + inputs.allianceFromSwitch = allianceSelectionSwitch.get() ? Alliance.RED : Alliance.BLUE; inputs.agreementInAllianceInputs = agreementInAllianceInputs(inputs); inputs.allianceChanged = changedAlliance(inputs); } @@ -39,7 +39,7 @@ private boolean changedAlliance(AllianceSelectorIOInputs inputs) { } private boolean agreementInAllianceInputs(AllianceSelectorIOInputs inputs) { - Optional allianceFromFMS = DriverStation.getAlliance(); + Optional allianceFromFMS = MatchState.getAlliance(); if (allianceFromFMS.isPresent()) { return inputs.allianceFromSwitch.equals(allianceFromFMS.get()); } else return false; diff --git a/src/main/java/frc/lib/ControllerSelector.java b/src/main/java/frc/lib/ControllerSelector.java index 691e899..db29ddb 100644 --- a/src/main/java/frc/lib/ControllerSelector.java +++ b/src/main/java/frc/lib/ControllerSelector.java @@ -1,8 +1,7 @@ package frc.lib; -import org.wpilib.wpilibj.DriverStation; -import org.wpilib.wpilibj.GenericHID; -import org.wpilib.commandsv2.CommandScheduler; +import org.wpilib.driverstation.GenericHID; +import org.wpilib.command2.CommandScheduler; import frc.robot.Constants; import frc.robot.Constants.Mode; import java.util.Objects; @@ -172,7 +171,7 @@ public OperatorConfig( } } - private static final int NUM_CONTROLLER_PORTS = DriverStation.kJoystickPorts; + private static final int NUM_CONTROLLER_PORTS = 6; private final ControllerConfig[] controllerConfigs; private final GenericHID[] controllers; diff --git a/src/main/java/frc/lib/PneumaticsSimulator.java b/src/main/java/frc/lib/PneumaticsSimulator.java index 4382e49..bff7c02 100644 --- a/src/main/java/frc/lib/PneumaticsSimulator.java +++ b/src/main/java/frc/lib/PneumaticsSimulator.java @@ -7,10 +7,10 @@ package frc.lib; -import org.wpilib.wpilibj.DoubleSolenoid; -import org.wpilib.wpilibj.DriverStation; -import org.wpilib.wpilibj.simulation.DoubleSolenoidSim; -import org.wpilib.wpilibj.simulation.REVPHSim; +import org.wpilib.hardware.pneumatic.DoubleSolenoid; +import org.wpilib.driverstation.RobotState; +import org.wpilib.simulation.DoubleSolenoidSim; +import org.wpilib.simulation.REVPHSim; import org.littletonrobotics.junction.Logger; /** @@ -180,13 +180,13 @@ public void update(double dtSeconds) { double qRodNetScfm = 0.0; // positive = net inflow to rod side double qSupplyScfm = 0.0; // consumed from working volume - if (solenoidValue == DoubleSolenoid.Value.kForward) { + if (solenoidValue == DoubleSolenoid.Value.FORWARD) { // Extend: supply → bore, exhaust ← rod qSupplyScfm = flowScfm(CV_SOLENOID, pWorking, pBore); double qExhaustScfm = flowScfm(CV_EXHAUST, pRod, P_ATM_PSIA); qBoreNetScfm = +qSupplyScfm; qRodNetScfm = -qExhaustScfm; - } else if (solenoidValue == DoubleSolenoid.Value.kReverse) { + } else if (solenoidValue == DoubleSolenoid.Value.REVERSE) { // Retract: supply → rod, exhaust ← bore qSupplyScfm = flowScfm(CV_SOLENOID, pWorking, pRod); double qExhaustScfm = flowScfm(CV_EXHAUST, pBore, P_ATM_PSIA); @@ -205,7 +205,7 @@ public void update(double dtSeconds) { // ── Compressor flow: atmosphere → storage (Viair 90C) ───────────────── double pStorageGauge = pStorage - P_ATM_PSIA; - compressorRunning = DriverStation.isEnabled() && pStorageGauge < P_CUTOFF_PSIG; + compressorRunning = RobotState.isEnabled() && pStorageGauge < P_CUTOFF_PSIG; compressorCurrentAmps = compressorRunning ? AMP_INTERCEPT + AMP_SLOPE * pStorageGauge : 0.0; double qCompressorScfm = compressorRunning ? FLOW_INTERCEPT + FLOW_SLOPE * pStorageGauge : 0.0; diff --git a/src/main/java/frc/robot/commands/PathCommands.java b/src/main/java/frc/robot/commands/PathCommands.java index 8d410be..3a610c1 100644 --- a/src/main/java/frc/robot/commands/PathCommands.java +++ b/src/main/java/frc/robot/commands/PathCommands.java @@ -19,10 +19,10 @@ import org.wpilib.math.geometry.Transform2d; import org.wpilib.math.geometry.Translation2d; import org.wpilib.units.measure.Distance; -import org.wpilib.wpilibj.DriverStation; -import org.wpilib.commandsv2.Command; -import org.wpilib.commandsv2.Commands; -import org.wpilib.commandsv2.DeferredCommand; +import org.wpilib.driverstation.DriverStationErrors; +import org.wpilib.command2.Command; +import org.wpilib.command2.Commands; +import org.wpilib.command2.DeferredCommand; import frc.robot.subsystems.drive.Drive; import java.util.List; import java.util.Set; @@ -150,7 +150,7 @@ public static Command getPathFromFileCommand() { // Create a path following command using AutoBuilder. This will also trigger event markers. return AutoBuilder.followPath(path); } catch (Exception e) { - DriverStation.reportError("Big oops: " + e.getMessage(), e.getStackTrace()); + DriverStationErrors.reportError("Big oops: " + e.getMessage(), e.getStackTrace()); return Commands.none(); } } diff --git a/src/main/java/frc/robot/subsystems/leds/LEDController.java b/src/main/java/frc/robot/subsystems/leds/LEDController.java index 3650f98..f43255c 100644 --- a/src/main/java/frc/robot/subsystems/leds/LEDController.java +++ b/src/main/java/frc/robot/subsystems/leds/LEDController.java @@ -10,13 +10,14 @@ import static org.wpilib.units.Units.Centimeters; import static org.wpilib.units.Units.Seconds; -import org.wpilib.math.MathUtil; +import org.wpilib.math.util.MathUtil; import org.wpilib.math.geometry.Pose2d; -import org.wpilib.wpilibj.DriverStation; -import org.wpilib.wpilibj.DriverStation.Alliance; -import org.wpilib.wpilibj.LEDPattern; -import org.wpilib.wpilibj.util.Color; -import org.wpilib.commandsv2.SubsystemBase; +import org.wpilib.driverstation.Alliance; +import org.wpilib.driverstation.MatchState; +import org.wpilib.driverstation.RobotState; +import org.wpilib.hardware.led.LEDPattern; +import org.wpilib.util.Color; +import org.wpilib.command2.SubsystemBase; import frc.game.GameState; import frc.robot.Robot; import java.util.function.Supplier; @@ -120,27 +121,27 @@ public void displayPoseSeek(Pose2d currentPose, Pose2d targetPose) { // ==================== PRE-ALLOCATED PATTERNS ==================== /** LEDs off */ - public static final LEDPattern solidBlackPattern = LEDPattern.solid(Color.kBlack); + public static final LEDPattern solidBlackPattern = LEDPattern.solid(Color.BLACK); /** Solid color patterns */ - public static final LEDPattern solidYellowPattern = LEDPattern.solid(Color.kYellow); + public static final LEDPattern solidYellowPattern = LEDPattern.solid(Color.YELLOW); - public static final LEDPattern solidRedPattern = LEDPattern.solid(Color.kRed); - public static final LEDPattern solidGreenPattern = LEDPattern.solid(Color.kGreen); - public static final LEDPattern solidWhitePattern = LEDPattern.solid(Color.kWhite); - public static final LEDPattern solidOrangeRedPattern = LEDPattern.solid(Color.kOrangeRed); + public static final LEDPattern solidRedPattern = LEDPattern.solid(Color.RED); + public static final LEDPattern solidGreenPattern = LEDPattern.solid(Color.GREEN); + public static final LEDPattern solidWhitePattern = LEDPattern.solid(Color.WHITE); + public static final LEDPattern solidOrangeRedPattern = LEDPattern.solid(Color.ORANGE_RED); /** Blinking yellow pattern (0.5s period) for missing auto selection. */ public static final LEDPattern blinkingYellowPattern = - LEDPattern.solid(Color.kYellow).blink(Seconds.of(0.5)); + LEDPattern.solid(Color.YELLOW).blink(Seconds.of(0.5)); /** Bounce ripple pattern in yellow (spindexing, not on target). */ public static final LEDPattern bounceRippleYellowPattern = - LEDCustomPattern.bounceRipple(Color.kYellow); + LEDCustomPattern.bounceRipple(Color.YELLOW); /** Bounce ripple pattern in green (spindexing, on target). */ public static final LEDPattern bounceRippleGreenPattern = - LEDCustomPattern.bounceRipple(Color.kGreen); + LEDCustomPattern.bounceRipple(Color.GREEN); /** * Pattern displaying the selected auto routine as counting blocks in alliance color. The number @@ -168,10 +169,10 @@ public void displayPoseSeek(Pose2d currentPose, Pose2d targetPose) { 10.0, // Fill color () -> { - return GameState.getMyAlliance() == Alliance.Blue ? Color.kBlue : Color.kRed; + return GameState.getMyAlliance() == Alliance.BLUE ? Color.BLUE : Color.RED; }, // Background color - Color.kBlack, + Color.BLACK, // Blink period (0.25s = 4Hz flash) 0.25); @@ -189,7 +190,7 @@ public void displayAutoSelection() { () -> LEDSeries.AUTO_SELECTION.applyPattern(blinkingYellowPattern)); // Display yellow warning pixel if alliance disagreement - DriverStation.getAlliance() + MatchState.getAlliance() .ifPresent( alliance -> { if (alliance != Robot.allianceSelector.getAllianceColor()) { @@ -215,7 +216,7 @@ public void displayAutoSelection() { * Otherwise uses X_AXIS_BODY (LEDs 15-35), leaving WARNING_COMPRESSOR free for other indicators. */ public void displayHubCountdown() { - if (DriverStation.isFMSAttached()) { + if (RobotState.isFMSAttached()) { LEDSeries.X_AXIS_FULL.applyPattern(hubCountdownPattern); } else { LEDSeries.X_AXIS_BODY.applyPattern(hubCountdownPattern); diff --git a/src/main/java/frc/robot/subsystems/vision/Vision.java b/src/main/java/frc/robot/subsystems/vision/Vision.java index eac12ae..fb45f63 100644 --- a/src/main/java/frc/robot/subsystems/vision/Vision.java +++ b/src/main/java/frc/robot/subsystems/vision/Vision.java @@ -12,19 +12,18 @@ import static frc.robot.subsystems.vision.VisionConstants.*; -import org.wpilib.apriltag.AprilTagFieldLayout; -import org.wpilib.math.Matrix; -import org.wpilib.math.VecBuilder; +import org.wpilib.vision.apriltag.AprilTagFieldLayout; +import org.wpilib.math.linalg.Matrix; +import org.wpilib.math.linalg.VecBuilder; import org.wpilib.math.filter.LinearFilter; import org.wpilib.math.geometry.Pose2d; import org.wpilib.math.geometry.Pose3d; import org.wpilib.math.geometry.Rotation2d; import org.wpilib.math.numbers.N1; import org.wpilib.math.numbers.N3; -import org.wpilib.wpilibj.Alert; -import org.wpilib.wpilibj.Alert.AlertType; -import org.wpilib.wpilibj.DriverStation; -import org.wpilib.commandsv2.SubsystemBase; +import org.wpilib.driverstation.Alert; +import org.wpilib.driverstation.RobotState; +import org.wpilib.command2.SubsystemBase; import frc.robot.Constants.FeatureFlags; import frc.robot.subsystems.vision.VisionFilter.FusedObservation; import frc.robot.subsystems.vision.VisionFilter.Test; @@ -107,7 +106,7 @@ public Vision(VisionConsumer consumer, Supplier gyroYawSupplier, Vis for (int i = 0; i < inputs.length; i++) { disconnectedAlerts[i] = new Alert( - "Vision camera " + Integer.toString(i) + " is disconnected.", AlertType.kWarning); + "Vision camera " + Integer.toString(i) + " is disconnected.", Alert.Level.MEDIUM); } } @@ -314,7 +313,7 @@ public void accept( public static synchronized AprilTagFieldLayout getAprilTagLayout() { if (cachedLayout == null) { // Try to load custom layout only if requested and not connected to FMS - if (USE_CUSTOM_APRIL_TAG_LAYOUT && !DriverStation.isFMSAttached()) { + if (USE_CUSTOM_APRIL_TAG_LAYOUT && !RobotState.isFMSAttached()) { try { cachedLayout = new AprilTagFieldLayout(CUSTOM_APRIL_TAG_LAYOUT_PATH); } catch (IOException e) { From eb9d5cf12f38f8fcfe327de5946310d07706db5f Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:27:50 -0400 Subject: [PATCH 21/35] Fix swerve kinematics API renames for WPILib 2027-alpha-6 WPILib 2027-alpha-6 renamed the core swerve kinematics types to better reflect that they represent velocities rather than generic "states": ChassisSpeeds -> ChassisVelocities SwerveModuleState -> SwerveModuleVelocity Method renames on SwerveDriveKinematics: toSwerveModuleStates() -> toSwerveModuleVelocities() toChassisSpeeds() -> toChassisVelocities() desaturateWheelSpeeds() -> desaturateWheelVelocities() Behavioral change: desaturateWheelVelocities() now returns a new array instead of mutating the input in-place (annotated @NoDiscard). Both call sites in Drive.java now capture the return value. SwerveModuleVelocity field rename: .speedMetersPerSecond -> .velocity Method semantics change on SwerveModuleVelocity: optimize() and cosineScale() now return new instances rather than mutating in place. Module.runSetpoint() updated to chain: state = state.optimize(...); state = state.cosineScale(...). Also fixes the getRobotRelativeChassisSpeeds() method rename to getRobotRelativeChassisVelocities() that cascades from the type rename, and updates all Alliance/MatchState references in Drive.java that co-existed with the kinematics changes. Files changed: DriveCommands, Drive, Module. Co-Authored-By: Claude Sonnet 4.6 --- .../frc/robot/commands/DriveCommands.java | 34 ++++----- .../frc/robot/subsystems/drive/Drive.java | 69 +++++++++---------- .../frc/robot/subsystems/drive/Module.java | 27 ++++---- 3 files changed, 63 insertions(+), 67 deletions(-) diff --git a/src/main/java/frc/robot/commands/DriveCommands.java b/src/main/java/frc/robot/commands/DriveCommands.java index d2c19e6..b1190be 100644 --- a/src/main/java/frc/robot/commands/DriveCommands.java +++ b/src/main/java/frc/robot/commands/DriveCommands.java @@ -13,19 +13,19 @@ import static org.wpilib.units.Units.*; import static frc.robot.subsystems.drive.DriveConstants.*; -import org.wpilib.math.MathUtil; +import org.wpilib.math.util.MathUtil; import org.wpilib.math.controller.ProfiledPIDController; import org.wpilib.math.filter.SlewRateLimiter; import org.wpilib.math.geometry.Pose2d; import org.wpilib.math.geometry.Rotation2d; import org.wpilib.math.geometry.Transform2d; import org.wpilib.math.geometry.Translation2d; -import org.wpilib.math.kinematics.ChassisSpeeds; +import org.wpilib.math.kinematics.ChassisVelocities; import org.wpilib.math.trajectory.TrapezoidProfile; import org.wpilib.math.util.Units; -import org.wpilib.wpilibj.Timer; -import org.wpilib.commandsv2.Command; -import org.wpilib.commandsv2.Commands; +import org.wpilib.system.Timer; +import org.wpilib.command2.Command; +import org.wpilib.command2.Commands; import frc.robot.subsystems.drive.Drive; import java.text.DecimalFormat; import java.text.NumberFormat; @@ -111,8 +111,8 @@ public static Command joystickDrive( // Square rotation value for more precise control omega = Math.copySign(omega * omega, omega); - ChassisSpeeds speeds = - new ChassisSpeeds( + ChassisVelocities speeds = + new ChassisVelocities( linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), omega * drive.getMaxAngularSpeedRadPerSec()); @@ -152,8 +152,8 @@ public static Command fieldRelativeJoystickDrive( omega = Math.copySign(omega * omega, omega); // Convert to field relative speeds & send command - ChassisSpeeds speeds = - new ChassisSpeeds( + ChassisVelocities speeds = + new ChassisVelocities( linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), omega * drive.getMaxAngularSpeedRadPerSec()); @@ -185,8 +185,8 @@ public static Command robotRelativeJoystickDrive( // Square rotation value for more precise control omega = Math.copySign(omega * omega, omega); - ChassisSpeeds speeds = - new ChassisSpeeds( + ChassisVelocities speeds = + new ChassisVelocities( linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), omega * drive.getMaxAngularSpeedRadPerSec()); @@ -231,8 +231,8 @@ public static Command joystickDriveAtFixedOrientation( rotationSupplier.get().getRadians()); // Convert to field relative speeds & send command - ChassisSpeeds speeds = - new ChassisSpeeds( + ChassisVelocities speeds = + new ChassisVelocities( linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), omega); @@ -278,8 +278,8 @@ public static Command joystickDrivePointedForward( driverHeading.getRadians(), linearVelocity.getAngle().getRadians()); // Convert to field relative speeds & send command - ChassisSpeeds speeds = - new ChassisSpeeds( + ChassisVelocities speeds = + new ChassisVelocities( linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), omega); @@ -321,7 +321,7 @@ public static Command pointAtTarget( double omega = angleController.calculate(yawErrorSupplier.get().getRadians(), 0); // Convert to field relative speeds & send command - ChassisSpeeds speeds = new ChassisSpeeds(0, 0, omega); + ChassisVelocities speeds = new ChassisVelocities(0, 0, omega); drive.runVelocity( speeds.toRobotRelative( getDriverRelativeHeading(drive, fieldRotatedSupplier.getAsBoolean()))); @@ -425,7 +425,7 @@ public static Command wheelRadiusCharacterization(Drive drive) { Commands.run( () -> { double speed = limiter.calculate(WHEEL_RADIUS_MAX_VELOCITY); - drive.runVelocity(new ChassisSpeeds(0.0, 0.0, speed)); + drive.runVelocity(new ChassisVelocities(0.0, 0.0, speed)); }, drive)), diff --git a/src/main/java/frc/robot/subsystems/drive/Drive.java b/src/main/java/frc/robot/subsystems/drive/Drive.java index 4f46fa8..6445b3b 100644 --- a/src/main/java/frc/robot/subsystems/drive/Drive.java +++ b/src/main/java/frc/robot/subsystems/drive/Drive.java @@ -20,27 +20,26 @@ import com.pathplanner.lib.controllers.PPHolonomicDriveController; import com.pathplanner.lib.pathfinding.Pathfinding; import com.pathplanner.lib.util.PathPlannerLogging; -import org.wpilib.hal.HAL; -import org.wpilib.math.Matrix; +import org.wpilib.hardware.hal.HAL; +import org.wpilib.math.linalg.Matrix; import org.wpilib.math.controller.PIDController; import org.wpilib.math.estimator.SwerveDrivePoseEstimator; import org.wpilib.math.geometry.Pose2d; import org.wpilib.math.geometry.Rotation2d; import org.wpilib.math.geometry.Twist2d; -import org.wpilib.math.kinematics.ChassisSpeeds; +import org.wpilib.math.kinematics.ChassisVelocities; import org.wpilib.math.kinematics.SwerveDriveKinematics; import org.wpilib.math.kinematics.SwerveModulePosition; -import org.wpilib.math.kinematics.SwerveModuleState; +import org.wpilib.math.kinematics.SwerveModuleVelocity; import org.wpilib.math.numbers.N1; import org.wpilib.math.numbers.N3; -import org.wpilib.wpilibj.Alert; -import org.wpilib.wpilibj.Alert.AlertType; -import org.wpilib.wpilibj.DriverStation; -import org.wpilib.wpilibj.DriverStation.Alliance; -import org.wpilib.wpilibj.RobotState; -import org.wpilib.commandsv2.Command; -import org.wpilib.commandsv2.SubsystemBase; -import org.wpilib.commandsv2.sysid.SysIdRoutine; +import org.wpilib.driverstation.Alert; +import org.wpilib.driverstation.Alliance; +import org.wpilib.driverstation.MatchState; +import org.wpilib.driverstation.RobotState; +import org.wpilib.command2.Command; +import org.wpilib.command2.SubsystemBase; +import org.wpilib.command2.sysid.SysIdRoutine; import frc.robot.Constants; import frc.robot.Constants.FeatureFlags; import frc.robot.Constants.Mode; @@ -60,7 +59,7 @@ public class Drive extends SubsystemBase { private final Module[] modules = new Module[4]; // FL, FR, BL, BR private final SysIdRoutine sysId; private final Alert gyroDisconnectedAlert = - new Alert("Disconnected gyro, using kinematics as fallback.", AlertType.kError); + new Alert("Disconnected gyro, using kinematics as fallback.", Alert.Level.HIGH); private SwerveDriveKinematics kinematics = new SwerveDriveKinematics(MODULE_TRANSLATIONS); private Rotation2d rawGyroRotation = Rotation2d.kZero; @@ -76,10 +75,10 @@ public class Drive extends SubsystemBase { private boolean firstVisionEstimate = true; private boolean poseInitialized = false; - private static final ChassisSpeeds ZERO_SPEEDS = new ChassisSpeeds(); - private final SwerveModuleState[] emptyModuleStates = new SwerveModuleState[] {}; + private static final ChassisVelocities ZERO_SPEEDS = new ChassisVelocities(); + private final SwerveModuleVelocity[] emptyModuleStates = new SwerveModuleVelocity[] {}; // Pre-allocated for getModuleStates()/getModulePositions() to avoid array allocation each call - private final SwerveModuleState[] measuredStates = new SwerveModuleState[4]; + private final SwerveModuleVelocity[] measuredStates = new SwerveModuleVelocity[4]; private final SwerveModulePosition[] measuredPositions = new SwerveModulePosition[4]; private SwerveModulePosition[] modulePositions = new SwerveModulePosition[4]; // Pre-allocated to avoid allocations in odometry loop - fields are mutated in place @@ -88,7 +87,7 @@ public class Drive extends SubsystemBase { new SwerveModulePosition(), new SwerveModulePosition(), new SwerveModulePosition(), new SwerveModulePosition() }; - private ChassisSpeeds chassisSpeeds; + private ChassisVelocities chassisSpeeds; // PID controllers for following Choreo trajectories private final PIDController xController = new PIDController(8.01, 0.0, 0.0); @@ -118,12 +117,12 @@ public Drive( AutoBuilder.configure( this::getPose, this::setPose, - this::getRobotRelativeChassisSpeeds, + this::getRobotRelativeChassisVelocities, this::runVelocity, new PPHolonomicDriveController( new PIDConstants(5.0, 0.0, 0.0), new PIDConstants(5.0, 0.0, 0.0)), PP_CONFIG, - () -> DriverStation.getAlliance().orElse(Alliance.Blue) == Alliance.Red, + () -> MatchState.getAlliance().orElse(Alliance.BLUE) == Alliance.RED, this); Pathfinding.setPathfinder(new LocalADStarAK()); PathPlannerLogging.setLogActivePathCallback( @@ -167,14 +166,14 @@ public void periodic() { ODOMETRY_LOCK.unlock(); // Stop moving when disabled - if (DriverStation.isDisabled()) { + if (RobotState.isDisabled()) { for (var module : modules) { module.stop(); } } // Log empty setpoint states when disabled - if (DriverStation.isDisabled()) { + if (RobotState.isDisabled()) { Logger.recordOutput("SwerveStates/Setpoints", emptyModuleStates); Logger.recordOutput("SwerveStates/SetpointsOptimized", emptyModuleStates); } @@ -209,7 +208,7 @@ public void periodic() { // Apply update visionPose.updateWithTime(sampleTimestamps[i], rawGyroRotation, modulePositions); - chassisSpeeds = kinematics.toChassisSpeeds(getModuleStates()); + chassisSpeeds = kinematics.toChassisVelocities(getModuleStates()); } long t6 = FeatureFlags.PROFILING_ENABLED ? System.nanoTime() : 0; @@ -247,30 +246,30 @@ public void periodic() { * * @param speeds Speeds in meters/sec */ - public void runVelocity(ChassisSpeeds speeds) { + public void runVelocity(ChassisVelocities speeds) { // 1️: Convert continuous speeds to module states - SwerveModuleState[] states = kinematics.toSwerveModuleStates(speeds); + SwerveModuleVelocity[] states = kinematics.toSwerveModuleVelocities(speeds); // Log unoptimized setpoints - Logger.recordOutput("SwerveChassisSpeeds/Setpoints", speeds); + Logger.recordOutput("SwerveChassisVelocities/Setpoints", speeds); Logger.recordOutput("SwerveStates/Setpoints", states); // 2: Desaturate (apply wheel limits FIRST) - SwerveDriveKinematics.desaturateWheelSpeeds(states, DRIVETRAIN_SPEED_LIMIT.in(MetersPerSecond)); + states = SwerveDriveKinematics.desaturateWheelVelocities(states, DRIVETRAIN_SPEED_LIMIT.in(MetersPerSecond)); // 3: Reconstruct the ACTUAL chassis speeds after limiting - ChassisSpeeds limitedSpeeds = kinematics.toChassisSpeeds(states); + ChassisVelocities limitedSpeeds = kinematics.toChassisVelocities(states); // 4: Now discretize the LIMITED speeds - ChassisSpeeds discreteSpeeds = limitedSpeeds.discretize(0.02); + ChassisVelocities discreteSpeeds = limitedSpeeds.discretize(0.02); // 5: Convert discretized speeds back to module states - SwerveModuleState[] finalStates = kinematics.toSwerveModuleStates(discreteSpeeds); + SwerveModuleVelocity[] finalStates = kinematics.toSwerveModuleVelocities(discreteSpeeds); // (Optional but usually unnecessary) // desaturate again for safety - SwerveDriveKinematics.desaturateWheelSpeeds( + finalStates = SwerveDriveKinematics.desaturateWheelVelocities( finalStates, DRIVETRAIN_SPEED_LIMIT.in(MetersPerSecond)); // 6: Send to modules @@ -287,8 +286,8 @@ public void followTrajectory(SwerveSample sample) { Pose2d pose = getPose(); // Generate the next speeds for the robot - ChassisSpeeds speeds = - new ChassisSpeeds( + ChassisVelocities speeds = + new ChassisVelocities( sample.vx + xController.calculate(pose.getX(), sample.x), sample.vy + yController.calculate(pose.getY(), sample.y), sample.omega @@ -337,7 +336,7 @@ public Command sysIdDynamic(SysIdRoutine.Direction direction) { /** Returns the module states (turn angles and drive velocities) for all of the modules. */ @AutoLogOutput(key = "SwerveStates/Measured") - private SwerveModuleState[] getModuleStates() { + private SwerveModuleVelocity[] getModuleStates() { for (int i = 0; i < 4; i++) { measuredStates[i] = modules[i].getState(); } @@ -353,8 +352,8 @@ private SwerveModulePosition[] getModulePositions() { } /** Returns the measured chassis speeds of the robot. */ - @AutoLogOutput(key = "SwerveChassisSpeeds/Measured") - public ChassisSpeeds getRobotRelativeChassisSpeeds() { + @AutoLogOutput(key = "SwerveChassisVelocities/Measured") + public ChassisVelocities getRobotRelativeChassisVelocities() { return chassisSpeeds; } diff --git a/src/main/java/frc/robot/subsystems/drive/Module.java b/src/main/java/frc/robot/subsystems/drive/Module.java index b88568e..81f5028 100644 --- a/src/main/java/frc/robot/subsystems/drive/Module.java +++ b/src/main/java/frc/robot/subsystems/drive/Module.java @@ -14,10 +14,9 @@ import org.wpilib.math.geometry.Rotation2d; import org.wpilib.math.kinematics.SwerveModulePosition; -import org.wpilib.math.kinematics.SwerveModuleState; -import org.wpilib.wpilibj.Alert; -import org.wpilib.wpilibj.Alert.AlertType; -import org.wpilib.wpilibj.Preferences; +import org.wpilib.math.kinematics.SwerveModuleVelocity; +import org.wpilib.driverstation.Alert; +import org.wpilib.util.Preferences; import frc.robot.Constants.FeatureFlags; import org.littletonrobotics.junction.Logger; @@ -34,9 +33,9 @@ public Module(ModuleIO io, String name) { this.io = io; this.name = name; driveDisconnectedAlert = - new Alert("Disconnected drive motor on module " + name + ".", AlertType.kError); + new Alert("Disconnected drive motor on module " + name + ".", Alert.Level.HIGH); turnDisconnectedAlert = - new Alert("Disconnected turn motor on module " + name + ".", AlertType.kError); + new Alert("Disconnected turn motor on module " + name + ".", Alert.Level.HIGH); // Set turn zero from preferences Rotation2d turnZeroFromCancoder = inputs.turnZero; @@ -90,14 +89,12 @@ public void periodic() { } } - /** Runs the module with the specified setpoint state. Mutates the state to optimize it. */ - public void runSetpoint(SwerveModuleState state) { - // Optimize velocity setpoint - state.optimize(getAngle()); - state.cosineScale(inputs.turnPosition); + /** Runs the module with the specified setpoint state. */ + public void runSetpoint(SwerveModuleVelocity state) { + state = state.optimize(getAngle()); + state = state.cosineScale(inputs.turnPosition); - // Apply setpoints - io.setDriveVelocity(state.speed / WHEEL_RADIUS_METERS); + io.setDriveVelocity(state.velocity / WHEEL_RADIUS_METERS); io.setTurnPosition(state.angle); } @@ -134,8 +131,8 @@ public SwerveModulePosition getPosition() { } /** Returns the module state (turn angle and drive velocity). */ - public SwerveModuleState getState() { - return new SwerveModuleState(getVelocityMetersPerSec(), getAngle()); + public SwerveModuleVelocity getState() { + return new SwerveModuleVelocity(getVelocityMetersPerSec(), getAngle()); } /** Returns the module positions received this cycle. */ From 3c67b5a41bf533ee750faeb81137f34306c7ee9e Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:28:28 -0400 Subject: [PATCH 22/35] Fix Alliance and Color enum constant naming for WPILib 2027-alpha-6 WPILib 2027-alpha-6 renamed enum constants from PascalCase / kPrefixed style to SCREAMING_SNAKE_CASE: Alliance.Red / Alliance.Blue -> Alliance.RED / Alliance.BLUE Color.kBlue -> Color.BLUE Color.kRed -> Color.RED Also in LEDCustomPattern.java: LEDPattern.scrollAtRelativeSpeed() -> scrollAtRelativeVelocity() (method rename matching the velocity terminology adopted across the LED API) Timer.getFPGATimestamp() -> Timer.getTimestamp() (renamed in WPILib 2027 as part of FPGA abstraction cleanup) Files changed: AllianceSelector, Util, LEDCustomPattern. Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/lib/AllianceSelector.java | 10 ++++----- src/main/java/frc/lib/Util.java | 6 ++--- .../subsystems/leds/LEDCustomPattern.java | 22 +++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/frc/lib/AllianceSelector.java b/src/main/java/frc/lib/AllianceSelector.java index 0134337..9da35e6 100644 --- a/src/main/java/frc/lib/AllianceSelector.java +++ b/src/main/java/frc/lib/AllianceSelector.java @@ -1,9 +1,9 @@ package frc.lib; -import org.wpilib.wpilibj.DriverStation.Alliance; -import org.wpilib.wpilibj.event.BooleanEvent; -import org.wpilib.wpilibj.event.EventLoop; -import org.wpilib.commandsv2.button.Trigger; +import org.wpilib.driverstation.Alliance; +import org.wpilib.event.BooleanEvent; +import org.wpilib.event.EventLoop; +import org.wpilib.command2.button.Trigger; import org.littletonrobotics.junction.Logger; public class AllianceSelector { @@ -26,7 +26,7 @@ public AllianceSelector(int port) { * @return Whether the field is rotated from the driver's perspective */ public boolean fieldRotated() { - return inputs.allianceFromSwitch.equals(Alliance.Red); + return inputs.allianceFromSwitch.equals(Alliance.RED); } /** diff --git a/src/main/java/frc/lib/Util.java b/src/main/java/frc/lib/Util.java index 3a9b919..163db4c 100644 --- a/src/main/java/frc/lib/Util.java +++ b/src/main/java/frc/lib/Util.java @@ -1,7 +1,7 @@ package frc.lib; -import org.wpilib.wpilibj.DriverStation.Alliance; -import org.wpilib.wpilibj.util.Color; +import org.wpilib.driverstation.Alliance; +import org.wpilib.util.Color; public interface Util { /** @@ -11,7 +11,7 @@ public interface Util { * @return the appropriate color */ public static Color allianceToColor(Alliance alliance) { - return alliance == Alliance.Blue ? Color.kBlue : Color.kRed; + return alliance == Alliance.BLUE ? Color.BLUE : Color.RED; } /** diff --git a/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java b/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java index 3c95297..e868e7e 100644 --- a/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java +++ b/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java @@ -7,10 +7,10 @@ package frc.robot.subsystems.leds; -import org.wpilib.wpilibj.DriverStation.Alliance; -import org.wpilib.wpilibj.LEDPattern; -import org.wpilib.wpilibj.Timer; -import org.wpilib.wpilibj.util.Color; +import org.wpilib.driverstation.Alliance; +import org.wpilib.hardware.led.LEDPattern; +import org.wpilib.system.Timer; +import org.wpilib.util.Color; import frc.robot.Robot; import java.util.function.BooleanSupplier; import java.util.function.Supplier; @@ -33,7 +33,7 @@ private LEDCustomPattern() {} * @return the stacked blocks pattern */ public static LEDPattern stackedBlocks(Color color, int blockSize, int gapSize) { - return stackedBlocks(color, blockSize, gapSize, Color.kBlack); + return stackedBlocks(color, blockSize, gapSize, Color.BLACK); } /** @@ -89,7 +89,7 @@ public static LEDPattern scrollingBlocks(Color color) { */ public static LEDPattern scrollingBlocks(Color color, int blockSize, int gapSize) { return stackedBlocks(color, blockSize, gapSize) - .scrollAtRelativeSpeed(org.wpilib.units.Units.Hertz.of(2)); + .scrollAtRelativeVelocity(org.wpilib.units.Units.Hertz.of(2)); } /** @@ -149,7 +149,7 @@ public static LEDPattern urgentCountdown( // Blink in urgent mode boolean showFill = - !urgent || ((int) (Timer.getFPGATimestamp() / blinkPeriodSeconds)) % 2 == 0; + !urgent || ((int) (Timer.getTimestamp() / blinkPeriodSeconds)) % 2 == 0; int filledLeds = (int) Math.ceil(length * Math.max(0, Math.min(1, progress))); Color fillColor = showFill ? colorSupplier.get() : backgroundColor; @@ -201,7 +201,7 @@ public static LEDPattern countingBlocks( if (i < maxLed && (i % period) < blockSize) { writer.setLED(i, color); } else { - writer.setLED(i, Color.kBlack); + writer.setLED(i, Color.BLACK); } } }; @@ -225,7 +225,7 @@ public static LEDPattern bounceRipple( int halfLength = length / 2; // Triangle wave for ping-pong motion (0 to 1 to 0) - double time = Timer.getFPGATimestamp(); + double time = Timer.getTimestamp(); double phase = time * cyclesPerSecond; double sawtooth = phase % 1.0; // 0 -> 1 double triangleWave = Math.abs(sawtooth * 2 - 1); // 0 -> 1 -> 0 @@ -265,7 +265,7 @@ else if (tailLength > 0) { i, new Color(color.red * brightness, color.green * brightness, color.blue * brightness)); } else { - writer.setLED(i, Color.kBlack); + writer.setLED(i, Color.BLACK); } } }; @@ -302,7 +302,7 @@ public static LEDPattern bounceRipple(Color color) { public static LEDPattern allianceColor() { if (allianceColorPattern == null) { allianceColorPattern = - solidIf(() -> Robot.getAlliance() == Alliance.Blue, Color.kBlue, Color.kRed); + solidIf(() -> Robot.getAlliance() == Alliance.BLUE, Color.BLUE, Color.RED); } return allianceColorPattern; } From 6ff53ad65aba48edd79557977994e02922004d8a Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:28:47 -0400 Subject: [PATCH 23/35] Fix Robot.java for WPILib 2027-alpha-6 HID and robot lifecycle API changes Several Robot class APIs changed in WPILib 2027-alpha-6: 1. "Test" mode renamed to "Utility" mode: testInit() -> utilityInit() testPeriodic() -> utilityPeriodic() The override methods must match the new names or they are silently ignored. 2. CommandXboxController renamed: CommandXboxController -> CommandNiDsXboxController (reflects that it reads from the NI Driver Station, not a direct USB HID) 3. HID introspection methods removed from DriverStation and moved to GenericHID: DriverStation.kJoystickPorts -> 6 (hardcoded; only value it had) DriverStation.isJoystickConnected(port) -> new GenericHID(port).isConnected() DriverStation.getJoystickName(port) -> hid.getName() DriverStation.getStickAxisCount(port) -> hid.getAxesAvailable() DriverStation.getStickAxis(port, i) -> hid.getRawAxis(i) DriverStation.getStickButtonCount(port) -> hid.getButtonsMaximumIndex() DriverStation.getStickButton(port, i+1) -> hid.getRawButton(i+1) DriverStation.getStickPOVCount(port) -> hid.getPOVsAvailable() DriverStation.getStickPOV(port, i) -> hid.getPOV(i) logHIDs() was rewritten to create a GenericHID instance per port. 4. ModuleType enum constant renamed: PowerDistribution.ModuleType.kRev -> ModuleType.REV Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/robot/Robot.java | 55 +++++++++++++++--------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 565015e..a94b8f2 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -15,20 +15,20 @@ import com.ctre.phoenix6.SignalLogger; import org.wpilib.math.filter.LinearFilter; import org.wpilib.networktables.NetworkTableInstance; -import org.wpilib.wpilibj.DriverStation; -import org.wpilib.wpilibj.DriverStation.Alliance; -import org.wpilib.wpilibj.PowerDistribution.ModuleType; -import org.wpilib.wpilibj.RobotBase; -import org.wpilib.wpilibj.simulation.BatterySim; -import org.wpilib.wpilibj.simulation.RoboRioSim; -import org.wpilib.commandsv2.Command; -import org.wpilib.commandsv2.CommandScheduler; -import org.wpilib.commandsv2.Commands; -import org.wpilib.commandsv2.InstantCommand; -import org.wpilib.commandsv2.SubsystemBase; -import org.wpilib.commandsv2.button.CommandGenericHID; -import org.wpilib.commandsv2.button.CommandXboxController; -import org.wpilib.commandsv2.button.Trigger; +import org.wpilib.driverstation.Alliance; +import org.wpilib.driverstation.GenericHID; +import org.wpilib.hardware.power.PowerDistribution.ModuleType; +import org.wpilib.framework.RobotBase; +import org.wpilib.simulation.BatterySim; +import org.wpilib.simulation.RoboRioSim; +import org.wpilib.command2.Command; +import org.wpilib.command2.CommandScheduler; +import org.wpilib.command2.Commands; +import org.wpilib.command2.InstantCommand; +import org.wpilib.command2.SubsystemBase; +import org.wpilib.command2.button.CommandGenericHID; +import org.wpilib.command2.button.CommandNiDsXboxController; +import org.wpilib.command2.button.Trigger; import frc.game.Field; import frc.game.GameState; import frc.lib.AllianceSelector; @@ -93,7 +93,7 @@ public class Robot extends LoggedRobot { public static final AutoSelector autoSelector = new AutoSelector(DIOPorts.AUTONOMOUS_MODE_SELECTOR, allianceSelector::getAllianceColor); public final LoggedPowerDistribution powerDistribution = - new LoggedPowerDistribution(SC0.BUS_ID, SC0.PD, ModuleType.kRev, "PD"); + new LoggedPowerDistribution(SC0.BUS_ID, SC0.PD, ModuleType.REV, "PD"); private final java.util.Set activeCommands = new java.util.LinkedHashSet<>(); @@ -335,7 +335,7 @@ public void teleopPeriodic() {} /** This function is called once when test mode is enabled. */ @Override - public void testInit() { + public void utilityInit() { // Cancels all running commands at the start of test mode. CommandScheduler.getInstance().cancelAll(); if (leds != null) leds.clear(); @@ -343,7 +343,7 @@ public void testInit() { /** This function is called periodically during test mode. */ @Override - public void testPeriodic() {} + public void utilityPeriodic() {} /** This function is called once when the robot is first started up. */ @Override @@ -420,7 +420,7 @@ public boolean getFieldRelativeInput() { } public DriverController bindXboxDriver(int port) { - var xboxDriver = new CommandXboxController(port); + var xboxDriver = new CommandNiDsXboxController(port); var controller = new DriverController() { @@ -522,21 +522,22 @@ public static long getUSBStorageFreeSpace() { } private static void logHIDs() { - for (int port = 0; port < DriverStation.kJoystickPorts; port++) { - if (!DriverStation.isJoystickConnected(port)) continue; + for (int port = 0; port < 6; port++) { + var hid = new GenericHID(port); + if (!hid.isConnected()) continue; String prefix = "HID/Port" + port; - Logger.recordOutput(prefix + "/Name", DriverStation.getJoystickName(port)); - int axisCount = DriverStation.getStickAxisCount(port); + Logger.recordOutput(prefix + "/Name", hid.getName()); + int axisCount = hid.getAxesAvailable(); double[] axes = new double[axisCount]; - for (int i = 0; i < axisCount; i++) axes[i] = DriverStation.getStickAxis(port, i); + for (int i = 0; i < axisCount; i++) axes[i] = hid.getRawAxis(i); Logger.recordOutput(prefix + "/Axes", axes); - int buttonCount = DriverStation.getStickButtonCount(port); + int buttonCount = hid.getButtonsMaximumIndex(); boolean[] buttons = new boolean[buttonCount]; - for (int i = 0; i < buttonCount; i++) buttons[i] = DriverStation.getStickButton(port, i + 1); + for (int i = 0; i < buttonCount; i++) buttons[i] = hid.getRawButton(i + 1); Logger.recordOutput(prefix + "/Buttons", buttons); - int povCount = DriverStation.getStickPOVCount(port); + int povCount = hid.getPOVsAvailable(); String[] povs = new String[povCount]; - for (int i = 0; i < povCount; i++) povs[i] = DriverStation.getStickPOV(port, i).name(); + for (int i = 0; i < povCount; i++) povs[i] = hid.getPOV(i).name(); Logger.recordOutput(prefix + "/POVs", povs); } } From 3c742dacc0b2dc1ca07c989b71a64caf244261a4 Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:29:19 -0400 Subject: [PATCH 24/35] Fix miscellaneous WPILib 2027-alpha-6 API renames CANBus factory method case change (CTRE Phoenix6): CANBus.systemCore(id) -> CANBus.systemcore(id) Applied to both SC0 and SC1 bus definitions in Constants.java. RobotController timestamp method renamed: RobotController.getFPGATime() -> RobotController.getTime() The "FPGA" qualifier was dropped as the abstraction no longer implies FPGA hardware specifically. Applied in PhoenixOdometryThread and CanandgyroThread. Timer static method renamed: Timer.getFPGATimestamp() -> Timer.getTimestamp() Same rationale as above. Applied in ModuleIOSimWPI. LinearSystemId.createDCMotorSystem() removed: Replaced with Models.singleJointedArmFromPhysicalConstants(DCMotor, J, G). The new method is in org.wpilib.math.system.Models and returns the same LinearSystem used to construct DCMotorSim. Applied in ModuleIOSimWPI for both drive and turn motor sims. MathUtil.clamp() removed: Replaced with Math.max(min, Math.min(max, value)). MathUtil no longer includes a clamp overload; use java.lang.Math directly. Applied in ModuleIOSimWPI for clamping drive/turn applied voltage to bus voltage. Files changed: Constants, ModuleIOSimWPI, PhoenixOdometryThread, CanandgyroThread. Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/robot/Constants.java | 6 +++--- .../subsystems/drive/ModuleIOSimWPI.java | 19 +++++++++---------- .../drive/PhoenixOdometryThread.java | 4 ++-- .../java/frc/robot/util/CanandgyroThread.java | 6 +++--- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 4ec5dc2..17a958d 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -11,7 +11,7 @@ package frc.robot; import com.ctre.phoenix6.CANBus; -import org.wpilib.wpilibj.RobotBase; +import org.wpilib.framework.RobotBase; /** * This class defines the runtime mode used by AdvantageKit. The mode is always "real" when running @@ -83,7 +83,7 @@ public static final class CANBusPorts { public static final class SC0 { public static final String NAME = "SC0"; public static final int BUS_ID = 0; - public static final CANBus BUS = CANBus.systemCore(BUS_ID); + public static final CANBus BUS = CANBus.systemcore(BUS_ID); // Power distribution public static final int PD = 1; @@ -99,7 +99,7 @@ public static final class SC0 { public static final class SC1 { public static final String NAME = "SC1"; public static final int BUS_ID = 1; - public static final CANBus BUS = CANBus.systemCore(BUS_ID); + public static final CANBus BUS = CANBus.systemcore(BUS_ID); // Drivetrain public static final int BACK_LEFT_DRIVE = 10; diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java b/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java index ee95eff..a7be632 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java @@ -10,14 +10,13 @@ import com.ctre.phoenix6.configs.CANcoderConfiguration; import com.ctre.phoenix6.configs.TalonFXConfiguration; import com.ctre.phoenix6.swerve.SwerveModuleConstants; -import org.wpilib.math.MathUtil; import org.wpilib.math.controller.PIDController; import org.wpilib.math.geometry.Rotation2d; -import org.wpilib.math.system.plant.LinearSystemId; +import org.wpilib.math.system.Models; import org.wpilib.math.util.Units; -import org.wpilib.wpilibj.Timer; -import org.wpilib.wpilibj.simulation.DCMotorSim; -import org.wpilib.wpilibj.simulation.RoboRioSim; +import org.wpilib.system.Timer; +import org.wpilib.simulation.DCMotorSim; +import org.wpilib.simulation.RoboRioSim; /** Physics sim implementation of module IO. */ public class ModuleIOSimWPI implements ModuleIO { @@ -47,14 +46,14 @@ public ModuleIOSimWPI( // Create drive and turn sim models driveSim = new DCMotorSim( - LinearSystemId.createDCMotorSystem( + Models.singleJointedArmFromPhysicalConstants( DriveConstants.DRIVE_GEARBOX, constants.DriveInertia, constants.DriveMotorGearRatio), DriveConstants.DRIVE_GEARBOX); turnSim = new DCMotorSim( - LinearSystemId.createDCMotorSystem( + Models.singleJointedArmFromPhysicalConstants( DriveConstants.TURN_GEARBOX, constants.SteerInertia, constants.SteerMotorGearRatio), DriveConstants.TURN_GEARBOX); @@ -78,8 +77,8 @@ public void updateInputs(ModuleIOInputs inputs) { // Update simulation state double busVoltage = RoboRioSim.getVInVoltage(); - driveSim.setInputVoltage(MathUtil.clamp(driveAppliedVolts, -busVoltage, busVoltage)); - turnSim.setInputVoltage(MathUtil.clamp(turnAppliedVolts, -busVoltage, busVoltage)); + driveSim.setInputVoltage(Math.max(-busVoltage, Math.min(busVoltage, driveAppliedVolts))); + turnSim.setInputVoltage(Math.max(-busVoltage, Math.min(busVoltage, turnAppliedVolts))); driveSim.update(0.02); turnSim.update(0.02); @@ -100,7 +99,7 @@ public void updateInputs(ModuleIOInputs inputs) { inputs.turnCurrentAmps = Math.abs(turnSim.getCurrentDraw()); // Update odometry inputs (50Hz because high-frequency odometry in sim doesn't matter) - inputs.odometryTimestamps = new double[] {Timer.getFPGATimestamp()}; + inputs.odometryTimestamps = new double[] {Timer.getTimestamp()}; inputs.odometryDrivePositionsRad = new double[] {inputs.drivePositionRad}; inputs.odometryTurnPositions = new Rotation2d[] {inputs.turnPosition}; } diff --git a/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java b/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java index 61e6082..4631085 100644 --- a/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java +++ b/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java @@ -13,7 +13,7 @@ import com.ctre.phoenix6.CANBus; import com.ctre.phoenix6.StatusSignal; import org.wpilib.units.measure.Angle; -import org.wpilib.wpilibj.RobotController; +import org.wpilib.system.RobotController; import java.util.ArrayList; import java.util.List; import java.util.Queue; @@ -133,7 +133,7 @@ public void run() { // Sample timestamp is current FPGA time minus average CAN latency // Default timestamps from Phoenix are NOT compatible with // FPGA timestamps, this solution is imperfect but close - double timestamp = RobotController.getFPGATime() / 1e6; + double timestamp = RobotController.getTime() / 1e6; double totalLatency = 0.0; for (BaseStatusSignal signal : phoenixSignals) { totalLatency += signal.getTimestamp().getLatency(); diff --git a/src/main/java/frc/robot/util/CanandgyroThread.java b/src/main/java/frc/robot/util/CanandgyroThread.java index 23c8758..99d6ee6 100644 --- a/src/main/java/frc/robot/util/CanandgyroThread.java +++ b/src/main/java/frc/robot/util/CanandgyroThread.java @@ -8,8 +8,8 @@ package frc.robot.util; import com.reduxrobotics.sensors.canandgyro.Canandgyro; -import org.wpilib.wpilibj.Notifier; -import org.wpilib.wpilibj.RobotController; +import org.wpilib.system.Notifier; +import org.wpilib.system.RobotController; import java.util.ArrayList; import java.util.List; import java.util.concurrent.locks.ReentrantLock; @@ -47,7 +47,7 @@ private void update() { calibrating = gyro.isCalibrating(); yaw = gyro.getYaw(); angularVelocityYaw = gyro.getAngularVelocityYaw(); - timestamp = RobotController.getFPGATime() / 1e6; + timestamp = RobotController.getTime() / 1e6; } // Getters for cached values (called from main thread) From c88f0c8b814668432cd9cfb8290e4c5e41dfc34d Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:29:54 -0400 Subject: [PATCH 25/35] Adapt SparkOdometryThread to REVLib 2027-alpha-4 Signal return types REVLib 2027-alpha-4 changed several SparkBase and encoder methods from returning primitive double to returning Signal. Signal is a value wrapper that carries the value, a REVLibError, and a timestamp. Methods now returning Signal: SparkBase.getAppliedOutput() SparkBase.getBusVoltage() SparkBase.getOutputCurrent() RelativeEncoder.getPosition() / getVelocity() AbsoluteEncoder.getPosition() / getVelocity() Changes: - Direct double assignments now call .get(0.0) to unbox the value, using 0.0 as a default when the signal is not valid. getLastError() still exists and is used for error detection as before. - encoder::getPosition and encoder::getVelocity can no longer be used as DoubleSupplier method references since they return Signal. Both registerSpark() overloads (RelativeEncoder and AbsoluteEncoder) now pass lambda wrappers: () -> encoder.getPosition().get(0.0). Also updates RobotController.getFPGATime() -> RobotController.getTime() which was a WPILib rename also affecting this file. Co-Authored-By: Claude Sonnet 4.6 --- .../frc/robot/util/SparkOdometryThread.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/java/frc/robot/util/SparkOdometryThread.java b/src/main/java/frc/robot/util/SparkOdometryThread.java index f235dc2..26008e7 100644 --- a/src/main/java/frc/robot/util/SparkOdometryThread.java +++ b/src/main/java/frc/robot/util/SparkOdometryThread.java @@ -11,8 +11,8 @@ import com.revrobotics.REVLibError; import com.revrobotics.RelativeEncoder; import com.revrobotics.spark.SparkBase; -import org.wpilib.wpilibj.Notifier; -import org.wpilib.wpilibj.RobotController; +import org.wpilib.system.Notifier; +import org.wpilib.system.RobotController; import java.util.ArrayList; import java.util.List; import java.util.concurrent.locks.ReentrantLock; @@ -84,9 +84,9 @@ private void update() { ok = false; } - double output = spark.getAppliedOutput(); + double output = spark.getAppliedOutput().get(0.0); boolean outputOk = spark.getLastError() == REVLibError.kOk; - double voltage = spark.getBusVoltage(); + double voltage = spark.getBusVoltage().get(0.0); boolean voltageOk = spark.getLastError() == REVLibError.kOk; if (outputOk && voltageOk) { appliedVolts = output * voltage; @@ -94,7 +94,7 @@ private void update() { ok = false; } - double current = spark.getOutputCurrent(); + double current = spark.getOutputCurrent().get(0.0); if (spark.getLastError() == REVLibError.kOk) { outputCurrent = current; } else { @@ -110,7 +110,7 @@ private void update() { } } - timestamp = RobotController.getFPGATime() / 1e6; + timestamp = RobotController.getTime() / 1e6; connected = ok; } @@ -173,7 +173,11 @@ public void start() { public SparkInputs registerSpark( SparkBase spark, RelativeEncoder encoder, DoubleSupplier... additionalSuppliers) { SparkInputs inputs = - new SparkInputs(spark, encoder::getPosition, encoder::getVelocity, additionalSuppliers); + new SparkInputs( + spark, + () -> encoder.getPosition().get(0.0), + () -> encoder.getVelocity().get(0.0), + additionalSuppliers); lock.lock(); try { registeredInputs.add(inputs); @@ -194,7 +198,11 @@ public SparkInputs registerSpark( public SparkInputs registerSpark( SparkBase spark, AbsoluteEncoder encoder, DoubleSupplier... additionalSuppliers) { SparkInputs inputs = - new SparkInputs(spark, encoder::getPosition, encoder::getVelocity, additionalSuppliers); + new SparkInputs( + spark, + () -> encoder.getPosition().get(0.0), + () -> encoder.getVelocity().get(0.0), + additionalSuppliers); lock.lock(); try { registeredInputs.add(inputs); From c25324dd91c7e5f24c1783a0ecbb8814c97051f9 Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:36:41 -0400 Subject: [PATCH 26/35] Fix Spotless Google Java Format compatibility with JDK 25 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Google Java Format calls com.sun.tools.javac.util.Log$DeferredDiagnosticHandler .getDiagnostics(), an internal javac API method that was removed in JDK 23. This caused spotlessJavaApply to fail with NoSuchMethodError on every source file when running under the WPILib 2027 JDK 25 toolchain. Two changes: 1. Remove toggleOffOn() — this Spotless feature is a no-op here since no source files use // spotless:off / // spotless:on markers, and it also triggered the same NoSuchMethodError via a separate internal-API lint path. 2. Pin googleJavaFormat to '1.24.0' (already cached locally) and suppress the google-java-format lint step via suppressLintsFor { setStep 'google-java-format' }. The suppressLintsFor call skips the NeedsLintJavac validation that Spotless 7.x added for GJF, which is what fires the NoSuchMethodError. The formatting itself still runs; only the post-format javac lint check is suppressed. Co-Authored-By: Claude Sonnet 4.6 --- build.gradle | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index e5d7e64..d2932bd 100644 --- a/build.gradle +++ b/build.gradle @@ -194,8 +194,10 @@ spotless { include "**/*.java" exclude "**/build/**", "**/build-*/**" } - toggleOffOn() - googleJavaFormat() + googleJavaFormat('1.24.0') + suppressLintsFor { + setStep 'google-java-format' + } removeUnusedImports() trimTrailingWhitespace() endWithNewline() From 8eb4fae345d369570fac0aed892095678f273b64 Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:47:11 -0400 Subject: [PATCH 27/35] Update Spotless GJF to 1.35.0 for JDK 25 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GJF 1.24.0 (and 1.25.0, 1.26.0) crash with NoSuchMethodError on Log$DeferredDiagnosticHandler.getDiagnostics() because that internal javac API was removed in JDK 23. WPILib 2027 ships JDK 25.0.2, so GJF was silently broken on this project. GJF 1.35.0 no longer depends on that internal API and runs correctly on JDK 25. Also remove the suppressLintsFor block added as a workaround — it was masking the crash and causing spotlessJavaCheck to pass even on malformatted files. --- build.gradle | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index d2932bd..d16aa97 100644 --- a/build.gradle +++ b/build.gradle @@ -194,10 +194,7 @@ spotless { include "**/*.java" exclude "**/build/**", "**/build-*/**" } - googleJavaFormat('1.24.0') - suppressLintsFor { - setStep 'google-java-format' - } + googleJavaFormat('1.35.0') removeUnusedImports() trimTrailingWhitespace() endWithNewline() From 69c7cd1bd6635d98472b78cd0dd7f587e571dc57 Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:47:35 -0400 Subject: [PATCH 28/35] Apply GJF 1.35.0 formatting to all Java source files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bulk reformat produced by `gradlew spotlessApply` after upgrading from GJF 1.24.0 to 1.35.0. Style changes are whitespace-only (import ordering, blank lines, line wrapping) — no logic changes. --- src/main/java/frc/game/Field.java | 4 +- src/main/java/frc/game/GameState.java | 6 +-- src/main/java/frc/lib/AllianceSelector.java | 4 +- src/main/java/frc/lib/AllianceSelectorIO.java | 6 +-- src/main/java/frc/lib/AutoOption.java | 8 ++-- src/main/java/frc/lib/AutoSelector.java | 14 +++--- src/main/java/frc/lib/AutoSelectorIO.java | 2 +- .../java/frc/lib/CommandZorroController.java | 2 +- src/main/java/frc/lib/ControllerSelector.java | 4 +- src/main/java/frc/lib/LoggedCompressor.java | 2 +- .../java/frc/lib/LoggedPowerDistribution.java | 2 +- .../java/frc/lib/PneumaticsSimulator.java | 4 +- src/main/java/frc/lib/ZorroController.java | 2 +- src/main/java/frc/robot/Robot.java | 32 +++++++------- src/main/java/frc/robot/auto/AutoMode.java | 4 +- .../frc/robot/commands/DriveCommands.java | 24 +++++------ .../java/frc/robot/commands/PathCommands.java | 18 ++++---- .../frc/robot/subsystems/drive/Drive.java | 43 ++++++++++--------- .../subsystems/drive/DriveConstants.java | 6 +-- .../frc/robot/subsystems/drive/GyroIO.java | 2 +- .../robot/subsystems/drive/GyroIOBoron.java | 4 +- .../frc/robot/subsystems/drive/Module.java | 6 +-- .../frc/robot/subsystems/drive/ModuleIO.java | 2 +- .../subsystems/drive/ModuleIOSimWPI.java | 2 +- .../subsystems/drive/ModuleIOTalonFX.java | 4 +- .../drive/PhoenixOdometryThread.java | 4 +- .../robot/subsystems/leds/LEDController.java | 12 +++--- .../subsystems/leds/LEDCustomPattern.java | 9 ++-- .../frc/robot/subsystems/vision/Vision.java | 24 +++++------ .../subsystems/vision/VisionConstants.java | 6 +-- .../robot/subsystems/vision/VisionFilter.java | 10 ++--- .../frc/robot/subsystems/vision/VisionIO.java | 2 +- .../vision/VisionIOPhotonVision.java | 10 ++--- .../vision/VisionIOPhotonVisionSim.java | 4 +- .../java/frc/robot/util/CanandgyroThread.java | 4 +- .../java/frc/robot/util/KernelLogMonitor.java | 2 +- .../java/frc/robot/util/LocalADStarAK.java | 4 +- .../frc/robot/util/SparkOdometryThread.java | 4 +- .../java/frc/robot/util/VisionThread.java | 2 +- .../subsystems/vision/VisionFilterTest.java | 8 ++-- 40 files changed, 157 insertions(+), 155 deletions(-) diff --git a/src/main/java/frc/game/Field.java b/src/main/java/frc/game/Field.java index 08e2153..2ac3a85 100644 --- a/src/main/java/frc/game/Field.java +++ b/src/main/java/frc/game/Field.java @@ -2,13 +2,13 @@ import static org.wpilib.units.Units.*; +import java.util.List; +import org.littletonrobotics.junction.Logger; import org.wpilib.math.geometry.Pose2d; import org.wpilib.math.geometry.Rectangle2d; import org.wpilib.math.geometry.Rotation2d; import org.wpilib.math.geometry.Translation2d; import org.wpilib.units.measure.Distance; -import java.util.List; -import org.littletonrobotics.junction.Logger; public class Field { // Measured diff --git a/src/main/java/frc/game/GameState.java b/src/main/java/frc/game/GameState.java index 916d9b4..59d3124 100644 --- a/src/main/java/frc/game/GameState.java +++ b/src/main/java/frc/game/GameState.java @@ -1,12 +1,12 @@ package frc.game; -import org.wpilib.driverstation.Alliance; -import org.wpilib.driverstation.MatchState; -import org.wpilib.driverstation.RobotState; import frc.robot.Robot; import java.util.List; import java.util.Optional; import org.littletonrobotics.junction.Logger; +import org.wpilib.driverstation.Alliance; +import org.wpilib.driverstation.MatchState; +import org.wpilib.driverstation.RobotState; public class GameState { diff --git a/src/main/java/frc/lib/AllianceSelector.java b/src/main/java/frc/lib/AllianceSelector.java index 9da35e6..8fc68ca 100644 --- a/src/main/java/frc/lib/AllianceSelector.java +++ b/src/main/java/frc/lib/AllianceSelector.java @@ -1,10 +1,10 @@ package frc.lib; +import org.littletonrobotics.junction.Logger; +import org.wpilib.command2.button.Trigger; import org.wpilib.driverstation.Alliance; import org.wpilib.event.BooleanEvent; import org.wpilib.event.EventLoop; -import org.wpilib.command2.button.Trigger; -import org.littletonrobotics.junction.Logger; public class AllianceSelector { diff --git a/src/main/java/frc/lib/AllianceSelectorIO.java b/src/main/java/frc/lib/AllianceSelectorIO.java index d6747cc..8cc3976 100644 --- a/src/main/java/frc/lib/AllianceSelectorIO.java +++ b/src/main/java/frc/lib/AllianceSelectorIO.java @@ -1,10 +1,10 @@ package frc.lib; -import org.wpilib.hardware.discrete.DigitalInput; -import org.wpilib.driverstation.Alliance; -import org.wpilib.driverstation.MatchState; import java.util.Optional; import org.littletonrobotics.junction.AutoLog; +import org.wpilib.driverstation.Alliance; +import org.wpilib.driverstation.MatchState; +import org.wpilib.hardware.discrete.DigitalInput; public class AllianceSelectorIO { diff --git a/src/main/java/frc/lib/AutoOption.java b/src/main/java/frc/lib/AutoOption.java index 0ed26a1..8613ae5 100644 --- a/src/main/java/frc/lib/AutoOption.java +++ b/src/main/java/frc/lib/AutoOption.java @@ -1,12 +1,12 @@ package frc.lib; import choreo.trajectory.SwerveSample; -import org.wpilib.math.geometry.Pose2d; -import org.wpilib.driverstation.Alliance; -import org.wpilib.util.Color; -import org.wpilib.command2.Command; import frc.robot.auto.AutoMode; import java.util.Optional; +import org.wpilib.command2.Command; +import org.wpilib.driverstation.Alliance; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.util.Color; public class AutoOption { private final Alliance allianceColor; diff --git a/src/main/java/frc/lib/AutoSelector.java b/src/main/java/frc/lib/AutoSelector.java index 3419ffe..7b39937 100644 --- a/src/main/java/frc/lib/AutoSelector.java +++ b/src/main/java/frc/lib/AutoSelector.java @@ -1,17 +1,17 @@ package frc.lib; -import org.wpilib.math.geometry.Pose2d; -import org.wpilib.driverstation.Alliance; -import org.wpilib.event.BooleanEvent; -import org.wpilib.event.EventLoop; -import org.wpilib.command2.Command; -import org.wpilib.command2.CommandScheduler; -import org.wpilib.command2.button.Trigger; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.function.Supplier; import org.littletonrobotics.junction.Logger; +import org.wpilib.command2.Command; +import org.wpilib.command2.CommandScheduler; +import org.wpilib.command2.button.Trigger; +import org.wpilib.driverstation.Alliance; +import org.wpilib.event.BooleanEvent; +import org.wpilib.event.EventLoop; +import org.wpilib.math.geometry.Pose2d; public class AutoSelector implements Supplier> { diff --git a/src/main/java/frc/lib/AutoSelectorIO.java b/src/main/java/frc/lib/AutoSelectorIO.java index b2e76fc..8305d0c 100644 --- a/src/main/java/frc/lib/AutoSelectorIO.java +++ b/src/main/java/frc/lib/AutoSelectorIO.java @@ -1,7 +1,7 @@ package frc.lib; -import org.wpilib.hardware.discrete.DigitalInput; import org.littletonrobotics.junction.AutoLog; +import org.wpilib.hardware.discrete.DigitalInput; public class AutoSelectorIO { diff --git a/src/main/java/frc/lib/CommandZorroController.java b/src/main/java/frc/lib/CommandZorroController.java index 0732e16..dba53cc 100644 --- a/src/main/java/frc/lib/CommandZorroController.java +++ b/src/main/java/frc/lib/CommandZorroController.java @@ -1,9 +1,9 @@ package frc.lib; -import org.wpilib.event.EventLoop; import org.wpilib.command2.CommandScheduler; import org.wpilib.command2.button.CommandGenericHID; import org.wpilib.command2.button.Trigger; +import org.wpilib.event.EventLoop; /** * A version of {@link ZorroController} with {@link Trigger} factories for command-based. diff --git a/src/main/java/frc/lib/ControllerSelector.java b/src/main/java/frc/lib/ControllerSelector.java index db29ddb..e5400ec 100644 --- a/src/main/java/frc/lib/ControllerSelector.java +++ b/src/main/java/frc/lib/ControllerSelector.java @@ -1,12 +1,12 @@ package frc.lib; -import org.wpilib.driverstation.GenericHID; -import org.wpilib.command2.CommandScheduler; import frc.robot.Constants; import frc.robot.Constants.Mode; import java.util.Objects; import java.util.Set; import org.littletonrobotics.junction.Logger; +import org.wpilib.command2.CommandScheduler; +import org.wpilib.driverstation.GenericHID; /** * Manages the selection and binding of controllers for driver and operator roles as a singleton. diff --git a/src/main/java/frc/lib/LoggedCompressor.java b/src/main/java/frc/lib/LoggedCompressor.java index 863fe2f..ce85798 100644 --- a/src/main/java/frc/lib/LoggedCompressor.java +++ b/src/main/java/frc/lib/LoggedCompressor.java @@ -1,8 +1,8 @@ package frc.lib; +import org.littletonrobotics.junction.Logger; import org.wpilib.hardware.pneumatic.Compressor; import org.wpilib.hardware.pneumatic.PneumaticsModuleType; -import org.littletonrobotics.junction.Logger; public class LoggedCompressor extends Compressor { private final String key; diff --git a/src/main/java/frc/lib/LoggedPowerDistribution.java b/src/main/java/frc/lib/LoggedPowerDistribution.java index d0a6a39..3d2a574 100644 --- a/src/main/java/frc/lib/LoggedPowerDistribution.java +++ b/src/main/java/frc/lib/LoggedPowerDistribution.java @@ -1,7 +1,7 @@ package frc.lib; -import org.wpilib.hardware.power.PowerDistribution; import org.littletonrobotics.junction.Logger; +import org.wpilib.hardware.power.PowerDistribution; public class LoggedPowerDistribution extends PowerDistribution { private final String key; diff --git a/src/main/java/frc/lib/PneumaticsSimulator.java b/src/main/java/frc/lib/PneumaticsSimulator.java index bff7c02..7ee6595 100644 --- a/src/main/java/frc/lib/PneumaticsSimulator.java +++ b/src/main/java/frc/lib/PneumaticsSimulator.java @@ -7,11 +7,11 @@ package frc.lib; -import org.wpilib.hardware.pneumatic.DoubleSolenoid; +import org.littletonrobotics.junction.Logger; import org.wpilib.driverstation.RobotState; +import org.wpilib.hardware.pneumatic.DoubleSolenoid; import org.wpilib.simulation.DoubleSolenoidSim; import org.wpilib.simulation.REVPHSim; -import org.littletonrobotics.junction.Logger; /** * Physics-based simulation of the robot's pneumatic system (Viair 90C + 2× Clippard AVT-PP-35). diff --git a/src/main/java/frc/lib/ZorroController.java b/src/main/java/frc/lib/ZorroController.java index 4ced583..e485bff 100644 --- a/src/main/java/frc/lib/ZorroController.java +++ b/src/main/java/frc/lib/ZorroController.java @@ -1,8 +1,8 @@ package frc.lib; +import org.wpilib.driverstation.GenericHID; import org.wpilib.util.sendable.Sendable; import org.wpilib.util.sendable.SendableBuilder; -import org.wpilib.driverstation.GenericHID; public class ZorroController extends GenericHID implements Sendable { diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index a94b8f2..5a90d19 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -13,22 +13,6 @@ import static frc.robot.subsystems.vision.VisionConstants.*; import com.ctre.phoenix6.SignalLogger; -import org.wpilib.math.filter.LinearFilter; -import org.wpilib.networktables.NetworkTableInstance; -import org.wpilib.driverstation.Alliance; -import org.wpilib.driverstation.GenericHID; -import org.wpilib.hardware.power.PowerDistribution.ModuleType; -import org.wpilib.framework.RobotBase; -import org.wpilib.simulation.BatterySim; -import org.wpilib.simulation.RoboRioSim; -import org.wpilib.command2.Command; -import org.wpilib.command2.CommandScheduler; -import org.wpilib.command2.Commands; -import org.wpilib.command2.InstantCommand; -import org.wpilib.command2.SubsystemBase; -import org.wpilib.command2.button.CommandGenericHID; -import org.wpilib.command2.button.CommandNiDsXboxController; -import org.wpilib.command2.button.Trigger; import frc.game.Field; import frc.game.GameState; import frc.lib.AllianceSelector; @@ -66,6 +50,22 @@ import org.littletonrobotics.junction.networktables.NT4Publisher; import org.littletonrobotics.junction.wpilog.WPILOGReader; import org.littletonrobotics.junction.wpilog.WPILOGWriter; +import org.wpilib.command2.Command; +import org.wpilib.command2.CommandScheduler; +import org.wpilib.command2.Commands; +import org.wpilib.command2.InstantCommand; +import org.wpilib.command2.SubsystemBase; +import org.wpilib.command2.button.CommandGenericHID; +import org.wpilib.command2.button.CommandNiDsXboxController; +import org.wpilib.command2.button.Trigger; +import org.wpilib.driverstation.Alliance; +import org.wpilib.driverstation.GenericHID; +import org.wpilib.framework.RobotBase; +import org.wpilib.hardware.power.PowerDistribution.ModuleType; +import org.wpilib.math.filter.LinearFilter; +import org.wpilib.networktables.NetworkTableInstance; +import org.wpilib.simulation.BatterySim; +import org.wpilib.simulation.RoboRioSim; /** * The VM is configured to automatically run this class, and to call the functions corresponding to diff --git a/src/main/java/frc/robot/auto/AutoMode.java b/src/main/java/frc/robot/auto/AutoMode.java index 998ac54..b36c1ca 100644 --- a/src/main/java/frc/robot/auto/AutoMode.java +++ b/src/main/java/frc/robot/auto/AutoMode.java @@ -11,11 +11,11 @@ import choreo.auto.AutoRoutine; import choreo.auto.AutoTrajectory; import choreo.trajectory.SwerveSample; -import org.wpilib.math.geometry.Pose2d; -import org.wpilib.command2.Command; import frc.robot.commands.DriveCommands; import frc.robot.subsystems.drive.Drive; import java.util.Optional; +import org.wpilib.command2.Command; +import org.wpilib.math.geometry.Pose2d; public abstract class AutoMode { private final AutoFactory autoFactory; diff --git a/src/main/java/frc/robot/commands/DriveCommands.java b/src/main/java/frc/robot/commands/DriveCommands.java index b1190be..1312cdd 100644 --- a/src/main/java/frc/robot/commands/DriveCommands.java +++ b/src/main/java/frc/robot/commands/DriveCommands.java @@ -10,10 +10,19 @@ package frc.robot.commands; -import static org.wpilib.units.Units.*; import static frc.robot.subsystems.drive.DriveConstants.*; +import static org.wpilib.units.Units.*; -import org.wpilib.math.util.MathUtil; +import frc.robot.subsystems.drive.Drive; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.util.LinkedList; +import java.util.List; +import java.util.function.BooleanSupplier; +import java.util.function.DoubleSupplier; +import java.util.function.Supplier; +import org.wpilib.command2.Command; +import org.wpilib.command2.Commands; import org.wpilib.math.controller.ProfiledPIDController; import org.wpilib.math.filter.SlewRateLimiter; import org.wpilib.math.geometry.Pose2d; @@ -22,18 +31,9 @@ import org.wpilib.math.geometry.Translation2d; import org.wpilib.math.kinematics.ChassisVelocities; import org.wpilib.math.trajectory.TrapezoidProfile; +import org.wpilib.math.util.MathUtil; import org.wpilib.math.util.Units; import org.wpilib.system.Timer; -import org.wpilib.command2.Command; -import org.wpilib.command2.Commands; -import frc.robot.subsystems.drive.Drive; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.util.LinkedList; -import java.util.List; -import java.util.function.BooleanSupplier; -import java.util.function.DoubleSupplier; -import java.util.function.Supplier; public class DriveCommands { private static final double DEADBAND = 0.035; diff --git a/src/main/java/frc/robot/commands/PathCommands.java b/src/main/java/frc/robot/commands/PathCommands.java index 3a610c1..1521d92 100644 --- a/src/main/java/frc/robot/commands/PathCommands.java +++ b/src/main/java/frc/robot/commands/PathCommands.java @@ -7,26 +7,26 @@ package frc.robot.commands; -import static org.wpilib.units.Units.*; import static frc.robot.subsystems.drive.DriveConstants.*; +import static org.wpilib.units.Units.*; import com.pathplanner.lib.auto.AutoBuilder; import com.pathplanner.lib.path.GoalEndState; import com.pathplanner.lib.path.PathPlannerPath; import com.pathplanner.lib.path.Waypoint; +import frc.robot.subsystems.drive.Drive; +import java.util.List; +import java.util.Set; +import java.util.function.Supplier; +import org.wpilib.command2.Command; +import org.wpilib.command2.Commands; +import org.wpilib.command2.DeferredCommand; +import org.wpilib.driverstation.DriverStationErrors; import org.wpilib.math.geometry.Pose2d; import org.wpilib.math.geometry.Rotation2d; import org.wpilib.math.geometry.Transform2d; import org.wpilib.math.geometry.Translation2d; import org.wpilib.units.measure.Distance; -import org.wpilib.driverstation.DriverStationErrors; -import org.wpilib.command2.Command; -import org.wpilib.command2.Commands; -import org.wpilib.command2.DeferredCommand; -import frc.robot.subsystems.drive.Drive; -import java.util.List; -import java.util.Set; -import java.util.function.Supplier; public class PathCommands { diff --git a/src/main/java/frc/robot/subsystems/drive/Drive.java b/src/main/java/frc/robot/subsystems/drive/Drive.java index 6445b3b..b25ea79 100644 --- a/src/main/java/frc/robot/subsystems/drive/Drive.java +++ b/src/main/java/frc/robot/subsystems/drive/Drive.java @@ -10,8 +10,8 @@ package frc.robot.subsystems.drive; -import static org.wpilib.units.Units.*; import static frc.robot.subsystems.drive.DriveConstants.*; +import static org.wpilib.units.Units.*; import choreo.trajectory.SwerveSample; import com.ctre.phoenix6.CANBus; @@ -20,8 +20,22 @@ import com.pathplanner.lib.controllers.PPHolonomicDriveController; import com.pathplanner.lib.pathfinding.Pathfinding; import com.pathplanner.lib.util.PathPlannerLogging; +import frc.robot.Constants; +import frc.robot.Constants.FeatureFlags; +import frc.robot.Constants.Mode; +import frc.robot.util.LocalADStarAK; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; +import org.littletonrobotics.junction.AutoLogOutput; +import org.littletonrobotics.junction.Logger; +import org.wpilib.command2.Command; +import org.wpilib.command2.SubsystemBase; +import org.wpilib.command2.sysid.SysIdRoutine; +import org.wpilib.driverstation.Alert; +import org.wpilib.driverstation.Alliance; +import org.wpilib.driverstation.MatchState; +import org.wpilib.driverstation.RobotState; import org.wpilib.hardware.hal.HAL; -import org.wpilib.math.linalg.Matrix; import org.wpilib.math.controller.PIDController; import org.wpilib.math.estimator.SwerveDrivePoseEstimator; import org.wpilib.math.geometry.Pose2d; @@ -31,23 +45,9 @@ import org.wpilib.math.kinematics.SwerveDriveKinematics; import org.wpilib.math.kinematics.SwerveModulePosition; import org.wpilib.math.kinematics.SwerveModuleVelocity; +import org.wpilib.math.linalg.Matrix; import org.wpilib.math.numbers.N1; import org.wpilib.math.numbers.N3; -import org.wpilib.driverstation.Alert; -import org.wpilib.driverstation.Alliance; -import org.wpilib.driverstation.MatchState; -import org.wpilib.driverstation.RobotState; -import org.wpilib.command2.Command; -import org.wpilib.command2.SubsystemBase; -import org.wpilib.command2.sysid.SysIdRoutine; -import frc.robot.Constants; -import frc.robot.Constants.FeatureFlags; -import frc.robot.Constants.Mode; -import frc.robot.util.LocalADStarAK; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; -import org.littletonrobotics.junction.AutoLogOutput; -import org.littletonrobotics.junction.Logger; public class Drive extends SubsystemBase { static final double ODOMETRY_FREQUENCY = @@ -256,7 +256,9 @@ public void runVelocity(ChassisVelocities speeds) { Logger.recordOutput("SwerveStates/Setpoints", states); // 2: Desaturate (apply wheel limits FIRST) - states = SwerveDriveKinematics.desaturateWheelVelocities(states, DRIVETRAIN_SPEED_LIMIT.in(MetersPerSecond)); + states = + SwerveDriveKinematics.desaturateWheelVelocities( + states, DRIVETRAIN_SPEED_LIMIT.in(MetersPerSecond)); // 3: Reconstruct the ACTUAL chassis speeds after limiting ChassisVelocities limitedSpeeds = kinematics.toChassisVelocities(states); @@ -269,8 +271,9 @@ public void runVelocity(ChassisVelocities speeds) { // (Optional but usually unnecessary) // desaturate again for safety - finalStates = SwerveDriveKinematics.desaturateWheelVelocities( - finalStates, DRIVETRAIN_SPEED_LIMIT.in(MetersPerSecond)); + finalStates = + SwerveDriveKinematics.desaturateWheelVelocities( + finalStates, DRIVETRAIN_SPEED_LIMIT.in(MetersPerSecond)); // 6: Send to modules for (int i = 0; i < 4; i++) { diff --git a/src/main/java/frc/robot/subsystems/drive/DriveConstants.java b/src/main/java/frc/robot/subsystems/drive/DriveConstants.java index f9114a8..addfea9 100644 --- a/src/main/java/frc/robot/subsystems/drive/DriveConstants.java +++ b/src/main/java/frc/robot/subsystems/drive/DriveConstants.java @@ -28,8 +28,10 @@ import com.pathplanner.lib.config.ModuleConfig; import com.pathplanner.lib.config.RobotConfig; import com.pathplanner.lib.path.PathConstraints; -import org.wpilib.math.linalg.Matrix; +import frc.robot.Constants.CANBusPorts.SC1; +import frc.robot.Constants.MotorConstants.KrakenX60Constants; import org.wpilib.math.geometry.Translation2d; +import org.wpilib.math.linalg.Matrix; import org.wpilib.math.numbers.N1; import org.wpilib.math.numbers.N3; import org.wpilib.math.system.DCMotor; @@ -41,8 +43,6 @@ import org.wpilib.units.measure.Mass; import org.wpilib.units.measure.MomentOfInertia; import org.wpilib.units.measure.Voltage; -import frc.robot.Constants.CANBusPorts.SC1; -import frc.robot.Constants.MotorConstants.KrakenX60Constants; public class DriveConstants { diff --git a/src/main/java/frc/robot/subsystems/drive/GyroIO.java b/src/main/java/frc/robot/subsystems/drive/GyroIO.java index 2c0e591..bc47c1a 100644 --- a/src/main/java/frc/robot/subsystems/drive/GyroIO.java +++ b/src/main/java/frc/robot/subsystems/drive/GyroIO.java @@ -7,8 +7,8 @@ package frc.robot.subsystems.drive; -import org.wpilib.math.geometry.Rotation2d; import org.littletonrobotics.junction.AutoLog; +import org.wpilib.math.geometry.Rotation2d; public interface GyroIO { @AutoLog diff --git a/src/main/java/frc/robot/subsystems/drive/GyroIOBoron.java b/src/main/java/frc/robot/subsystems/drive/GyroIOBoron.java index cd5e172..d44fe14 100644 --- a/src/main/java/frc/robot/subsystems/drive/GyroIOBoron.java +++ b/src/main/java/frc/robot/subsystems/drive/GyroIOBoron.java @@ -8,12 +8,12 @@ package frc.robot.subsystems.drive; import com.reduxrobotics.sensors.canandgyro.Canandgyro; -import org.wpilib.math.geometry.Rotation2d; -import org.wpilib.math.util.Units; import frc.robot.Constants.CANBusPorts.SC0; import frc.robot.util.CanandgyroThread; import frc.robot.util.CanandgyroThread.GyroInputs; import java.util.Queue; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.util.Units; /** IO implementation for Redux Canandgyro. */ public class GyroIOBoron implements GyroIO { diff --git a/src/main/java/frc/robot/subsystems/drive/Module.java b/src/main/java/frc/robot/subsystems/drive/Module.java index 81f5028..0df62ed 100644 --- a/src/main/java/frc/robot/subsystems/drive/Module.java +++ b/src/main/java/frc/robot/subsystems/drive/Module.java @@ -12,13 +12,13 @@ import static frc.robot.subsystems.drive.DriveConstants.*; +import frc.robot.Constants.FeatureFlags; +import org.littletonrobotics.junction.Logger; +import org.wpilib.driverstation.Alert; import org.wpilib.math.geometry.Rotation2d; import org.wpilib.math.kinematics.SwerveModulePosition; import org.wpilib.math.kinematics.SwerveModuleVelocity; -import org.wpilib.driverstation.Alert; import org.wpilib.util.Preferences; -import frc.robot.Constants.FeatureFlags; -import org.littletonrobotics.junction.Logger; public class Module { private final ModuleIO io; diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIO.java b/src/main/java/frc/robot/subsystems/drive/ModuleIO.java index 9be5fa0..64d9e3e 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIO.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIO.java @@ -7,8 +7,8 @@ package frc.robot.subsystems.drive; -import org.wpilib.math.geometry.Rotation2d; import org.littletonrobotics.junction.AutoLog; +import org.wpilib.math.geometry.Rotation2d; public interface ModuleIO { @AutoLog diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java b/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java index a7be632..d4b23ee 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java @@ -14,9 +14,9 @@ import org.wpilib.math.geometry.Rotation2d; import org.wpilib.math.system.Models; import org.wpilib.math.util.Units; -import org.wpilib.system.Timer; import org.wpilib.simulation.DCMotorSim; import org.wpilib.simulation.RoboRioSim; +import org.wpilib.system.Timer; /** Physics sim implementation of module IO. */ public class ModuleIOSimWPI implements ModuleIO { diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonFX.java b/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonFX.java index 1cf7cad..e2c8d4b 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonFX.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonFX.java @@ -27,6 +27,8 @@ import com.ctre.phoenix6.signals.NeutralModeValue; import com.ctre.phoenix6.signals.SensorDirectionValue; import com.ctre.phoenix6.swerve.SwerveModuleConstants; +import frc.robot.Constants.CANBusPorts.SC1; +import java.util.Queue; import org.wpilib.math.filter.Debouncer; import org.wpilib.math.geometry.Rotation2d; import org.wpilib.math.util.Units; @@ -34,8 +36,6 @@ import org.wpilib.units.measure.AngularVelocity; import org.wpilib.units.measure.Current; import org.wpilib.units.measure.Voltage; -import frc.robot.Constants.CANBusPorts.SC1; -import java.util.Queue; /** * Module IO implementation for Talon FX drive motor controller, Talon FX turn motor controller, and diff --git a/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java b/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java index 4631085..7b31127 100644 --- a/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java +++ b/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java @@ -12,8 +12,6 @@ import com.ctre.phoenix6.BaseStatusSignal; import com.ctre.phoenix6.CANBus; import com.ctre.phoenix6.StatusSignal; -import org.wpilib.units.measure.Angle; -import org.wpilib.system.RobotController; import java.util.ArrayList; import java.util.List; import java.util.Queue; @@ -21,6 +19,8 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.function.DoubleSupplier; +import org.wpilib.system.RobotController; +import org.wpilib.units.measure.Angle; /** * Provides an interface for asynchronously reading high-frequency measurements to a set of queues. diff --git a/src/main/java/frc/robot/subsystems/leds/LEDController.java b/src/main/java/frc/robot/subsystems/leds/LEDController.java index f43255c..9cc45dd 100644 --- a/src/main/java/frc/robot/subsystems/leds/LEDController.java +++ b/src/main/java/frc/robot/subsystems/leds/LEDController.java @@ -10,17 +10,17 @@ import static org.wpilib.units.Units.Centimeters; import static org.wpilib.units.Units.Seconds; -import org.wpilib.math.util.MathUtil; -import org.wpilib.math.geometry.Pose2d; +import frc.game.GameState; +import frc.robot.Robot; +import java.util.function.Supplier; +import org.wpilib.command2.SubsystemBase; import org.wpilib.driverstation.Alliance; import org.wpilib.driverstation.MatchState; import org.wpilib.driverstation.RobotState; import org.wpilib.hardware.led.LEDPattern; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.util.MathUtil; import org.wpilib.util.Color; -import org.wpilib.command2.SubsystemBase; -import frc.game.GameState; -import frc.robot.Robot; -import java.util.function.Supplier; /** * A subsystem to control the LEDs on the robot. diff --git a/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java b/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java index e868e7e..dc3f443 100644 --- a/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java +++ b/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java @@ -7,13 +7,13 @@ package frc.robot.subsystems.leds; +import frc.robot.Robot; +import java.util.function.BooleanSupplier; +import java.util.function.Supplier; import org.wpilib.driverstation.Alliance; import org.wpilib.hardware.led.LEDPattern; import org.wpilib.system.Timer; import org.wpilib.util.Color; -import frc.robot.Robot; -import java.util.function.BooleanSupplier; -import java.util.function.Supplier; /** * Custom LED patterns for the robot. These patterns follow the WPILib LEDPattern design: stateless @@ -148,8 +148,7 @@ public static LEDPattern urgentCountdown( } // Blink in urgent mode - boolean showFill = - !urgent || ((int) (Timer.getTimestamp() / blinkPeriodSeconds)) % 2 == 0; + boolean showFill = !urgent || ((int) (Timer.getTimestamp() / blinkPeriodSeconds)) % 2 == 0; int filledLeds = (int) Math.ceil(length * Math.max(0, Math.min(1, progress))); Color fillColor = showFill ? colorSupplier.get() : backgroundColor; diff --git a/src/main/java/frc/robot/subsystems/vision/Vision.java b/src/main/java/frc/robot/subsystems/vision/Vision.java index fb45f63..5d390b1 100644 --- a/src/main/java/frc/robot/subsystems/vision/Vision.java +++ b/src/main/java/frc/robot/subsystems/vision/Vision.java @@ -12,18 +12,6 @@ import static frc.robot.subsystems.vision.VisionConstants.*; -import org.wpilib.vision.apriltag.AprilTagFieldLayout; -import org.wpilib.math.linalg.Matrix; -import org.wpilib.math.linalg.VecBuilder; -import org.wpilib.math.filter.LinearFilter; -import org.wpilib.math.geometry.Pose2d; -import org.wpilib.math.geometry.Pose3d; -import org.wpilib.math.geometry.Rotation2d; -import org.wpilib.math.numbers.N1; -import org.wpilib.math.numbers.N3; -import org.wpilib.driverstation.Alert; -import org.wpilib.driverstation.RobotState; -import org.wpilib.command2.SubsystemBase; import frc.robot.Constants.FeatureFlags; import frc.robot.subsystems.vision.VisionFilter.FusedObservation; import frc.robot.subsystems.vision.VisionFilter.Test; @@ -35,6 +23,18 @@ import java.util.EnumSet; import java.util.function.Supplier; import org.littletonrobotics.junction.Logger; +import org.wpilib.command2.SubsystemBase; +import org.wpilib.driverstation.Alert; +import org.wpilib.driverstation.RobotState; +import org.wpilib.math.filter.LinearFilter; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Pose3d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.linalg.Matrix; +import org.wpilib.math.linalg.VecBuilder; +import org.wpilib.math.numbers.N1; +import org.wpilib.math.numbers.N3; +import org.wpilib.vision.apriltag.AprilTagFieldLayout; public class Vision extends SubsystemBase { private final VisionConsumer consumer; diff --git a/src/main/java/frc/robot/subsystems/vision/VisionConstants.java b/src/main/java/frc/robot/subsystems/vision/VisionConstants.java index b5a259f..37dea89 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionConstants.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionConstants.java @@ -9,14 +9,14 @@ import static org.wpilib.units.Units.*; -import org.wpilib.vision.apriltag.AprilTagFields; +import frc.robot.subsystems.drive.DriveConstants; import org.wpilib.math.geometry.Quaternion; import org.wpilib.math.geometry.Rotation3d; import org.wpilib.math.geometry.Transform3d; +import org.wpilib.system.Filesystem; import org.wpilib.units.measure.Angle; import org.wpilib.units.measure.Distance; -import org.wpilib.system.Filesystem; -import frc.robot.subsystems.drive.DriveConstants; +import org.wpilib.vision.apriltag.AprilTagFields; public class VisionConstants { diff --git a/src/main/java/frc/robot/subsystems/vision/VisionFilter.java b/src/main/java/frc/robot/subsystems/vision/VisionFilter.java index fc6bd21..4f5762e 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionFilter.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionFilter.java @@ -9,11 +9,6 @@ import static frc.robot.subsystems.vision.VisionConstants.*; -import org.wpilib.math.util.MathUtil; -import org.wpilib.math.geometry.Pose2d; -import org.wpilib.math.geometry.Rectangle2d; -import org.wpilib.math.geometry.Rotation2d; -import org.wpilib.math.geometry.Translation2d; import frc.robot.subsystems.vision.VisionIO.PoseObservation; import java.util.ArrayList; import java.util.EnumMap; @@ -22,6 +17,11 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Rectangle2d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Translation2d; +import org.wpilib.math.util.MathUtil; /** * Handles scoring and filtering of vision observations. diff --git a/src/main/java/frc/robot/subsystems/vision/VisionIO.java b/src/main/java/frc/robot/subsystems/vision/VisionIO.java index 1e4b469..9c5ba3d 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionIO.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionIO.java @@ -10,9 +10,9 @@ package frc.robot.subsystems.vision; +import org.littletonrobotics.junction.AutoLog; import org.wpilib.math.geometry.Pose3d; import org.wpilib.math.geometry.Rotation2d; -import org.littletonrobotics.junction.AutoLog; public interface VisionIO { public static final TargetObservation EMPTY_TARGET = diff --git a/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVision.java b/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVision.java index a8e27cd..4e59bef 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVision.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVision.java @@ -10,17 +10,17 @@ package frc.robot.subsystems.vision; -import org.wpilib.math.geometry.Pose3d; -import org.wpilib.math.geometry.Rotation2d; -import org.wpilib.math.geometry.Transform3d; -import org.wpilib.networktables.DoubleSubscriber; -import org.wpilib.networktables.NetworkTableInstance; import frc.robot.subsystems.vision.VisionConstants.CameraConfig; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.photonvision.PhotonCamera; +import org.wpilib.math.geometry.Pose3d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Transform3d; +import org.wpilib.networktables.DoubleSubscriber; +import org.wpilib.networktables.NetworkTableInstance; /** IO implementation for real PhotonVision hardware. */ public class VisionIOPhotonVision implements VisionIO { diff --git a/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVisionSim.java b/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVisionSim.java index c044821..26de377 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVisionSim.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVisionSim.java @@ -10,13 +10,13 @@ package frc.robot.subsystems.vision; -import org.wpilib.math.geometry.Pose2d; -import org.wpilib.math.geometry.Rotation2d; import frc.robot.subsystems.vision.VisionConstants.CameraConfig; import java.util.function.Supplier; import org.photonvision.simulation.PhotonCameraSim; import org.photonvision.simulation.SimCameraProperties; import org.photonvision.simulation.VisionSystemSim; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Rotation2d; /** IO implementation for physics sim using PhotonVision simulator. */ public class VisionIOPhotonVisionSim extends VisionIOPhotonVision { diff --git a/src/main/java/frc/robot/util/CanandgyroThread.java b/src/main/java/frc/robot/util/CanandgyroThread.java index 99d6ee6..a8965e0 100644 --- a/src/main/java/frc/robot/util/CanandgyroThread.java +++ b/src/main/java/frc/robot/util/CanandgyroThread.java @@ -8,11 +8,11 @@ package frc.robot.util; import com.reduxrobotics.sensors.canandgyro.Canandgyro; -import org.wpilib.system.Notifier; -import org.wpilib.system.RobotController; import java.util.ArrayList; import java.util.List; import java.util.concurrent.locks.ReentrantLock; +import org.wpilib.system.Notifier; +import org.wpilib.system.RobotController; /** * Provides an interface for asynchronously reading Canandgyro inputs on a background thread, diff --git a/src/main/java/frc/robot/util/KernelLogMonitor.java b/src/main/java/frc/robot/util/KernelLogMonitor.java index 3d43e34..2093474 100644 --- a/src/main/java/frc/robot/util/KernelLogMonitor.java +++ b/src/main/java/frc/robot/util/KernelLogMonitor.java @@ -7,7 +7,6 @@ package frc.robot.util; -import org.wpilib.framework.RobotBase; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -20,6 +19,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Pattern; import org.littletonrobotics.junction.Logger; +import org.wpilib.framework.RobotBase; /** * Monitors RoboRIO kernel logs for unexpected events (USB disconnects, ESD events, hardware errors) diff --git a/src/main/java/frc/robot/util/LocalADStarAK.java b/src/main/java/frc/robot/util/LocalADStarAK.java index 82a51a0..0736e63 100644 --- a/src/main/java/frc/robot/util/LocalADStarAK.java +++ b/src/main/java/frc/robot/util/LocalADStarAK.java @@ -13,14 +13,14 @@ import com.pathplanner.lib.path.PathPoint; import com.pathplanner.lib.pathfinding.LocalADStar; import com.pathplanner.lib.pathfinding.Pathfinder; -import org.wpilib.math.util.Pair; -import org.wpilib.math.geometry.Translation2d; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.littletonrobotics.junction.LogTable; import org.littletonrobotics.junction.Logger; import org.littletonrobotics.junction.inputs.LoggableInputs; +import org.wpilib.math.geometry.Translation2d; +import org.wpilib.math.util.Pair; // NOTE: This file is available at // https://gist.github.com/mjansen4857/a8024b55eb427184dbd10ae8923bd57d diff --git a/src/main/java/frc/robot/util/SparkOdometryThread.java b/src/main/java/frc/robot/util/SparkOdometryThread.java index 26008e7..eeed7b9 100644 --- a/src/main/java/frc/robot/util/SparkOdometryThread.java +++ b/src/main/java/frc/robot/util/SparkOdometryThread.java @@ -11,12 +11,12 @@ import com.revrobotics.REVLibError; import com.revrobotics.RelativeEncoder; import com.revrobotics.spark.SparkBase; -import org.wpilib.system.Notifier; -import org.wpilib.system.RobotController; import java.util.ArrayList; import java.util.List; import java.util.concurrent.locks.ReentrantLock; import java.util.function.DoubleSupplier; +import org.wpilib.system.Notifier; +import org.wpilib.system.RobotController; /** * Provides an interface for asynchronously reading SparkMax/SparkFlex inputs on a background diff --git a/src/main/java/frc/robot/util/VisionThread.java b/src/main/java/frc/robot/util/VisionThread.java index c841c88..20e364e 100644 --- a/src/main/java/frc/robot/util/VisionThread.java +++ b/src/main/java/frc/robot/util/VisionThread.java @@ -7,7 +7,6 @@ package frc.robot.util; -import org.wpilib.system.Notifier; import frc.robot.subsystems.vision.VisionIO; import frc.robot.subsystems.vision.VisionIO.PoseObservation; import frc.robot.subsystems.vision.VisionIO.TargetObservation; @@ -15,6 +14,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.locks.ReentrantLock; +import org.wpilib.system.Notifier; /** * Provides an interface for asynchronously reading vision inputs on a background thread, avoiding diff --git a/src/test/java/frc/robot/subsystems/vision/VisionFilterTest.java b/src/test/java/frc/robot/subsystems/vision/VisionFilterTest.java index 055fb11..db586da 100644 --- a/src/test/java/frc/robot/subsystems/vision/VisionFilterTest.java +++ b/src/test/java/frc/robot/subsystems/vision/VisionFilterTest.java @@ -2,10 +2,6 @@ import static org.junit.jupiter.api.Assertions.*; -import org.wpilib.math.geometry.Pose2d; -import org.wpilib.math.geometry.Pose3d; -import org.wpilib.math.geometry.Rotation2d; -import org.wpilib.math.geometry.Rotation3d; import frc.robot.subsystems.vision.VisionFilter.FusedObservation; import frc.robot.subsystems.vision.VisionFilter.Test; import frc.robot.subsystems.vision.VisionFilter.TestContext; @@ -17,6 +13,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Pose3d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Rotation3d; class VisionFilterTest { From d910ba4dd6da3a017bc8a202706560fea0daa6d0 Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Thu, 2 Jul 2026 23:50:19 -0400 Subject: [PATCH 29/35] Update CI workflows to JDK 25 for WPILib 2027 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GJF 1.35.0 (required for JDK 25 support) uses JCTree$JCAnyPattern, an internal javac class that was added in JDK 22. The Spotless workflow was pinned to JDK 17 and the simulation build to JDK 21, causing both to crash with NoClassDefFoundError on every Java file. WPILib 2027 targets JDK 25 (sourceCompatibility = VERSION_25), so all CI jobs that invoke the Java toolchain must use JDK 25. The SystemCore build job is unaffected — it uses the WPILib Docker container which already ships JDK 25. --- .github/workflows/build-simulation.yml | 4 ++-- .github/workflows/spotless.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-simulation.yml b/.github/workflows/build-simulation.yml index 042d979..697337c 100644 --- a/.github/workflows/build-simulation.yml +++ b/.github/workflows/build-simulation.yml @@ -10,11 +10,11 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 - - name: Set up JDK 21 + - name: Set up JDK 25 uses: actions/setup-java@v5 with: distribution: temurin - java-version: 21 + java-version: 25 cache: gradle - name: Grant execute permission run: chmod +x gradlew diff --git a/.github/workflows/spotless.yml b/.github/workflows/spotless.yml index 51de4cb..7bbfeec 100644 --- a/.github/workflows/spotless.yml +++ b/.github/workflows/spotless.yml @@ -14,8 +14,8 @@ jobs: fetch-depth: 0 - uses: actions/setup-java@v5 with: - distribution: 'zulu' - java-version: 17 + distribution: 'temurin' + java-version: 25 - name: Change wrapper permissions run: chmod +x ./gradlew - run: ./gradlew spotlessCheck --stacktrace From 331774d5ba7a22eaf37e14a5279a8bf75eeb7b37 Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Fri, 3 Jul 2026 07:51:15 -0400 Subject: [PATCH 30/35] Use Math.clamp() in ModuleIOSimWPI for WPILib 2027 compatibility MathUtil.clamp() was removed in WPILib 2027 (PR #8186). Replace the nested Math.max/min workaround with Java 21's Math.clamp(), which is the upstream-approved replacement. Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java b/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java index d4b23ee..bd821da 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIOSimWPI.java @@ -77,8 +77,8 @@ public void updateInputs(ModuleIOInputs inputs) { // Update simulation state double busVoltage = RoboRioSim.getVInVoltage(); - driveSim.setInputVoltage(Math.max(-busVoltage, Math.min(busVoltage, driveAppliedVolts))); - turnSim.setInputVoltage(Math.max(-busVoltage, Math.min(busVoltage, turnAppliedVolts))); + driveSim.setInputVoltage(Math.clamp(driveAppliedVolts, -busVoltage, busVoltage)); + turnSim.setInputVoltage(Math.clamp(turnAppliedVolts, -busVoltage, busVoltage)); driveSim.update(0.02); turnSim.update(0.02); From 04ff5f2d2a0ba652d85b1e48b2db852842af63db Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Fri, 3 Jul 2026 07:58:48 -0400 Subject: [PATCH 31/35] Fix SparkOdometryThread error detection for REVLib Signal API The previous implementation checked spark.getLastError() after calling encoder.getPosition().get(0.0) via a DoubleSupplier lambda. The Signal object was discarded before the error check, and getLastError() is not updated by Signal access. Switch position/velocity fields to Supplier> so the Signal is retained and checked via signal.isValid(). Apply the same pattern to the direct spark.getAppliedOutput/getBusVoltage/getOutputCurrent calls. Drop the getLastError() check on additionalSuppliers since no callers currently pass Signal-backed suppliers there. Co-Authored-By: Claude Sonnet 4.6 --- .../frc/robot/util/SparkOdometryThread.java | 66 ++++++++----------- 1 file changed, 26 insertions(+), 40 deletions(-) diff --git a/src/main/java/frc/robot/util/SparkOdometryThread.java b/src/main/java/frc/robot/util/SparkOdometryThread.java index eeed7b9..96e009d 100644 --- a/src/main/java/frc/robot/util/SparkOdometryThread.java +++ b/src/main/java/frc/robot/util/SparkOdometryThread.java @@ -8,13 +8,14 @@ package frc.robot.util; import com.revrobotics.AbsoluteEncoder; -import com.revrobotics.REVLibError; import com.revrobotics.RelativeEncoder; import com.revrobotics.spark.SparkBase; +import com.revrobotics.util.Signal; import java.util.ArrayList; import java.util.List; import java.util.concurrent.locks.ReentrantLock; import java.util.function.DoubleSupplier; +import java.util.function.Supplier; import org.wpilib.system.Notifier; import org.wpilib.system.RobotController; @@ -33,8 +34,8 @@ public class SparkOdometryThread { /** Cached inputs for a single SparkMax/SparkFlex device. */ public static class SparkInputs { private final SparkBase spark; - private final DoubleSupplier positionSupplier; - private final DoubleSupplier velocitySupplier; + private final Supplier> positionSignal; + private final Supplier> velocitySignal; private final DoubleSupplier[] additionalSuppliers; // Cached values (volatile for thread safety) @@ -50,18 +51,18 @@ public static class SparkInputs { * Creates SparkInputs for a device. * * @param spark The SparkBase device - * @param positionSupplier Supplier for encoder position - * @param velocitySupplier Supplier for encoder velocity + * @param positionSignal Supplier for encoder position Signal + * @param velocitySignal Supplier for encoder velocity Signal * @param additionalSuppliers Optional additional values to read */ public SparkInputs( SparkBase spark, - DoubleSupplier positionSupplier, - DoubleSupplier velocitySupplier, + Supplier> positionSignal, + Supplier> velocitySignal, DoubleSupplier... additionalSuppliers) { this.spark = spark; - this.positionSupplier = positionSupplier; - this.velocitySupplier = velocitySupplier; + this.positionSignal = positionSignal; + this.velocitySignal = velocitySignal; this.additionalSuppliers = additionalSuppliers; this.additionalValues = new double[additionalSuppliers.length]; } @@ -70,44 +71,37 @@ public SparkInputs( private void update() { boolean ok = true; - double pos = positionSupplier.getAsDouble(); - if (spark.getLastError() == REVLibError.kOk) { - position = pos; + Signal posSig = positionSignal.get(); + if (posSig.isValid()) { + position = posSig.get(); } else { ok = false; } - double vel = velocitySupplier.getAsDouble(); - if (spark.getLastError() == REVLibError.kOk) { - velocity = vel; + Signal velSig = velocitySignal.get(); + if (velSig.isValid()) { + velocity = velSig.get(); } else { ok = false; } - double output = spark.getAppliedOutput().get(0.0); - boolean outputOk = spark.getLastError() == REVLibError.kOk; - double voltage = spark.getBusVoltage().get(0.0); - boolean voltageOk = spark.getLastError() == REVLibError.kOk; - if (outputOk && voltageOk) { - appliedVolts = output * voltage; + Signal outputSig = spark.getAppliedOutput(); + Signal voltageSig = spark.getBusVoltage(); + if (outputSig.isValid() && voltageSig.isValid()) { + appliedVolts = outputSig.get() * voltageSig.get(); } else { ok = false; } - double current = spark.getOutputCurrent().get(0.0); - if (spark.getLastError() == REVLibError.kOk) { - outputCurrent = current; + Signal currentSig = spark.getOutputCurrent(); + if (currentSig.isValid()) { + outputCurrent = currentSig.get(); } else { ok = false; } for (int i = 0; i < additionalSuppliers.length; i++) { - double val = additionalSuppliers[i].getAsDouble(); - if (spark.getLastError() == REVLibError.kOk) { - additionalValues[i] = val; - } else { - ok = false; - } + additionalValues[i] = additionalSuppliers[i].getAsDouble(); } timestamp = RobotController.getTime() / 1e6; @@ -173,11 +167,7 @@ public void start() { public SparkInputs registerSpark( SparkBase spark, RelativeEncoder encoder, DoubleSupplier... additionalSuppliers) { SparkInputs inputs = - new SparkInputs( - spark, - () -> encoder.getPosition().get(0.0), - () -> encoder.getVelocity().get(0.0), - additionalSuppliers); + new SparkInputs(spark, encoder::getPosition, encoder::getVelocity, additionalSuppliers); lock.lock(); try { registeredInputs.add(inputs); @@ -198,11 +188,7 @@ public SparkInputs registerSpark( public SparkInputs registerSpark( SparkBase spark, AbsoluteEncoder encoder, DoubleSupplier... additionalSuppliers) { SparkInputs inputs = - new SparkInputs( - spark, - () -> encoder.getPosition().get(0.0), - () -> encoder.getVelocity().get(0.0), - additionalSuppliers); + new SparkInputs(spark, encoder::getPosition, encoder::getVelocity, additionalSuppliers); lock.lock(); try { registeredInputs.add(inputs); From 6f072dc05cc3ff4afa94921c5dc85528e93d795f Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Fri, 3 Jul 2026 08:10:23 -0400 Subject: [PATCH 32/35] Use DriverStationBackend.JOYSTICK_PORTS instead of hardcoded 6 DriverStation.kJoystickPorts was removed in WPILib 2027. Replace the hardcoded literal with the equivalent constant from the new API. Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/lib/ControllerSelector.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/lib/ControllerSelector.java b/src/main/java/frc/lib/ControllerSelector.java index e5400ec..e213dab 100644 --- a/src/main/java/frc/lib/ControllerSelector.java +++ b/src/main/java/frc/lib/ControllerSelector.java @@ -7,6 +7,7 @@ import org.littletonrobotics.junction.Logger; import org.wpilib.command2.CommandScheduler; import org.wpilib.driverstation.GenericHID; +import org.wpilib.driverstation.internal.DriverStationBackend; /** * Manages the selection and binding of controllers for driver and operator roles as a singleton. @@ -171,7 +172,7 @@ public OperatorConfig( } } - private static final int NUM_CONTROLLER_PORTS = 6; + private static final int NUM_CONTROLLER_PORTS = DriverStationBackend.JOYSTICK_PORTS; private final ControllerConfig[] controllerConfigs; private final GenericHID[] controllers; From c339745253a127cd8558822878f18e281ecd9c5f Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Fri, 3 Jul 2026 08:19:45 -0400 Subject: [PATCH 33/35] Use Timer.getTimestamp() instead of RobotController.getTime() / 1e6 Timer.getTimestamp() returns seconds directly and is the idiomatic equivalent of the raw microsecond RobotController.getTime(). Consistent with how timestamps are read elsewhere in the codebase. Co-Authored-By: Claude Sonnet 4.6 --- .../frc/robot/subsystems/drive/PhoenixOdometryThread.java | 4 ++-- src/main/java/frc/robot/util/CanandgyroThread.java | 4 ++-- src/main/java/frc/robot/util/SparkOdometryThread.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java b/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java index 7b31127..9ec41d2 100644 --- a/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java +++ b/src/main/java/frc/robot/subsystems/drive/PhoenixOdometryThread.java @@ -19,7 +19,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.function.DoubleSupplier; -import org.wpilib.system.RobotController; +import org.wpilib.system.Timer; import org.wpilib.units.measure.Angle; /** @@ -133,7 +133,7 @@ public void run() { // Sample timestamp is current FPGA time minus average CAN latency // Default timestamps from Phoenix are NOT compatible with // FPGA timestamps, this solution is imperfect but close - double timestamp = RobotController.getTime() / 1e6; + double timestamp = Timer.getTimestamp(); double totalLatency = 0.0; for (BaseStatusSignal signal : phoenixSignals) { totalLatency += signal.getTimestamp().getLatency(); diff --git a/src/main/java/frc/robot/util/CanandgyroThread.java b/src/main/java/frc/robot/util/CanandgyroThread.java index a8965e0..f4af46d 100644 --- a/src/main/java/frc/robot/util/CanandgyroThread.java +++ b/src/main/java/frc/robot/util/CanandgyroThread.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.concurrent.locks.ReentrantLock; import org.wpilib.system.Notifier; -import org.wpilib.system.RobotController; +import org.wpilib.system.Timer; /** * Provides an interface for asynchronously reading Canandgyro inputs on a background thread, @@ -47,7 +47,7 @@ private void update() { calibrating = gyro.isCalibrating(); yaw = gyro.getYaw(); angularVelocityYaw = gyro.getAngularVelocityYaw(); - timestamp = RobotController.getTime() / 1e6; + timestamp = Timer.getTimestamp(); } // Getters for cached values (called from main thread) diff --git a/src/main/java/frc/robot/util/SparkOdometryThread.java b/src/main/java/frc/robot/util/SparkOdometryThread.java index 96e009d..16286c6 100644 --- a/src/main/java/frc/robot/util/SparkOdometryThread.java +++ b/src/main/java/frc/robot/util/SparkOdometryThread.java @@ -17,7 +17,7 @@ import java.util.function.DoubleSupplier; import java.util.function.Supplier; import org.wpilib.system.Notifier; -import org.wpilib.system.RobotController; +import org.wpilib.system.Timer; /** * Provides an interface for asynchronously reading SparkMax/SparkFlex inputs on a background @@ -104,7 +104,7 @@ private void update() { additionalValues[i] = additionalSuppliers[i].getAsDouble(); } - timestamp = RobotController.getTime() / 1e6; + timestamp = Timer.getTimestamp(); connected = ok; } From 9dc13e2f7399c865698beb1ede04c0d528f2241f Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Fri, 3 Jul 2026 08:27:45 -0400 Subject: [PATCH 34/35] Replace magic literals with named constants and static imports - Use DriverStationBackend.JOYSTICK_PORTS instead of 6 in Robot.logHIDs() - Static import Units.Hertz in LEDCustomPattern to clean up inline FQN Co-Authored-By: Claude Sonnet 4.6 --- src/main/java/frc/robot/Robot.java | 3 ++- .../java/frc/robot/subsystems/leds/LEDCustomPattern.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 5a90d19..da69678 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -60,6 +60,7 @@ import org.wpilib.command2.button.Trigger; import org.wpilib.driverstation.Alliance; import org.wpilib.driverstation.GenericHID; +import org.wpilib.driverstation.internal.DriverStationBackend; import org.wpilib.framework.RobotBase; import org.wpilib.hardware.power.PowerDistribution.ModuleType; import org.wpilib.math.filter.LinearFilter; @@ -522,7 +523,7 @@ public static long getUSBStorageFreeSpace() { } private static void logHIDs() { - for (int port = 0; port < 6; port++) { + for (int port = 0; port < DriverStationBackend.JOYSTICK_PORTS; port++) { var hid = new GenericHID(port); if (!hid.isConnected()) continue; String prefix = "HID/Port" + port; diff --git a/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java b/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java index dc3f443..dc92470 100644 --- a/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java +++ b/src/main/java/frc/robot/subsystems/leds/LEDCustomPattern.java @@ -7,6 +7,8 @@ package frc.robot.subsystems.leds; +import static org.wpilib.units.Units.Hertz; + import frc.robot.Robot; import java.util.function.BooleanSupplier; import java.util.function.Supplier; @@ -88,8 +90,7 @@ public static LEDPattern scrollingBlocks(Color color) { * @return a scrolling stacked blocks pattern */ public static LEDPattern scrollingBlocks(Color color, int blockSize, int gapSize) { - return stackedBlocks(color, blockSize, gapSize) - .scrollAtRelativeVelocity(org.wpilib.units.Units.Hertz.of(2)); + return stackedBlocks(color, blockSize, gapSize).scrollAtRelativeVelocity(Hertz.of(2)); } /** From 6caab412c8bb6809543d2fa8442233c894334d9e Mon Sep 17 00:00:00 2001 From: Nate Laverdure Date: Fri, 3 Jul 2026 08:39:50 -0400 Subject: [PATCH 35/35] Rename speeds to velocities throughout Drive and DriveCommands ChassisVelocities uses velocity terminology; align local variables, fields, comments, and method names (getMaxLinearSpeedMetersPerSec -> getMaxLinearVelocityMetersPerSec, etc.) to match. Co-Authored-By: Claude Sonnet 4.6 --- .../frc/robot/commands/DriveCommands.java | 70 +++++++++---------- .../frc/robot/subsystems/drive/Drive.java | 50 ++++++------- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/main/java/frc/robot/commands/DriveCommands.java b/src/main/java/frc/robot/commands/DriveCommands.java index 1312cdd..ec4aadc 100644 --- a/src/main/java/frc/robot/commands/DriveCommands.java +++ b/src/main/java/frc/robot/commands/DriveCommands.java @@ -111,20 +111,20 @@ public static Command joystickDrive( // Square rotation value for more precise control omega = Math.copySign(omega * omega, omega); - ChassisVelocities speeds = + ChassisVelocities velocities = new ChassisVelocities( - linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), - linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), - omega * drive.getMaxAngularSpeedRadPerSec()); + linearVelocity.getX() * drive.getMaxLinearVelocityMetersPerSec(), + linearVelocity.getY() * drive.getMaxLinearVelocityMetersPerSec(), + omega * drive.getMaxAngularVelocityRadPerSec()); - // Convert to field relative speeds + // Convert to field relative velocities if (fieldRelativeSupplier.getAsBoolean()) { - speeds = - speeds.toRobotRelative( + velocities = + velocities.toRobotRelative( getDriverRelativeHeading(drive, fieldRotatedSupplier.getAsBoolean())); } - drive.runVelocity(speeds); + drive.runVelocity(velocities); }, drive) .withName("Joystick Drive"); @@ -151,14 +151,14 @@ public static Command fieldRelativeJoystickDrive( // Square rotation value for more precise control omega = Math.copySign(omega * omega, omega); - // Convert to field relative speeds & send command - ChassisVelocities speeds = + // Convert to field relative velocities & send command + ChassisVelocities velocities = new ChassisVelocities( - linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), - linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), - omega * drive.getMaxAngularSpeedRadPerSec()); + linearVelocity.getX() * drive.getMaxLinearVelocityMetersPerSec(), + linearVelocity.getY() * drive.getMaxLinearVelocityMetersPerSec(), + omega * drive.getMaxAngularVelocityRadPerSec()); drive.runVelocity( - speeds.toRobotRelative( + velocities.toRobotRelative( getDriverRelativeHeading(drive, fieldRotatedSupplier.getAsBoolean()))); }, drive) @@ -185,12 +185,12 @@ public static Command robotRelativeJoystickDrive( // Square rotation value for more precise control omega = Math.copySign(omega * omega, omega); - ChassisVelocities speeds = + ChassisVelocities velocities = new ChassisVelocities( - linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), - linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), - omega * drive.getMaxAngularSpeedRadPerSec()); - drive.runVelocity(speeds); + linearVelocity.getX() * drive.getMaxLinearVelocityMetersPerSec(), + linearVelocity.getY() * drive.getMaxLinearVelocityMetersPerSec(), + omega * drive.getMaxAngularVelocityRadPerSec()); + drive.runVelocity(velocities); }, drive) .withName("Robot Relative Joystick Drive"); @@ -224,20 +224,20 @@ public static Command joystickDriveAtFixedOrientation( Translation2d linearVelocity = getLinearVelocityFromJoysticks(xSupplier.getAsDouble(), ySupplier.getAsDouble()); - // Calculate angular speed + // Calculate angular velocity double omega = angleController.calculate( drive.getPose().getRotation().getRadians(), rotationSupplier.get().getRadians()); - // Convert to field relative speeds & send command - ChassisVelocities speeds = + // Convert to field relative velocities & send command + ChassisVelocities velocities = new ChassisVelocities( - linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), - linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), + linearVelocity.getX() * drive.getMaxLinearVelocityMetersPerSec(), + linearVelocity.getY() * drive.getMaxLinearVelocityMetersPerSec(), omega); drive.runVelocity( - speeds.toRobotRelative( + velocities.toRobotRelative( getDriverRelativeHeading(drive, fieldRotatedSupplier.getAsBoolean()))); }, drive) @@ -270,20 +270,20 @@ public static Command joystickDrivePointedForward( Translation2d linearVelocity = getLinearVelocityFromJoysticks(xSupplier.getAsDouble(), ySupplier.getAsDouble()); - // Calculate angular speed + // Calculate angular velocity Rotation2d driverHeading = getDriverRelativeHeading(drive, fieldRotatedSupplier.getAsBoolean()); double omega = angleController.calculate( driverHeading.getRadians(), linearVelocity.getAngle().getRadians()); - // Convert to field relative speeds & send command - ChassisVelocities speeds = + // Convert to field relative velocities & send command + ChassisVelocities velocities = new ChassisVelocities( - linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), - linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), + linearVelocity.getX() * drive.getMaxLinearVelocityMetersPerSec(), + linearVelocity.getY() * drive.getMaxLinearVelocityMetersPerSec(), omega); - drive.runVelocity(speeds.toRobotRelative(driverHeading)); + drive.runVelocity(velocities.toRobotRelative(driverHeading)); }, drive) .withName("Forward Orientated Joystick Drive") @@ -317,13 +317,13 @@ public static Command pointAtTarget( return Commands.run( () -> { - // Calculate angular speed + // Calculate angular velocity double omega = angleController.calculate(yawErrorSupplier.get().getRadians(), 0); - // Convert to field relative speeds & send command - ChassisVelocities speeds = new ChassisVelocities(0, 0, omega); + // Convert to field relative velocities & send command + ChassisVelocities velocities = new ChassisVelocities(0, 0, omega); drive.runVelocity( - speeds.toRobotRelative( + velocities.toRobotRelative( getDriverRelativeHeading(drive, fieldRotatedSupplier.getAsBoolean()))); }, drive) diff --git a/src/main/java/frc/robot/subsystems/drive/Drive.java b/src/main/java/frc/robot/subsystems/drive/Drive.java index b25ea79..6dedf64 100644 --- a/src/main/java/frc/robot/subsystems/drive/Drive.java +++ b/src/main/java/frc/robot/subsystems/drive/Drive.java @@ -75,7 +75,7 @@ public class Drive extends SubsystemBase { private boolean firstVisionEstimate = true; private boolean poseInitialized = false; - private static final ChassisVelocities ZERO_SPEEDS = new ChassisVelocities(); + private static final ChassisVelocities ZERO_VELOCITIES = new ChassisVelocities(); private final SwerveModuleVelocity[] emptyModuleStates = new SwerveModuleVelocity[] {}; // Pre-allocated for getModuleStates()/getModulePositions() to avoid array allocation each call private final SwerveModuleVelocity[] measuredStates = new SwerveModuleVelocity[4]; @@ -87,7 +87,7 @@ public class Drive extends SubsystemBase { new SwerveModulePosition(), new SwerveModulePosition(), new SwerveModulePosition(), new SwerveModulePosition() }; - private ChassisVelocities chassisSpeeds; + private ChassisVelocities chassisVelocities; // PID controllers for following Choreo trajectories private final PIDController xController = new PIDController(8.01, 0.0, 0.0); @@ -208,7 +208,7 @@ public void periodic() { // Apply update visionPose.updateWithTime(sampleTimestamps[i], rawGyroRotation, modulePositions); - chassisSpeeds = kinematics.toChassisVelocities(getModuleStates()); + chassisVelocities = kinematics.toChassisVelocities(getModuleStates()); } long t6 = FeatureFlags.PROFILING_ENABLED ? System.nanoTime() : 0; @@ -244,15 +244,15 @@ public void periodic() { /** * Runs the drive at the desired velocity. * - * @param speeds Speeds in meters/sec + * @param velocities Velocities in meters/sec */ - public void runVelocity(ChassisVelocities speeds) { + public void runVelocity(ChassisVelocities velocities) { - // 1️: Convert continuous speeds to module states - SwerveModuleVelocity[] states = kinematics.toSwerveModuleVelocities(speeds); + // 1️: Convert continuous velocities to module states + SwerveModuleVelocity[] states = kinematics.toSwerveModuleVelocities(velocities); // Log unoptimized setpoints - Logger.recordOutput("SwerveChassisVelocities/Setpoints", speeds); + Logger.recordOutput("SwerveChassisVelocities/Setpoints", velocities); Logger.recordOutput("SwerveStates/Setpoints", states); // 2: Desaturate (apply wheel limits FIRST) @@ -260,14 +260,14 @@ public void runVelocity(ChassisVelocities speeds) { SwerveDriveKinematics.desaturateWheelVelocities( states, DRIVETRAIN_SPEED_LIMIT.in(MetersPerSecond)); - // 3: Reconstruct the ACTUAL chassis speeds after limiting - ChassisVelocities limitedSpeeds = kinematics.toChassisVelocities(states); + // 3: Reconstruct the ACTUAL chassis velocities after limiting + ChassisVelocities limitedVelocities = kinematics.toChassisVelocities(states); - // 4: Now discretize the LIMITED speeds - ChassisVelocities discreteSpeeds = limitedSpeeds.discretize(0.02); + // 4: Now discretize the LIMITED velocities + ChassisVelocities discreteVelocities = limitedVelocities.discretize(0.02); - // 5: Convert discretized speeds back to module states - SwerveModuleVelocity[] finalStates = kinematics.toSwerveModuleVelocities(discreteSpeeds); + // 5: Convert discretized velocities back to module states + SwerveModuleVelocity[] finalStates = kinematics.toSwerveModuleVelocities(discreteVelocities); // (Optional but usually unnecessary) // desaturate again for safety @@ -288,16 +288,16 @@ public void followTrajectory(SwerveSample sample) { // Get the current pose of the robot Pose2d pose = getPose(); - // Generate the next speeds for the robot - ChassisVelocities speeds = + // Generate the next velocities for the robot + ChassisVelocities velocities = new ChassisVelocities( sample.vx + xController.calculate(pose.getX(), sample.x), sample.vy + yController.calculate(pose.getY(), sample.y), sample.omega + headingController.calculate(pose.getRotation().getRadians(), sample.heading)); - // Apply the generated speeds - runVelocity(speeds.toRobotRelative(pose.getRotation())); + // Apply the generated velocities + runVelocity(velocities.toRobotRelative(pose.getRotation())); } /** Runs the drive in a straight line with the specified drive output. */ @@ -309,7 +309,7 @@ public void runCharacterization(double output) { /** Stops the drive. */ public void stop() { - runVelocity(ZERO_SPEEDS); + runVelocity(ZERO_VELOCITIES); } /** @@ -354,10 +354,10 @@ private SwerveModulePosition[] getModulePositions() { return measuredPositions; } - /** Returns the measured chassis speeds of the robot. */ + /** Returns the measured chassis velocities of the robot. */ @AutoLogOutput(key = "SwerveChassisVelocities/Measured") public ChassisVelocities getRobotRelativeChassisVelocities() { - return chassisSpeeds; + return chassisVelocities; } /** Returns the position of each module in radians. */ @@ -418,13 +418,13 @@ public void addVisionMeasurement( visionRobotPoseMeters, timestampSeconds, visionMeasurementStdDevs); } - /** Returns the maximum linear speed in meters per sec. */ - public double getMaxLinearSpeedMetersPerSec() { + /** Returns the maximum linear velocity in meters per sec. */ + public double getMaxLinearVelocityMetersPerSec() { return MAX_CHASSIS_VELOCITY.in(MetersPerSecond); } - /** Returns the maximum angular speed in radians per sec. */ - public double getMaxAngularSpeedRadPerSec() { + /** Returns the maximum angular velocity in radians per sec. */ + public double getMaxAngularVelocityRadPerSec() { return MAX_CHASSIS_ANGULAR_VELOCITY.in(RadiansPerSecond); }