diff --git a/build.gradle b/build.gradle index bbd66d90..b4469696 100644 --- a/build.gradle +++ b/build.gradle @@ -19,19 +19,19 @@ allprojects { maven { url = uri('https://devsite.ctr-electronics.com/maven/release/') } // REV - maven { url = uri('https://www.revrobotics.com/content/sw/max/sdk/maven/') } + maven { url = uri('https://maven.revrobotics.com/') } } } dependencies { - implementation 'edu.wpi.first.wpilibj:wpilibj-java:2021.3.1' + implementation 'edu.wpi.first.wpilibj:wpilibj-java:2022.1.1' // CTRE is implementation because it is not a hard requirement - implementation 'com.ctre.phoenix:api-java:5.19.4' - implementation 'com.ctre.phoenix:wpiapi-java:5.19.4' + implementation 'com.ctre.phoenix:api-java:5.20.2' + implementation 'com.ctre.phoenix:wpiapi-java:5.20.2' // REV is implementation because it is not a hard requirement - implementation 'com.revrobotics.frc:SparkMax-java:1.5.4' + implementation 'com.revrobotics.frc:REVLib-java:2022.1.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' diff --git a/examples/mk3-minibot/build.gradle b/examples/mk3-minibot/build.gradle index 858161f0..bc6e1585 100644 --- a/examples/mk3-minibot/build.gradle +++ b/examples/mk3-minibot/build.gradle @@ -5,7 +5,7 @@ plugins { } application { - mainClassName('com.swervedrivespecialties.examples.mk3minibot.Main') + mainClass.set('com.swervedrivespecialties.examples.mk3minibot.Main') } targetCompatibility = JavaVersion.VERSION_11 @@ -13,31 +13,44 @@ sourceCompatibility = JavaVersion.VERSION_11 deploy { targets { - roboRIO('roborio') { - team frc.getTeamOrDefault(2910) + roborio(getTargetTypeClass('RoboRIO')) { + team = project.frc.getTeamOrDefault(2910) + debug = project.frc.getDebugOrDefault(false) + + artifacts { + frcJava(getArtifactTypeClass('FRCJavaArtifact')) { + jarTask = shadowJar + } + } } } - artifacts { - frcJavaArtifact('frcJava') { - jar 'shadowJar' - targets << 'roborio' +} - debug frc.getDebugOrDefault(false) - } - } +wpi { + sim.addDriverstation() + sim.addGui().defaultEnabled.set(true) + + java.configureExecutableTasks(shadowJar) + java.configureTestTasks(test) } dependencies { - implementation wpi.deps.wpilib() - implementation wpi.deps.vendor.java() + 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) - nativeZip wpi.deps.wpilibJni(wpi.platforms.roborio) - nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio) + roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) + roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) - nativeDesktopZip wpi.deps.wpilibJni(wpi.platforms.desktop) - nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop) + nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) + nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) + simulationDebug wpi.sim.enableDebug() - simulation wpi.deps.sim.gui(wpi.platforms.desktop, false) + nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop) + nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) + simulationRelease wpi.sim.enableRelease() implementation project(':') -} \ No newline at end of file +} diff --git a/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/RobotContainer.java b/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/RobotContainer.java index fcb5fee8..bf6fc71c 100644 --- a/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/RobotContainer.java +++ b/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/RobotContainer.java @@ -16,9 +16,9 @@ public RobotContainer() { drivetrain.setDefaultCommand(new DriveCommand( drivetrain, - () -> -modifyAxis(controller.getY(GenericHID.Hand.kLeft)), // Axes are flipped here on purpose - () -> -modifyAxis(controller.getX(GenericHID.Hand.kLeft)), - () -> -modifyAxis(controller.getX(GenericHID.Hand.kRight)) + () -> -modifyAxis(controller.getLeftY()), // Axes are flipped here on purpose + () -> -modifyAxis(controller.getLeftX()), + () -> -modifyAxis(controller.getRightX()) )); new Button(controller::getBackButtonPressed) diff --git a/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/commands/DriveCommand.java b/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/commands/DriveCommand.java index 223dc3ca..749f56c7 100644 --- a/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/commands/DriveCommand.java +++ b/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/commands/DriveCommand.java @@ -1,7 +1,7 @@ package com.swervedrivespecialties.examples.mk3minibot.commands; import com.swervedrivespecialties.examples.mk3minibot.subsystems.DrivetrainSubsystem; -import edu.wpi.first.wpilibj.kinematics.ChassisSpeeds; +import edu.wpi.first.math.kinematics.ChassisSpeeds; import edu.wpi.first.wpilibj2.command.CommandBase; import java.util.function.DoubleSupplier; diff --git a/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/subsystems/DrivetrainSubsystem.java b/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/subsystems/DrivetrainSubsystem.java index 2924841d..697a008b 100644 --- a/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/subsystems/DrivetrainSubsystem.java +++ b/examples/mk3-minibot/src/main/java/com/swervedrivespecialties/examples/mk3minibot/subsystems/DrivetrainSubsystem.java @@ -4,13 +4,13 @@ import com.swervedrivespecialties.examples.mk3minibot.Constants; import com.swervedrivespecialties.swervelib.Mk3SwerveModuleHelper; import com.swervedrivespecialties.swervelib.SwerveModule; -import edu.wpi.first.wpilibj.geometry.Pose2d; -import edu.wpi.first.wpilibj.geometry.Rotation2d; -import edu.wpi.first.wpilibj.geometry.Translation2d; -import edu.wpi.first.wpilibj.kinematics.ChassisSpeeds; -import edu.wpi.first.wpilibj.kinematics.SwerveDriveKinematics; -import edu.wpi.first.wpilibj.kinematics.SwerveDriveOdometry; -import edu.wpi.first.wpilibj.kinematics.SwerveModuleState; +import edu.wpi.first.math.geometry.Pose2d; +import edu.wpi.first.math.geometry.Rotation2d; +import edu.wpi.first.math.geometry.Translation2d; +import edu.wpi.first.math.kinematics.ChassisSpeeds; +import edu.wpi.first.math.kinematics.SwerveDriveKinematics; +import edu.wpi.first.math.kinematics.SwerveDriveOdometry; +import edu.wpi.first.math.kinematics.SwerveModuleState; import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; diff --git a/examples/mk3-minibot/vendordeps/Phoenix.json b/examples/mk3-minibot/vendordeps/Phoenix.json index 51732427..789d831f 100644 --- a/examples/mk3-minibot/vendordeps/Phoenix.json +++ b/examples/mk3-minibot/vendordeps/Phoenix.json @@ -1,214 +1,257 @@ { - "fileName": "Phoenix.json", - "name": "CTRE-Phoenix", - "version": "5.19.4", - "uuid": "ab676553-b602-441f-a38d-f1296eff6537", - "mavenUrls": [ - "https://devsite.ctr-electronics.com/maven/release/" - ], - "jsonUrl": "https://devsite.ctr-electronics.com/maven/release/com/ctre/phoenix/Phoenix-latest.json", - "javaDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-java", - "version": "5.19.4" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-java", - "version": "5.19.4" - } - ], - "jniDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.19.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "linuxathena" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "cci-sim", - "version": "5.19.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "simTalonSRX", - "version": "5.19.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "simVictorSPX", - "version": "5.19.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - } - ], - "cppDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-cpp", - "version": "5.19.4", - "libName": "CTRE_Phoenix_WPI", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-cpp", - "version": "5.19.4", - "libName": "CTRE_Phoenix", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.19.4", - "libName": "CTRE_PhoenixCCI", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "cci-sim", - "version": "5.19.4", - "libName": "CTRE_PhoenixCCISim", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "diagnostics", - "version": "5.19.4", - "libName": "CTRE_PhoenixDiagnostics", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "canutils", - "version": "5.19.4", - "libName": "CTRE_PhoenixCanutils", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "platform-sim", - "version": "5.19.4", - "libName": "CTRE_PhoenixPlatform", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "core", - "version": "5.19.4", - "libName": "CTRE_PhoenixCore", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "simTalonSRX", - "version": "5.19.4", - "libName": "CTRE_SimTalonSRX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "simVictorSPX", - "version": "5.19.4", - "libName": "CTRE_SimVictorSPX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - } - ] + "fileName": "Phoenix.json", + "name": "CTRE-Phoenix", + "version": "5.20.2", + "frcYear": 2022, + "uuid": "ab676553-b602-441f-a38d-f1296eff6537", + "mavenUrls": [ + "https://maven.ctr-electronics.com/release/" + ], + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix-frc2022-latest.json", + "javaDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-java", + "version": "5.20.2" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-java", + "version": "5.20.2" + } + ], + "jniDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "cci-sim", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonSRX", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonFX", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simVictorSPX", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simPigeonIMU", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simCANCoder", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-cpp", + "version": "5.20.2", + "libName": "CTRE_Phoenix_WPI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-cpp", + "version": "5.20.2", + "libName": "CTRE_Phoenix", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.20.2", + "libName": "CTRE_PhoenixCCI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "wpiapi-cpp-sim", + "version": "5.20.2", + "libName": "CTRE_Phoenix_WPISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "api-cpp-sim", + "version": "5.20.2", + "libName": "CTRE_PhoenixSim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "cci-sim", + "version": "5.20.2", + "libName": "CTRE_PhoenixCCISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonSRX", + "version": "5.20.2", + "libName": "CTRE_SimTalonSRX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonFX", + "version": "5.20.2", + "libName": "CTRE_SimTalonFX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simVictorSPX", + "version": "5.20.2", + "libName": "CTRE_SimVictorSPX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simPigeonIMU", + "version": "5.20.2", + "libName": "CTRE_SimPigeonIMU", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simCANCoder", + "version": "5.20.2", + "libName": "CTRE_SimCANCoder", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + } + ] } \ No newline at end of file diff --git a/examples/mk3-minibot/vendordeps/REVLib.json b/examples/mk3-minibot/vendordeps/REVLib.json new file mode 100644 index 00000000..2e28e022 --- /dev/null +++ b/examples/mk3-minibot/vendordeps/REVLib.json @@ -0,0 +1,73 @@ +{ + "fileName": "REVLib.json", + "name": "REVLib", + "version": "2022.1.0", + "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", + "mavenUrls": [ + "https://maven.revrobotics.com/" + ], + "jsonUrl": "https://software-metadata.revrobotics.com/REVLib.json", + "javaDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-java", + "version": "2022.1.0" + } + ], + "jniDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2022.1.0", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxaarch64bionic", + "linuxx86-64", + "linuxathena", + "linuxraspbian", + "osxx86-64" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-cpp", + "version": "2022.1.0", + "libName": "REVLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxaarch64bionic", + "linuxx86-64", + "linuxathena", + "linuxraspbian", + "osxx86-64" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2022.1.0", + "libName": "REVLibDriver", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxaarch64bionic", + "linuxx86-64", + "linuxathena", + "linuxraspbian", + "osxx86-64" + ] + } + ] +} \ No newline at end of file diff --git a/examples/mk3-minibot/vendordeps/REVRobotics.json b/examples/mk3-minibot/vendordeps/REVRobotics.json deleted file mode 100644 index 328ee837..00000000 --- a/examples/mk3-minibot/vendordeps/REVRobotics.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "cppDependencies": [ - { - "artifactId": "SparkMax-cpp", - "binaryPlatforms": [ - "windowsx86-64", - "windowsx86", - "linuxaarch64bionic", - "linuxx86-64", - "linuxathena", - "linuxraspbian", - "osxx86-64" - ], - "groupId": "com.revrobotics.frc", - "headerClassifier": "headers", - "libName": "SparkMax", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "version": "1.5.4" - }, - { - "artifactId": "SparkMax-driver", - "binaryPlatforms": [ - "windowsx86-64", - "windowsx86", - "linuxaarch64bionic", - "linuxx86-64", - "linuxathena", - "linuxraspbian", - "osxx86-64" - ], - "groupId": "com.revrobotics.frc", - "headerClassifier": "headers", - "libName": "SparkMaxDriver", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "version": "1.5.4" - } - ], - "fileName": "REVRobotics.json", - "javaDependencies": [ - { - "artifactId": "SparkMax-java", - "groupId": "com.revrobotics.frc", - "version": "1.5.4" - } - ], - "jniDependencies": [ - { - "artifactId": "SparkMax-driver", - "groupId": "com.revrobotics.frc", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "windowsx86", - "linuxaarch64bionic", - "linuxx86-64", - "linuxathena", - "linuxraspbian", - "osxx86-64" - ], - "version": "1.5.4" - } - ], - "jsonUrl": "https://www.revrobotics.com/content/sw/max/sdk/REVRobotics.json", - "mavenUrls": [ - "https://www.revrobotics.com/content/sw/max/sdk/maven/" - ], - "name": "REVRobotics", - "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", - "version": "1.5.4" -} diff --git a/examples/mk3-testchassis/build.gradle b/examples/mk3-testchassis/build.gradle index 2aa8e1a4..e0b55fae 100644 --- a/examples/mk3-testchassis/build.gradle +++ b/examples/mk3-testchassis/build.gradle @@ -5,7 +5,7 @@ plugins { } application { - mainClassName('com.swervedrivespecialties.examples.mk3testchassis.Main') + mainClass.set('com.swervedrivespecialties.examples.mk3testchassis.Main') } targetCompatibility = JavaVersion.VERSION_11 @@ -13,31 +13,44 @@ sourceCompatibility = JavaVersion.VERSION_11 deploy { targets { - roboRIO('roborio') { - team frc.getTeamOrDefault(2910) + roborio(getTargetTypeClass('RoboRIO')) { + team = project.frc.getTeamOrDefault(2910) + debug = project.frc.getDebugOrDefault(false) + + artifacts { + frcJava(getArtifactTypeClass('FRCJavaArtifact')) { + jarTask = shadowJar + } + } } } - artifacts { - frcJavaArtifact('frcJava') { - jar 'shadowJar' - targets << 'roborio' +} - debug frc.getDebugOrDefault(false) - } - } +wpi { + sim.addDriverstation() + sim.addGui().defaultEnabled.set(true) + + java.configureExecutableTasks(shadowJar) + java.configureTestTasks(test) } dependencies { - implementation wpi.deps.wpilib() - implementation wpi.deps.vendor.java() + 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) - nativeZip wpi.deps.wpilibJni(wpi.platforms.roborio) - nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio) + roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) + roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) - nativeDesktopZip wpi.deps.wpilibJni(wpi.platforms.desktop) - nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop) + nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) + nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) + simulationDebug wpi.sim.enableDebug() - simulation wpi.deps.sim.gui(wpi.platforms.desktop, false) + nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop) + nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) + simulationRelease wpi.sim.enableRelease() implementation project(':') -} \ No newline at end of file +} diff --git a/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/RobotContainer.java b/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/RobotContainer.java index bc925a55..2535f070 100644 --- a/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/RobotContainer.java +++ b/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/RobotContainer.java @@ -16,9 +16,9 @@ public RobotContainer() { drivetrain.setDefaultCommand(new DriveCommand( drivetrain, - () -> -modifyAxis(controller.getY(GenericHID.Hand.kLeft)), // Axes are flipped here on purpose - () -> -modifyAxis(controller.getX(GenericHID.Hand.kLeft)), - () -> -modifyAxis(controller.getX(GenericHID.Hand.kRight)) + () -> -modifyAxis(controller.getLeftY()), // Axes are flipped here on purpose + () -> -modifyAxis(controller.getLeftX()), + () -> -modifyAxis(controller.getRightX()) )); new Button(controller::getBackButtonPressed) diff --git a/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/commands/DriveCommand.java b/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/commands/DriveCommand.java index 4e32bc55..264c1610 100644 --- a/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/commands/DriveCommand.java +++ b/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/commands/DriveCommand.java @@ -1,7 +1,7 @@ package com.swervedrivespecialties.examples.mk3testchassis.commands; import com.swervedrivespecialties.examples.mk3testchassis.subsystems.DrivetrainSubsystem; -import edu.wpi.first.wpilibj.kinematics.ChassisSpeeds; +import edu.wpi.first.math.kinematics.ChassisSpeeds; import edu.wpi.first.wpilibj2.command.CommandBase; import java.util.function.DoubleSupplier; diff --git a/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/subsystems/DrivetrainSubsystem.java b/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/subsystems/DrivetrainSubsystem.java index 2eef9e05..fe209c28 100644 --- a/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/subsystems/DrivetrainSubsystem.java +++ b/examples/mk3-testchassis/src/main/java/com/swervedrivespecialties/examples/mk3testchassis/subsystems/DrivetrainSubsystem.java @@ -4,13 +4,13 @@ import com.swervedrivespecialties.examples.mk3testchassis.Constants; import com.swervedrivespecialties.swervelib.Mk3SwerveModuleHelper; import com.swervedrivespecialties.swervelib.SwerveModule; -import edu.wpi.first.wpilibj.geometry.Pose2d; -import edu.wpi.first.wpilibj.geometry.Rotation2d; -import edu.wpi.first.wpilibj.geometry.Translation2d; -import edu.wpi.first.wpilibj.kinematics.ChassisSpeeds; -import edu.wpi.first.wpilibj.kinematics.SwerveDriveKinematics; -import edu.wpi.first.wpilibj.kinematics.SwerveDriveOdometry; -import edu.wpi.first.wpilibj.kinematics.SwerveModuleState; +import edu.wpi.first.math.geometry.Pose2d; +import edu.wpi.first.math.geometry.Rotation2d; +import edu.wpi.first.math.geometry.Translation2d; +import edu.wpi.first.math.kinematics.ChassisSpeeds; +import edu.wpi.first.math.kinematics.SwerveDriveKinematics; +import edu.wpi.first.math.kinematics.SwerveDriveOdometry; +import edu.wpi.first.math.kinematics.SwerveModuleState; import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; diff --git a/examples/mk3-testchassis/vendordeps/Phoenix.json b/examples/mk3-testchassis/vendordeps/Phoenix.json index 51732427..789d831f 100644 --- a/examples/mk3-testchassis/vendordeps/Phoenix.json +++ b/examples/mk3-testchassis/vendordeps/Phoenix.json @@ -1,214 +1,257 @@ { - "fileName": "Phoenix.json", - "name": "CTRE-Phoenix", - "version": "5.19.4", - "uuid": "ab676553-b602-441f-a38d-f1296eff6537", - "mavenUrls": [ - "https://devsite.ctr-electronics.com/maven/release/" - ], - "jsonUrl": "https://devsite.ctr-electronics.com/maven/release/com/ctre/phoenix/Phoenix-latest.json", - "javaDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-java", - "version": "5.19.4" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-java", - "version": "5.19.4" - } - ], - "jniDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.19.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "linuxathena" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "cci-sim", - "version": "5.19.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "simTalonSRX", - "version": "5.19.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "simVictorSPX", - "version": "5.19.4", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - } - ], - "cppDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-cpp", - "version": "5.19.4", - "libName": "CTRE_Phoenix_WPI", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-cpp", - "version": "5.19.4", - "libName": "CTRE_Phoenix", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.19.4", - "libName": "CTRE_PhoenixCCI", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "cci-sim", - "version": "5.19.4", - "libName": "CTRE_PhoenixCCISim", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "diagnostics", - "version": "5.19.4", - "libName": "CTRE_PhoenixDiagnostics", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "canutils", - "version": "5.19.4", - "libName": "CTRE_PhoenixCanutils", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "platform-sim", - "version": "5.19.4", - "libName": "CTRE_PhoenixPlatform", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "core", - "version": "5.19.4", - "libName": "CTRE_PhoenixCore", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "simTalonSRX", - "version": "5.19.4", - "libName": "CTRE_SimTalonSRX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "simVictorSPX", - "version": "5.19.4", - "libName": "CTRE_SimVictorSPX", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxx86-64" - ] - } - ] + "fileName": "Phoenix.json", + "name": "CTRE-Phoenix", + "version": "5.20.2", + "frcYear": 2022, + "uuid": "ab676553-b602-441f-a38d-f1296eff6537", + "mavenUrls": [ + "https://maven.ctr-electronics.com/release/" + ], + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix-frc2022-latest.json", + "javaDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-java", + "version": "5.20.2" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-java", + "version": "5.20.2" + } + ], + "jniDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "cci-sim", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonSRX", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonFX", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simVictorSPX", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simPigeonIMU", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simCANCoder", + "version": "5.20.2", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-cpp", + "version": "5.20.2", + "libName": "CTRE_Phoenix_WPI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-cpp", + "version": "5.20.2", + "libName": "CTRE_Phoenix", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.20.2", + "libName": "CTRE_PhoenixCCI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "wpiapi-cpp-sim", + "version": "5.20.2", + "libName": "CTRE_Phoenix_WPISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "api-cpp-sim", + "version": "5.20.2", + "libName": "CTRE_PhoenixSim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "cci-sim", + "version": "5.20.2", + "libName": "CTRE_PhoenixCCISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonSRX", + "version": "5.20.2", + "libName": "CTRE_SimTalonSRX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonFX", + "version": "5.20.2", + "libName": "CTRE_SimTalonFX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simVictorSPX", + "version": "5.20.2", + "libName": "CTRE_SimVictorSPX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simPigeonIMU", + "version": "5.20.2", + "libName": "CTRE_SimPigeonIMU", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simCANCoder", + "version": "5.20.2", + "libName": "CTRE_SimCANCoder", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + } + ] } \ No newline at end of file diff --git a/examples/mk3-testchassis/vendordeps/REVLib.json b/examples/mk3-testchassis/vendordeps/REVLib.json new file mode 100644 index 00000000..2e28e022 --- /dev/null +++ b/examples/mk3-testchassis/vendordeps/REVLib.json @@ -0,0 +1,73 @@ +{ + "fileName": "REVLib.json", + "name": "REVLib", + "version": "2022.1.0", + "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", + "mavenUrls": [ + "https://maven.revrobotics.com/" + ], + "jsonUrl": "https://software-metadata.revrobotics.com/REVLib.json", + "javaDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-java", + "version": "2022.1.0" + } + ], + "jniDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2022.1.0", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxaarch64bionic", + "linuxx86-64", + "linuxathena", + "linuxraspbian", + "osxx86-64" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-cpp", + "version": "2022.1.0", + "libName": "REVLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxaarch64bionic", + "linuxx86-64", + "linuxathena", + "linuxraspbian", + "osxx86-64" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2022.1.0", + "libName": "REVLibDriver", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxaarch64bionic", + "linuxx86-64", + "linuxathena", + "linuxraspbian", + "osxx86-64" + ] + } + ] +} \ No newline at end of file diff --git a/examples/mk3-testchassis/vendordeps/REVRobotics.json b/examples/mk3-testchassis/vendordeps/REVRobotics.json deleted file mode 100644 index 328ee837..00000000 --- a/examples/mk3-testchassis/vendordeps/REVRobotics.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "cppDependencies": [ - { - "artifactId": "SparkMax-cpp", - "binaryPlatforms": [ - "windowsx86-64", - "windowsx86", - "linuxaarch64bionic", - "linuxx86-64", - "linuxathena", - "linuxraspbian", - "osxx86-64" - ], - "groupId": "com.revrobotics.frc", - "headerClassifier": "headers", - "libName": "SparkMax", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "version": "1.5.4" - }, - { - "artifactId": "SparkMax-driver", - "binaryPlatforms": [ - "windowsx86-64", - "windowsx86", - "linuxaarch64bionic", - "linuxx86-64", - "linuxathena", - "linuxraspbian", - "osxx86-64" - ], - "groupId": "com.revrobotics.frc", - "headerClassifier": "headers", - "libName": "SparkMaxDriver", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "version": "1.5.4" - } - ], - "fileName": "REVRobotics.json", - "javaDependencies": [ - { - "artifactId": "SparkMax-java", - "groupId": "com.revrobotics.frc", - "version": "1.5.4" - } - ], - "jniDependencies": [ - { - "artifactId": "SparkMax-driver", - "groupId": "com.revrobotics.frc", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "windowsx86", - "linuxaarch64bionic", - "linuxx86-64", - "linuxathena", - "linuxraspbian", - "osxx86-64" - ], - "version": "1.5.4" - } - ], - "jsonUrl": "https://www.revrobotics.com/content/sw/max/sdk/REVRobotics.json", - "mavenUrls": [ - "https://www.revrobotics.com/content/sw/max/sdk/maven/" - ], - "name": "REVRobotics", - "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", - "version": "1.5.4" -} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c0..7454180f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index be52383e..2e6e5897 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index 4f906e0c..1b6c7873 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,95 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 107acd32..ac1b06f9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle index bcc37a55..08a93faf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,7 +1,7 @@ pluginManagement { plugins { - id 'com.github.johnrengelman.shadow' version '5.2.0' - id 'edu.wpi.first.GradleRIO' version '2021.3.1' + id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'edu.wpi.first.GradleRIO' version '2022.1.1' } } diff --git a/src/main/java/com/swervedrivespecialties/swervelib/rev/NeoDriveControllerFactoryBuilder.java b/src/main/java/com/swervedrivespecialties/swervelib/rev/NeoDriveControllerFactoryBuilder.java index 21376925..a89a8c40 100644 --- a/src/main/java/com/swervedrivespecialties/swervelib/rev/NeoDriveControllerFactoryBuilder.java +++ b/src/main/java/com/swervedrivespecialties/swervelib/rev/NeoDriveControllerFactoryBuilder.java @@ -1,8 +1,8 @@ package com.swervedrivespecialties.swervelib.rev; -import com.revrobotics.CANEncoder; import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkMaxLowLevel; +import com.revrobotics.RelativeEncoder; import com.swervedrivespecialties.swervelib.DriveController; import com.swervedrivespecialties.swervelib.DriveControllerFactory; import com.swervedrivespecialties.swervelib.ModuleConfiguration; @@ -57,7 +57,7 @@ public ControllerImplementation create(Integer id, ModuleConfiguration moduleCon motor.setIdleMode(CANSparkMax.IdleMode.kBrake); // Setup encoder - CANEncoder encoder = motor.getEncoder(); + RelativeEncoder encoder = motor.getEncoder(); double positionConversionFactor = Math.PI * moduleConfiguration.getWheelDiameter() * moduleConfiguration.getDriveReduction(); encoder.setPositionConversionFactor(positionConversionFactor); encoder.setVelocityConversionFactor(positionConversionFactor / 60.0); @@ -68,9 +68,9 @@ public ControllerImplementation create(Integer id, ModuleConfiguration moduleCon private static class ControllerImplementation implements DriveController { private final CANSparkMax motor; - private final CANEncoder encoder; + private final RelativeEncoder encoder; - private ControllerImplementation(CANSparkMax motor, CANEncoder encoder) { + private ControllerImplementation(CANSparkMax motor, RelativeEncoder encoder) { this.motor = motor; this.encoder = encoder; } diff --git a/src/main/java/com/swervedrivespecialties/swervelib/rev/NeoSteerControllerFactoryBuilder.java b/src/main/java/com/swervedrivespecialties/swervelib/rev/NeoSteerControllerFactoryBuilder.java index a8e86096..41e6fa63 100644 --- a/src/main/java/com/swervedrivespecialties/swervelib/rev/NeoSteerControllerFactoryBuilder.java +++ b/src/main/java/com/swervedrivespecialties/swervelib/rev/NeoSteerControllerFactoryBuilder.java @@ -78,12 +78,12 @@ public ControllerImplementation create(NeoSteerConfiguration steerConfigurati checkNeoError(motor.setSmartCurrentLimit((int) Math.round(currentLimit)), "Failed to set NEO current limits"); } - CANEncoder integratedEncoder = motor.getEncoder(); + RelativeEncoder integratedEncoder = motor.getEncoder(); checkNeoError(integratedEncoder.setPositionConversionFactor(2.0 * Math.PI * moduleConfiguration.getSteerReduction()), "Failed to set NEO encoder conversion factor"); checkNeoError(integratedEncoder.setVelocityConversionFactor(2.0 * Math.PI * moduleConfiguration.getSteerReduction() / 60.0), "Failed to set NEO encoder conversion factor"); checkNeoError(integratedEncoder.setPosition(absoluteEncoder.getAbsoluteAngle()), "Failed to set NEO encoder position"); - CANPIDController controller = motor.getPIDController(); + SparkMaxPIDController controller = motor.getPIDController(); if (hasPidConstants()) { checkNeoError(controller.setP(pidProportional), "Failed to set NEO PID proportional constant"); checkNeoError(controller.setI(pidIntegral), "Failed to set NEO PID integral constant"); @@ -101,8 +101,8 @@ public static class ControllerImplementation implements SteerController { @SuppressWarnings({"FieldCanBeLocal", "unused"}) private final CANSparkMax motor; - private final CANPIDController controller; - private final CANEncoder motorEncoder; + private final SparkMaxPIDController controller; + private final RelativeEncoder motorEncoder; private final AbsoluteEncoder absoluteEncoder; private double referenceAngleRadians = 0; @@ -154,7 +154,7 @@ public void setReferenceAngle(double referenceAngleRadians) { this.referenceAngleRadians = referenceAngleRadians; - controller.setReference(adjustedReferenceAngleRadians, ControlType.kPosition); + controller.setReference(adjustedReferenceAngleRadians, CANSparkMax.ControlType.kPosition); } @Override diff --git a/src/main/java/com/swervedrivespecialties/swervelib/rev/RevUtils.java b/src/main/java/com/swervedrivespecialties/swervelib/rev/RevUtils.java index 2b735049..8acc161f 100644 --- a/src/main/java/com/swervedrivespecialties/swervelib/rev/RevUtils.java +++ b/src/main/java/com/swervedrivespecialties/swervelib/rev/RevUtils.java @@ -1,12 +1,12 @@ package com.swervedrivespecialties.swervelib.rev; -import com.revrobotics.CANError; +import com.revrobotics.REVLibError; public final class RevUtils { private RevUtils() {} - public static void checkNeoError(CANError error, String message) { - if (error != CANError.kOk) { + public static void checkNeoError(REVLibError error, String message) { + if (error != REVLibError.kOk) { throw new RuntimeException(String.format("%s: %s", message, error.toString())); } } diff --git a/src/test/java/com/swervedrivespecialties/swervelib/rev/RevUtilsTest.java b/src/test/java/com/swervedrivespecialties/swervelib/rev/RevUtilsTest.java index 25af6dde..fc9f2d9b 100644 --- a/src/test/java/com/swervedrivespecialties/swervelib/rev/RevUtilsTest.java +++ b/src/test/java/com/swervedrivespecialties/swervelib/rev/RevUtilsTest.java @@ -1,6 +1,6 @@ package com.swervedrivespecialties.swervelib.rev; -import com.revrobotics.CANError; +import com.revrobotics.REVLibError; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; @@ -9,8 +9,8 @@ class RevUtilsTest { @Test void checkNeoError() { - assertThrows(RuntimeException.class, () -> RevUtils.checkNeoError(CANError.kError, "")); - assertThrows(RuntimeException.class, () -> RevUtils.checkNeoError(CANError.kCantFindFirmware, "")); - assertDoesNotThrow(() -> RevUtils.checkNeoError(CANError.kOk, "")); + assertThrows(RuntimeException.class, () -> RevUtils.checkNeoError(REVLibError.kError, "")); + assertThrows(RuntimeException.class, () -> RevUtils.checkNeoError(REVLibError.kCantFindFirmware, "")); + assertDoesNotThrow(() -> RevUtils.checkNeoError(REVLibError.kOk, "")); } }