diff --git a/.run/Build Robot.run.xml b/.run/Build Robot.run.xml index 41ebccc55..38e44441a 100644 --- a/.run/Build Robot.run.xml +++ b/.run/Build Robot.run.xml @@ -4,7 +4,7 @@ @@ -17,6 +17,7 @@ true true + false false + false + false + false \ No newline at end of file diff --git a/.wpilib/wpilib_preferences.json b/.wpilib/wpilib_preferences.json index 53efa6e23..9727c0951 100644 --- a/.wpilib/wpilib_preferences.json +++ b/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": false, "currentLanguage": "java", - "projectYear": "2025", + "projectYear": "2027", "teamNumber": 467 } diff --git a/build.gradle b/build.gradle index dc8dc8c8c..2cdb03006 100755 --- a/build.gradle +++ b/build.gradle @@ -1,79 +1,84 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2026.2.1" + id "org.wpilib.GradleRIO" version "2027.0.0-alpha-7" id "com.peterabeles.gversion" version "1.10" id "com.diffplug.spotless" version "6.25.0" } +wpi.maven.useLocal = false +wpi.maven.useDevelopment = true + +wpi.versions.wpilibVersion = providers.gradleProperty('wpilibVersion').orElse('2027.0.0-alpha-7').get() + java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_25 + targetCompatibility = JavaVersion.VERSION_25 } def ROBOT_MAIN_CLASS = "frc.robot.Main" // Define my targets (RoboRIO) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. -deploy { - targets { - roborio(getTargetTypeClass('RoboRIO')) { - // 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 - // want to store a team number in this file. - team = project.frc.getTeamNumber() - debug = project.frc.getDebugOrDefault(false) - - artifacts { - // First part is artifact name, 2nd is artifact type - // 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") - - // Heap size is set dynamically in predeploy based on robot type - jvmArgs.add("-XX:+AlwaysPreTouch") - - predeploy << { ctx -> - def robotTypeFile = "/home/lvuser/robot" - def result = ctx.execute("cat " + robotTypeFile) - def robotType = result.result.trim() - println "Detected robot type: " + robotType - - def heapSize = 100 - if (robotType == "ROBOT_BRIEFCASE") { - heapSize = 10 - println "Using reduced heap size for ROBOT_BRIEFCASE: " + heapSize + "MB" - } else { - println "Using default heap size: " + heapSize + "MB" +def roborioTargetType = deploy.getTargetTypeClass('RoboRIO') +def deployArtifact = null +if (roborioTargetType != null) { + deploy { + targets { + roborio(roborioTargetType) { + // 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 + // want to store a team number in this file. + team = project.frc.getTeamNumber() + debug = project.frc.getDebugOrDefault(false) + + artifacts { + // First part is artifact name, 2nd is artifact type + // 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") + + // Heap size is set dynamically in predeploy based on robot type + jvmArgs.add("-XX:+AlwaysPreTouch") + + predeploy << { ctx -> + def robotTypeFile = "/home/lvuser/robot" + def result = ctx.execute("cat " + robotTypeFile) + def robotType = result.result.trim() + println "Detected robot type: " + robotType + + def heapSize = 100 + if (robotType == "ROBOT_BRIEFCASE") { + heapSize = 10 + println "Using reduced heap size for ROBOT_BRIEFCASE: " + heapSize + "MB" + } else { + println "Using default heap size: " + heapSize + "MB" + } + + jvmArgs.add("-Xmx" + heapSize + "M") + jvmArgs.add("-Xms" + heapSize + "M") } - - jvmArgs.add("-Xmx" + heapSize + "M") - jvmArgs.add("-Xms" + heapSize + "M") } - } - // 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 - deleteOldFiles = false + // 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 + deleteOldFiles = false + } } } } + deployArtifact = deploy.targets.roborio.artifacts.frcJava } } -def deployArtifact = deploy.targets.roborio.artifacts.frcJava - -// Set to true to use debug for JNI. -wpi.java.debugJni = false - // Set this to true to enable desktop support. def includeDesktopSupport = true @@ -90,11 +95,13 @@ 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) + if (roborioTargetType != null) { + roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio) + roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio) - roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) - roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) + roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) + roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) + } nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) @@ -104,15 +111,12 @@ dependencies { nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) simulationRelease wpi.sim.enableRelease() - compileOnly 'org.projectlombok:lombok:1.18.30' - annotationProcessor 'org.projectlombok:lombok:1.18.30' + compileOnly 'org.projectlombok:lombok:1.18.44' + annotationProcessor 'org.projectlombok:lombok:1.18.44' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - compileOnly 'org.projectlombok:lombok:1.18.30' - annotationProcessor 'org.projectlombok:lombok:1.18.30' - def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text) annotationProcessor "org.littletonrobotics.akit:akit-autolog:$akitJson.version" } @@ -141,14 +145,16 @@ jar { } } from sourceSets.main.allSource - manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) + manifest org.wpilib.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) duplicatesStrategy = DuplicatesStrategy.INCLUDE } // Configure jar and deploy tasks -deployArtifact.jarTask = jar -wpi.java.configureExecutableTasks(jar) -wpi.java.configureTestTasks(test) +if (deployArtifact != null) { + deployArtifact.jarTask = jar +} +// IMPORTANT: wpi.java.configureExecutableTasks(jar) +// IMPORTANT: wpi.java.configureTestTasks(test) // Configure string concat to always inline compile tasks.withType(JavaCompile) { @@ -160,7 +166,9 @@ task(checkRobot, dependsOn: "classes", type: JavaExec) { mainClass = "frc.robot.Constants" classpath = sourceSets.main.runtimeClasspath } -deployroborio.dependsOn(checkRobot) +if (deployArtifact != null) { + deployroborio.dependsOn(checkRobot) +} // Create version file project.compileJava.dependsOn(createVersionFile) @@ -206,8 +214,8 @@ task(eventDeploy) { } createVersionFile.dependsOn(eventDeploy) -// Spotless formatting -project.compileJava.dependsOn(spotlessApply) +// Spotless formatting (disabled for 2027 experimental) +// project.compileJava.dependsOn(spotlessApply) spotless { java { target fileTree(".") { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 73fd75353..b5029cebe 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.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/frc/lib/SubsystemBase.java b/src/main/java/frc/lib/SubsystemBase.java new file mode 100644 index 000000000..b2b98e374 --- /dev/null +++ b/src/main/java/frc/lib/SubsystemBase.java @@ -0,0 +1,17 @@ +package frc.lib; + +import org.wpilib.command3.Coroutine; +import org.wpilib.command3.Mechanism; +import org.wpilib.command3.NeedsNameBuilderStage; +import org.wpilib.command3.StagedCommandBuilder; +import java.util.function.Consumer; + +public abstract class SubsystemBase implements Mechanism { + public NeedsNameBuilderStage run(Consumer commandBody) { + return new StagedCommandBuilder().requiring(this).executing( + commandBody.andThen(_ -> periodic()) + ); + } + + public abstract void periodic(); +} diff --git a/src/main/java/frc/lib/characterization/SysIdFactory.java b/src/main/java/frc/lib/characterization/SysIdFactory.java index a4567b34b..fbe8298df 100644 --- a/src/main/java/frc/lib/characterization/SysIdFactory.java +++ b/src/main/java/frc/lib/characterization/SysIdFactory.java @@ -1,9 +1,9 @@ package frc.lib.characterization; -import edu.wpi.first.units.measure.Voltage; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Subsystem; -import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine; +import org.wpilib.units.measure.Voltage; +import org.wpilib.command2.Command; +import org.wpilib.command2.Subsystem; +import org.wpilib.command2.sysid.SysIdRoutine; import java.util.function.Consumer; import org.littletonrobotics.junction.Logger; diff --git a/src/main/java/frc/lib/utils/AllianceFlipUtil.java b/src/main/java/frc/lib/utils/AllianceFlipUtil.java index c5d1063c0..bb60394b5 100644 --- a/src/main/java/frc/lib/utils/AllianceFlipUtil.java +++ b/src/main/java/frc/lib/utils/AllianceFlipUtil.java @@ -1,12 +1,12 @@ package frc.lib.utils; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Pose3d; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.geometry.Rotation3d; -import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.math.geometry.Translation3d; -import edu.wpi.first.wpilibj.DriverStation; +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 org.wpilib.math.geometry.Translation2d; +import org.wpilib.math.geometry.Translation3d; +import org.wpilib.driverstation.DriverStation; import frc.robot.FieldConstants; /** diff --git a/src/main/java/frc/lib/utils/GeomUtils.java b/src/main/java/frc/lib/utils/GeomUtils.java index 3db5d0c94..9eef300ca 100644 --- a/src/main/java/frc/lib/utils/GeomUtils.java +++ b/src/main/java/frc/lib/utils/GeomUtils.java @@ -1,10 +1,10 @@ package frc.lib.utils; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.geometry.Transform2d; -import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.math.geometry.Twist2d; +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.geometry.Twist2d; public class GeomUtils { diff --git a/src/main/java/frc/lib/utils/LocalADStarAK.java b/src/main/java/frc/lib/utils/LocalADStarAK.java index c51f334e4..7dae8474c 100644 --- a/src/main/java/frc/lib/utils/LocalADStarAK.java +++ b/src/main/java/frc/lib/utils/LocalADStarAK.java @@ -6,8 +6,8 @@ import com.pathplanner.lib.path.PathPoint; import com.pathplanner.lib.pathfinding.LocalADStar; import com.pathplanner.lib.pathfinding.Pathfinder; -import edu.wpi.first.math.Pair; -import edu.wpi.first.math.geometry.Translation2d; +import org.wpilib.math.util.Pair; +import org.wpilib.math.geometry.Translation2d; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 922aca595..77122b5e8 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -1,13 +1,16 @@ package frc.robot; -import edu.wpi.first.wpilibj.DriverStation; -import edu.wpi.first.wpilibj.RobotBase; +import org.wpilib.driverstation.DriverStation; +import org.wpilib.framework.RobotBase; +import org.wpilib.math.util.Units; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.Map; public class Constants { + public static final double SLOW_SPEED = Units.inchesToMeters(20); + // Change this temporarily to override the RobotType, e.g. RobotType.ROBOT_SIMBOT private static final RobotType ROBOT_TYPE_OVERRIDE = null; public static final boolean tuningMode = false; diff --git a/src/main/java/frc/robot/FieldConstants.java b/src/main/java/frc/robot/FieldConstants.java index a2210db17..f21d247ca 100644 --- a/src/main/java/frc/robot/FieldConstants.java +++ b/src/main/java/frc/robot/FieldConstants.java @@ -1,12 +1,12 @@ package frc.robot; import com.fasterxml.jackson.databind.ObjectMapper; -import edu.wpi.first.apriltag.AprilTagFieldLayout; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.math.geometry.Translation3d; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.wpilibj.Filesystem; +import org.wpilib.vision.apriltag.AprilTagFieldLayout; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Translation2d; +import org.wpilib.math.geometry.Translation3d; +import org.wpilib.math.util.Units; +import org.wpilib.system.Filesystem; import java.io.IOException; import java.nio.file.Path; diff --git a/src/main/java/frc/robot/Main.java b/src/main/java/frc/robot/Main.java index 8776e5dda..5a10f2147 100644 --- a/src/main/java/frc/robot/Main.java +++ b/src/main/java/frc/robot/Main.java @@ -4,7 +4,7 @@ package frc.robot; -import edu.wpi.first.wpilibj.RobotBase; +import org.wpilib.framework.RobotBase; /** * Do NOT add any static variables to this class, or any initialization at all. Unless you know what diff --git a/src/main/java/frc/robot/Orchestrator.java b/src/main/java/frc/robot/Orchestrator.java index 37135b86b..1259170e2 100644 --- a/src/main/java/frc/robot/Orchestrator.java +++ b/src/main/java/frc/robot/Orchestrator.java @@ -1,24 +1,24 @@ package frc.robot; -import static edu.wpi.first.units.Units.Meters; -import static edu.wpi.first.units.Units.Minute; -import static edu.wpi.first.units.Units.RadiansPerSecond; -import static edu.wpi.first.units.Units.Rotations; +import static org.wpilib.units.Units.Meters; +import static org.wpilib.units.Units.Minute; +import static org.wpilib.units.Units.RadiansPerSecond; +import static org.wpilib.units.Units.Rotations; import static frc.robot.subsystems.shooter.ShooterConstants.CLOSE_HUB_SHOOTER_RPM; -import edu.wpi.first.math.filter.LinearFilter; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.geometry.Transform2d; -import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.units.measure.Distance; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.ConditionalCommand; -import edu.wpi.first.wpilibj2.command.SelectCommand; -import edu.wpi.first.wpilibj2.command.button.CommandXboxController; +import org.wpilib.math.filter.LinearFilter; +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.util.Units; +import org.wpilib.units.measure.Distance; +import org.wpilib.smartdashboard.SmartDashboard; +import org.wpilib.command2.Command; +import org.wpilib.command2.Commands; +import org.wpilib.command2.ConditionalCommand; +import org.wpilib.command2.SelectCommand; +import org.wpilib.command2.button.CommandXboxController; // Removed import frc.lib.utils.AllianceFlipUtil; import frc.robot.FieldConstants.Hub; import frc.robot.commands.auto.DriveToPose; diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index ef925d158..b2f5fcc36 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -4,14 +4,14 @@ package frc.robot; -import edu.wpi.first.math.filter.LinearFilter; -import edu.wpi.first.wpilibj.Alert; -import edu.wpi.first.wpilibj.Alert.AlertType; -import edu.wpi.first.wpilibj.DriverStation; -import edu.wpi.first.wpilibj.RobotController; -import edu.wpi.first.wpilibj.Timer; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.CommandScheduler; +import org.wpilib.util.Alert.Level; +import org.wpilib.math.filter.LinearFilter; +import org.wpilib.util.Alert; +import org.wpilib.driverstation.DriverStation; +import org.wpilib.system.RobotController; +import org.wpilib.system.Timer; +import org.wpilib.command2.Command; +import org.wpilib.command2.CommandScheduler; import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -22,7 +22,7 @@ import org.littletonrobotics.junction.networktables.NT4Publisher; import org.littletonrobotics.junction.wpilog.WPILOGReader; import org.littletonrobotics.junction.wpilog.WPILOGWriter; -import org.littletonrobotics.urcl.URCL; +import org.littletonrobotics.urcl.URCL; // Removed (must use native revrobotics logger) /** * The VM is configured to automatically run this class, and to call the functions corresponding to @@ -53,11 +53,11 @@ public class Robot extends LoggedRobot { private static int lowBatteryCycleCount = 0; private final Alert canErrorAlert = - new Alert("CAN errors detected, robot may not be controllable.", AlertType.kError); + new Alert("CAN errors detected, robot may not be controllable.", Level.HIGH); private final Alert lowBatteryAlert = new Alert( "Battery voltage is very low, consider turning off the robot or replacing the battery.", - AlertType.kWarning); + Level.MEDIUM); /** * This function is run when the robot is first started up and should be used for any diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index a205ec02e..aea04309f 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -4,33 +4,30 @@ package frc.robot; -import static edu.wpi.first.units.Units.*; +import static frc.robot.Constants.SLOW_SPEED; import static frc.robot.subsystems.drive.DriveConstants.ppConfig; -import static frc.robot.subsystems.vision.VisionConstants.*; +import static frc.robot.subsystems.vision.VisionConstants.camera0Name; +import static frc.robot.subsystems.vision.VisionConstants.camera1Name; +import static frc.robot.subsystems.vision.VisionConstants.camera2Name; +import static frc.robot.subsystems.vision.VisionConstants.robotToCamera0; +import static frc.robot.subsystems.vision.VisionConstants.robotToCamera1; +import static frc.robot.subsystems.vision.VisionConstants.robotToCamera2; import com.pathplanner.lib.auto.AutoBuilder; import com.pathplanner.lib.config.PIDConstants; import com.pathplanner.lib.controllers.PPHolonomicDriveController; import com.pathplanner.lib.pathfinding.Pathfinding; import com.pathplanner.lib.util.PathPlannerLogging; -import edu.wpi.first.math.geometry.*; -import edu.wpi.first.wpilibj.DriverStation; -import edu.wpi.first.wpilibj.DriverStation.Alliance; -import edu.wpi.first.wpilibj.GenericHID; -import edu.wpi.first.wpilibj.GenericHID.RumbleType; -import edu.wpi.first.wpilibj.XboxController; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.button.CommandXboxController; -import edu.wpi.first.wpilibj2.command.button.Trigger; -import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine; -import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction; import frc.lib.utils.LocalADStarAK; import frc.robot.RobotState.IntakePosition; import frc.robot.commands.auto.Autos; import frc.robot.commands.drive.DriveCommands; -import frc.robot.commands.drive.DriveWithDpad; -import frc.robot.subsystems.drive.*; +import frc.robot.subsystems.drive.Drive; +import frc.robot.subsystems.drive.GyroIO; +import frc.robot.subsystems.drive.GyroIOPigeon2; +import frc.robot.subsystems.drive.ModuleIO; +import frc.robot.subsystems.drive.ModuleIOSim; +import frc.robot.subsystems.drive.ModuleIOTalonSpark; import frc.robot.subsystems.indexer.Indexer; import frc.robot.subsystems.indexer.IndexerIO; import frc.robot.subsystems.indexer.IndexerIOSparkMax; @@ -54,6 +51,19 @@ import frc.robot.util.CustomTriggers; import org.littletonrobotics.junction.Logger; import org.littletonrobotics.junction.networktables.LoggedDashboardChooser; +import org.wpilib.command2.Command; +import org.wpilib.command2.Commands; +import org.wpilib.command2.button.CommandXboxController; // Removed +import org.wpilib.command2.button.Trigger; +import org.wpilib.command2.sysid.SysIdRoutine; +import org.wpilib.command2.sysid.SysIdRoutine.Direction; +import org.wpilib.driverstation.Alliance; +import org.wpilib.driverstation.DriverStation; +import org.wpilib.driverstation.GenericHID.RumbleType; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.kinematics.ChassisVelocities; +import org.wpilib.wpilibj.XboxController; // Removed /** * This class is where the bulk of the robot should be declared. Since Command-based is a @@ -62,6 +72,7 @@ * subsystems, commands, and button mappings) should be declared here. */ public class RobotContainer { + // Subsystems // private final Subsystem subsystem; private Drive drive; @@ -84,7 +95,9 @@ public class RobotContainer { // Dashboard inputs private final LoggedDashboardChooser autoChooser; - /** The container for the robot. Contains subsystems, OI devices, and commands. */ + /** + * The container for the robot. Contains subsystems, OI devices, and commands. + */ public RobotContainer() { // Instantiate active subsystems if (Constants.getMode() != Constants.Mode.REPLAY) { @@ -132,7 +145,8 @@ public RobotContainer() { case ROBOT_SIMBOT -> { drive = new Drive( - new GyroIO() {}, + new GyroIO() { + }, new ModuleIOSim(), new ModuleIOSim(), new ModuleIOSim(), @@ -154,27 +168,37 @@ public RobotContainer() { if (drive == null) { drive = new Drive( - new GyroIO() {}, - new ModuleIO() {}, - new ModuleIO() {}, - new ModuleIO() {}, - new ModuleIO() {}); + new GyroIO() { + }, + new ModuleIO() { + }, + new ModuleIO() { + }, + new ModuleIO() { + }, + new ModuleIO() { + }); } if (intakeRollers == null) { - intakeRollers = new IntakeRollers(new IntakeRollersIO() {}); + intakeRollers = new IntakeRollers(new IntakeRollersIO() { + }); } if (intakeExtend == null) { - intakeExtend = new IntakeExtend(new IntakeExtendIO() {}, () -> false); + intakeExtend = new IntakeExtend(new IntakeExtendIO() { + }, () -> false); } intake = new Intake(intakeRollers, intakeExtend); if (magicCarpet == null) { - magicCarpet = new MagicCarpet(new MagicCarpetIO() {}); + magicCarpet = new MagicCarpet(new MagicCarpetIO() { + }); } if (shooter == null) { - shooter = new Shooter(new ShooterIO() {}); + shooter = new Shooter(new ShooterIO() { + }); } if (indexer == null) { - indexer = new Indexer(new IndexerIO() {}); + indexer = new Indexer(new IndexerIO() { + }); } orchestrator = @@ -184,7 +208,7 @@ public RobotContainer() { AutoBuilder.configure( drive::getPose, drive::setPose, - drive::getChassisSpeeds, + drive::getChassisVelocities, drive::runVelocity, new PPHolonomicDriveController(new PIDConstants(14.0, 0, 0), new PIDConstants(7, 0, 0)), ppConfig, @@ -268,9 +292,9 @@ public RobotContainer() { /** * Use this method to define your button->command mappings. Buttons can be created by - * instantiating a {@link GenericHID} or one of its subclasses ({@link - * edu.wpi.first.wpilibj.Joystick} or {@link XboxController}), and then passing it to a {@link - * edu.wpi.first.wpilibj2.command.button.JoystickButton}. + * instantiating a {@link GenericHID} or one of its subclasses + * ({@link org.wpilib.wpilibj.Joystick} or {@link XboxController}), and then passing it to a + * {@link org.wpilib.command2.button.JoystickButton}. */ private void configureButtonBindings() { indexer.setDefaultCommand(indexer.stop()); @@ -299,7 +323,17 @@ private void configureButtonBindings() { drive) .ignoringDisable(true)); new Trigger(() -> driverController.getHID().getPOV() != -1) - .whileTrue(new DriveWithDpad(drive, () -> driverController.getHID().getPOV())); + .whileTrue(drive.run(coro -> { + int pov = driverController.getHID().getPOV(); + + switch (pov) { + case 0 -> drive.runVelocity(new ChassisVelocities(SLOW_SPEED, 0, 0)); + case 90 -> drive.runVelocity(new ChassisVelocities(0, -SLOW_SPEED, 0)); + case 180 -> drive.runVelocity(new ChassisVelocities(-SLOW_SPEED, 0, 0)); + case 270 -> drive.runVelocity(new ChassisVelocities(0, SLOW_SPEED, 0)); + default -> drive.stop(); + } + }).named("DriveWithDpad")); driverController.x().toggleOnTrue(orchestrator.zoneBasedAim()); driverController.y().toggleOnTrue(intake.extendToAngleAndIntake(IntakeConstants.COLLAPSE_POS)); driverController diff --git a/src/main/java/frc/robot/RobotState.java b/src/main/java/frc/robot/RobotState.java index 7e91b29c8..c8cb24bd3 100644 --- a/src/main/java/frc/robot/RobotState.java +++ b/src/main/java/frc/robot/RobotState.java @@ -1,12 +1,12 @@ package frc.robot; -import static edu.wpi.first.units.Units.Percent; +import static org.wpilib.units.Units.Percent; -import edu.wpi.first.wpilibj.DriverStation; -import edu.wpi.first.wpilibj.LEDPattern; +import org.wpilib.driverstation.DriverStation; import frc.robot.subsystems.leds.LedPatterns; import frc.robot.subsystems.leds.Leds.Sections; import org.littletonrobotics.junction.AutoLogOutput; +import org.wpilib.hardware.led.LEDPattern; /** * Robot state will hold all the global information that is shared across the subsystems, such as diff --git a/src/main/java/frc/robot/commands/auto/Autos.java b/src/main/java/frc/robot/commands/auto/Autos.java index 06eb4f0a5..7d13b71b4 100644 --- a/src/main/java/frc/robot/commands/auto/Autos.java +++ b/src/main/java/frc/robot/commands/auto/Autos.java @@ -1,10 +1,10 @@ package frc.robot.commands.auto; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.util.Units; +import org.wpilib.command2.Command; +import org.wpilib.command2.Commands; import frc.lib.utils.AllianceFlipUtil; import frc.robot.Orchestrator; import frc.robot.subsystems.drive.Drive; diff --git a/src/main/java/frc/robot/commands/auto/DriveToPose.java b/src/main/java/frc/robot/commands/auto/DriveToPose.java index 4b9eafb20..86819433b 100644 --- a/src/main/java/frc/robot/commands/auto/DriveToPose.java +++ b/src/main/java/frc/robot/commands/auto/DriveToPose.java @@ -1,28 +1,28 @@ package frc.robot.commands.auto; -import edu.wpi.first.math.controller.ProfiledPIDController; -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.trajectory.TrapezoidProfile; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.wpilibj.DriverStation; -import edu.wpi.first.wpilibj.DriverStation.Alliance; -import edu.wpi.first.wpilibj2.command.Command; import frc.lib.utils.GeomUtils; import frc.lib.utils.TunableNumber; import frc.robot.Constants; import frc.robot.subsystems.drive.Drive; -import java.awt.*; import java.util.function.Supplier; import org.littletonrobotics.junction.AutoLogOutput; +import org.wpilib.command3.Command; +import org.wpilib.driverstation.Alliance; +import org.wpilib.driverstation.DriverStation; +import org.wpilib.math.controller.ProfiledPIDController; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Translation2d; +import org.wpilib.math.kinematics.ChassisVelocities; // Removed or renamed +import org.wpilib.math.trajectory.TrapezoidProfile; +import org.wpilib.math.util.Units; /** * Command to drive the robot to a specified pose in a straight path. This is useful for very simple * autos or for alignment. */ public class DriveToPose extends Command { + private final Drive drive; private final Supplier poseSupplier; @@ -96,7 +96,7 @@ public class DriveToPose extends Command { * Drives to the specified pose under full software control. * * @param drive The drive subsystem - * @param pose The target pose + * @param pose The target pose */ public DriveToPose(Drive drive, Pose2d pose) { this(drive, () -> pose); @@ -110,26 +110,26 @@ public DriveToPose(Drive drive, double deltaXMeters, double deltaYMeters, double new Translation2d( drive.getPose().getTranslation().getX() + (DriverStation.getAlliance().isEmpty() - || DriverStation.getAlliance().get() == Alliance.Blue - ? deltaXMeters - : -deltaXMeters), + || DriverStation.getAlliance().get() == Alliance.Blue + ? deltaXMeters + : -deltaXMeters), drive.getPose().getTranslation().getY() + (DriverStation.getAlliance().isEmpty() - || DriverStation.getAlliance().get() == Alliance.Blue - ? deltaYMeters - : -deltaYMeters)), + || DriverStation.getAlliance().get() == Alliance.Blue + ? deltaYMeters + : -deltaYMeters)), new Rotation2d( drive.getPose().getRotation().getRadians() + (DriverStation.getAlliance().isEmpty() - || DriverStation.getAlliance().get() == Alliance.Blue - ? deltaThetaRad - : -deltaThetaRad)))); + || DriverStation.getAlliance().get() == Alliance.Blue + ? deltaThetaRad + : -deltaThetaRad)))); } /** * Constructs a new DriveToPose command that drives the robot to a specified pose. * - * @param drive The drive subsystem + * @param drive The drive subsystem * @param poseSupplier A supplier that provides the target pose */ public DriveToPose(Drive drive, Supplier poseSupplier) { @@ -194,7 +194,9 @@ public void execute() { double currentDistance = currentPose.getTranslation().getDistance(targetPose.getTranslation()); driveErrorAbs = currentDistance; double driveVelocityScalar = driveController.calculate(driveErrorAbs, 0.0); - if (driveController.atGoal()) driveVelocityScalar = 0.0; + if (driveController.atGoal()) { + driveVelocityScalar = 0.0; + } // Calculate theta speed double thetaVelocity = @@ -202,17 +204,19 @@ public void execute() { currentPose.getRotation().getRadians(), targetPose.getRotation().getRadians()); thetaErrorAbs = Math.abs(currentPose.getRotation().minus(targetPose.getRotation()).getRadians()); - if (thetaController.atGoal()) thetaVelocity = 0.0; + if (thetaController.atGoal()) { + thetaVelocity = 0.0; + } // Command speeds var driveVelocity = new Pose2d( - new Translation2d(), - currentPose.getTranslation().minus(targetPose.getTranslation()).getAngle()) + new Translation2d(), + currentPose.getTranslation().minus(targetPose.getTranslation()).getAngle()) .transformBy(GeomUtils.transformFromTranslation(driveVelocityScalar, 0.0)) .getTranslation(); drive.runVelocity( - ChassisSpeeds.fromFieldRelativeSpeeds( + ChassisVelocities.fromFieldRelativeSpeeds( driveVelocity.getX(), driveVelocity.getY(), thetaVelocity, currentPose.getRotation())); } @@ -227,19 +231,25 @@ public boolean isFinished() { return atGoal(); } - /** Checks if the robot is stopped at the final pose. */ + /** + * Checks if the robot is stopped at the final pose. + */ public boolean atGoal() { return running && driveController.atGoal() && thetaController.atGoal(); } - /** Checks if the robot pose is within the allowed drive and theta tolerances. */ + /** + * Checks if the robot pose is within the allowed drive and theta tolerances. + */ public boolean withinTolerance(double driveTolerance, Rotation2d thetaTolerance) { return running && Math.abs(driveErrorAbs) < driveTolerance && Math.abs(thetaErrorAbs) < thetaTolerance.getRadians(); } - /** Returns whether the command is actively running. */ + /** + * Returns whether the command is actively running. + */ @AutoLogOutput public boolean isRunning() { return running; diff --git a/src/main/java/frc/robot/commands/auto/RotateToOrientation.java b/src/main/java/frc/robot/commands/auto/RotateToOrientation.java index 9bdeec173..c432e4c27 100644 --- a/src/main/java/frc/robot/commands/auto/RotateToOrientation.java +++ b/src/main/java/frc/robot/commands/auto/RotateToOrientation.java @@ -1,12 +1,12 @@ package frc.robot.commands.auto; -import edu.wpi.first.math.controller.ProfiledPIDController; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.kinematics.ChassisSpeeds; -import edu.wpi.first.math.trajectory.TrapezoidProfile.Constraints; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.wpilibj2.command.Command; +import org.wpilib.math.controller.ProfiledPIDController; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.kinematics.ChassisVelocities; // Removed or renamed +import org.wpilib.math.trajectory.TrapezoidProfile.Constraints; +import org.wpilib.math.util.Units; +import org.wpilib.command2.Command; import frc.robot.subsystems.drive.Drive; import java.util.Objects; import java.util.function.Supplier; @@ -89,7 +89,7 @@ public void execute() { if (thetaController.atGoal()) thetaVelocity = 0.0; drive.runVelocity( - ChassisSpeeds.fromFieldRelativeSpeeds(0, 0, thetaVelocity, currentPose.getRotation())); + ChassisVelocities.fromFieldRelativeSpeeds(0, 0, thetaVelocity, currentPose.getRotation())); } @Override diff --git a/src/main/java/frc/robot/commands/auto/StraightDriveToPose.java b/src/main/java/frc/robot/commands/auto/StraightDriveToPose.java index f0011c966..0d5bc9e14 100644 --- a/src/main/java/frc/robot/commands/auto/StraightDriveToPose.java +++ b/src/main/java/frc/robot/commands/auto/StraightDriveToPose.java @@ -1,15 +1,15 @@ package frc.robot.commands.auto; -import edu.wpi.first.math.controller.ProfiledPIDController; -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.trajectory.TrapezoidProfile.Constraints; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.wpilibj.DriverStation; -import edu.wpi.first.wpilibj.DriverStation.Alliance; -import edu.wpi.first.wpilibj2.command.Command; +import org.wpilib.math.controller.ProfiledPIDController; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Translation2d; +import org.wpilib.math.kinematics.ChassisVelocities; // Removed or renamed +import org.wpilib.math.trajectory.TrapezoidProfile.Constraints; +import org.wpilib.math.util.Units; +import org.wpilib.driverstation.DriverStation; +import org.wpilib.driverstation.Alliance; +import org.wpilib.command2.Command; import frc.lib.utils.GeomUtils; import frc.robot.subsystems.drive.Drive; import java.util.function.Supplier; @@ -160,7 +160,7 @@ public void execute() { .transformBy(GeomUtils.transformFromTranslation(driveVelocityScalar, 0.0)) .getTranslation(); drive.runVelocity( - ChassisSpeeds.fromFieldRelativeSpeeds( + ChassisVelocities.fromFieldRelativeSpeeds( driveVelocity.getX(), driveVelocity.getY(), thetaVelocity, currentPose.getRotation())); } diff --git a/src/main/java/frc/robot/commands/drive/DriveCommands.java b/src/main/java/frc/robot/commands/drive/DriveCommands.java index bbba70117..8ff52e22a 100644 --- a/src/main/java/frc/robot/commands/drive/DriveCommands.java +++ b/src/main/java/frc/robot/commands/drive/DriveCommands.java @@ -1,20 +1,19 @@ package frc.robot.commands.drive; -import edu.wpi.first.math.MathUtil; -import edu.wpi.first.math.controller.ProfiledPIDController; -import edu.wpi.first.math.filter.SlewRateLimiter; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.geometry.Transform2d; -import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.math.kinematics.ChassisSpeeds; -import edu.wpi.first.math.trajectory.TrapezoidProfile; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.wpilibj.DriverStation; -import edu.wpi.first.wpilibj.DriverStation.Alliance; -import edu.wpi.first.wpilibj.Timer; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; +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.ChassisVelocities; // Removed or renamed +import org.wpilib.math.trajectory.TrapezoidProfile; +import org.wpilib.math.util.Units; +import org.wpilib.driverstation.DriverStation; +import org.wpilib.driverstation.Alliance; +import org.wpilib.system.Timer; +import org.wpilib.command3.Command; import frc.robot.subsystems.drive.Drive; import frc.robot.subsystems.drive.DriveConstants; import java.text.DecimalFormat; @@ -23,6 +22,9 @@ import java.util.List; import java.util.function.DoubleSupplier; import java.util.function.Supplier; +import org.wpilib.driverstation.MatchState; +import org.wpilib.units.TimeUnit; +import org.wpilib.units.measure.Time; public class DriveCommands { private static final double DEADBAND = 0.1; @@ -54,7 +56,7 @@ private static Translation2d getLinearVelocityFromJoysticks(double x, double y) // Return new linear velocity return new Pose2d(new Translation2d(), linearDirection) - .transformBy(new Transform2d(linearMagnitude, 0.0, Rotation2d.kZero)) + .transformBy(new Transform2d(linearMagnitude, 0.0, Rotation2d.ZERO)) .getTranslation(); } @@ -66,8 +68,7 @@ public static Command joystickDrive( DoubleSupplier xSupplier, DoubleSupplier ySupplier, DoubleSupplier omegaSupplier) { - return Commands.run( - () -> { + return drive.runRepeatedly(() -> { // Get linear velocity Translation2d linearVelocity = getLinearVelocityFromJoysticks(xSupplier.getAsDouble(), ySupplier.getAsDouble()); @@ -79,22 +80,19 @@ public static Command joystickDrive( 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()); boolean isFlipped = - DriverStation.getAlliance().isPresent() - && DriverStation.getAlliance().get() == Alliance.Red; + MatchState.getAlliance().isPresent() + && MatchState.getAlliance().get() == Alliance.RED; drive.runVelocity( - ChassisSpeeds.fromFieldRelativeSpeeds( - speeds, - isFlipped + speeds.toFieldRelative(isFlipped ? drive.getRotation().plus(new Rotation2d(Math.PI)) : drive.getRotation())); - }, - drive); + }).named("Joystick Drive"); } /** @@ -118,11 +116,13 @@ public static Command joystickDriveAtAngle( angleController.enableContinuousInput(-Math.PI, Math.PI); // Construct command - return Commands.run( + return drive.runRepeatedly( () -> { + angleController.reset(drive.getRotation().getRadians()); + boolean isFlipped = - DriverStation.getAlliance().isPresent() - && DriverStation.getAlliance().get() == Alliance.Red; + MatchState.getAlliance().isPresent() + && MatchState.getAlliance().get() == Alliance.RED; // Get linear velocity Translation2d linearVelocity = getLinearVelocityFromJoysticks(xSupplier.getAsDouble(), ySupplier.getAsDouble()); @@ -133,22 +133,17 @@ public static Command joystickDriveAtAngle( drive.getRotation().getRadians(), rotationSupplier.get().getRadians()); // Convert to field relative speeds & send command - ChassisSpeeds speeds = - new ChassisSpeeds( + ChassisVelocities speeds = + new ChassisVelocities( -linearVelocity.getY() * drive.getMaxLinearSpeedMetersPerSec(), -linearVelocity.getX() * drive.getMaxLinearSpeedMetersPerSec(), omega); drive.runVelocity( - ChassisSpeeds.fromFieldRelativeSpeeds( - speeds, + speeds.toFieldRelative( isFlipped ? drive.getRotation().plus(new Rotation2d(Math.PI)) : drive.getRotation())); - }, - drive) - - // Reset PID controller when command starts - .beforeStarting(() -> angleController.reset(drive.getRotation().getRadians())); + }).named("Joystick Drive at Angle"); } /** @@ -161,57 +156,44 @@ public static Command feedforwardCharacterization(Drive drive) { List voltageSamples = new LinkedList<>(); Timer timer = new Timer(); - return Commands.sequence( - // Reset data - Commands.runOnce( - () -> { - velocitySamples.clear(); - voltageSamples.clear(); - }), - - // Allow modules to orient - Commands.run( - () -> { - drive.runCharacterization(0.0); - }, - drive) - .withTimeout(FF_START_DELAY), - - // Start timer - Commands.runOnce(timer::restart), - - // Accelerate and gather data - Commands.run( - () -> { - double voltage = timer.get() * FF_RAMP_RATE; - drive.runCharacterization(voltage); - velocitySamples.add(drive.getFFCharacterizationVelocity()); - voltageSamples.add(voltage); - }, - drive) - - // When cancelled, calculate and print results - .finallyDo( - () -> { - int n = velocitySamples.size(); - double sumX = 0.0; - double sumY = 0.0; - double sumXY = 0.0; - double sumX2 = 0.0; - for (int i = 0; i < n; i++) { - sumX += velocitySamples.get(i); - sumY += voltageSamples.get(i); - sumXY += velocitySamples.get(i) * voltageSamples.get(i); - sumX2 += velocitySamples.get(i) * velocitySamples.get(i); - } - double kS = (sumY * sumX2 - sumX * sumXY) / (n * sumX2 - sumX * sumX); - double kV = (n * sumXY - sumX * sumY) / (n * sumX2 - sumX * sumX); - - NumberFormat formatter = new DecimalFormat("#0.00000"); - System.out.println("********** Drive FF Characterization Results **********"); - System.out.println("\tkS: " + formatter.format(kS)); - System.out.println("\tkV: " + formatter.format(kV)); - })); + return drive.run( + coro -> { + velocitySamples.clear(); + voltageSamples.clear(); + + // Change: Originally had a timeout of FF_START_DELAY seconds + drive.runCharacterization(0.0); + + timer.restart(); + + while (true) { + double voltage = timer.get() * FF_RAMP_RATE; + drive.runCharacterization(voltage); + velocitySamples.add(drive.getFFCharacterizationVelocity()); + voltageSamples.add(voltage); + coro.yield(); + } + } + ).whenCanceled(() -> { + int n = velocitySamples.size(); + double sumX = 0.0; + double sumY = 0.0; + double sumXY = 0.0; + double sumX2 = 0.0; + for (int i = 0; i < n; i++) { + sumX += velocitySamples.get(i); + sumY += voltageSamples.get(i); + sumXY += velocitySamples.get(i) * voltageSamples.get(i); + sumX2 += velocitySamples.get(i) * velocitySamples.get(i); + } + double kS = (sumY * sumX2 - sumX * sumXY) / (n * sumX2 - sumX * sumX); + double kV = (n * sumXY - sumX * sumY) / (n * sumX2 - sumX * sumX); + + NumberFormat formatter = new DecimalFormat("#0.00000"); + System.out.println("********** Drive FF Characterization Results **********"); + System.out.println("\tkS: " + formatter.format(kS)); + System.out.println("\tkV: " + formatter.format(kV)); + }).named("FF Characterization"); } /** Measures the robot's wheel radius by spinning in a circle. */ @@ -219,74 +201,64 @@ public static Command wheelRadiusCharacterization(Drive drive) { SlewRateLimiter limiter = new SlewRateLimiter(WHEEL_RADIUS_RAMP_RATE); WheelRadiusCharacterizationState state = new WheelRadiusCharacterizationState(); - return Commands.parallel( - // Drive control sequence - Commands.sequence( - // Reset acceleration limiter - Commands.runOnce( - () -> { - limiter.reset(0.0); - }), - - // Turn in place, accelerating up to full speed - Commands.run( - () -> { - double speed = limiter.calculate(WHEEL_RADIUS_MAX_VELOCITY); - drive.runVelocity(new ChassisSpeeds(0.0, 0.0, speed)); - }, - drive)), - - // Measurement sequence - Commands.sequence( - // Wait for modules to fully orient before starting measurement - Commands.waitSeconds(1.0), - - // Record starting measurement - Commands.runOnce( - () -> { - state.positions = drive.getWheelRadiusCharacterizationPositions(); - state.lastAngle = drive.getRotation(); - state.gyroDelta = 0.0; - }), - - // Update gyro delta - Commands.run( - () -> { - var rotation = drive.getRotation(); - state.gyroDelta += Math.abs(rotation.minus(state.lastAngle).getRadians()); - state.lastAngle = rotation; - }) - - // When cancelled, calculate and print results - .finallyDo( - () -> { - double[] positions = drive.getWheelRadiusCharacterizationPositions(); - double wheelDelta = 0.0; - for (int i = 0; i < 4; i++) { - wheelDelta += Math.abs(positions[i] - state.positions[i]) / 4.0; - } - double wheelRadius = - (state.gyroDelta * DriveConstants.driveBaseRadius) / wheelDelta; - - NumberFormat formatter = new DecimalFormat("#0.000"); - System.out.println( - "********** Wheel Radius Characterization Results **********"); - System.out.println( - "\tWheel Delta: " + formatter.format(wheelDelta) + " radians"); - System.out.println( - "\tGyro Delta: " + formatter.format(state.gyroDelta) + " radians"); - System.out.println( - "\tWheel Radius: " - + formatter.format(wheelRadius) - + " meters, " - + formatter.format(Units.metersToInches(wheelRadius)) - + " inches"); - }))); + return Command.parallel( + drive.run( + coro -> { + limiter.reset(0.0); + + while (true) { + double speed = limiter.calculate(WHEEL_RADIUS_MAX_VELOCITY); + drive.runVelocity(new ChassisVelocities(0.0, 0.0, speed)); + + coro.yield(); + } + } + ).named("Drive control sequence"), + Command.noRequirements( + coro -> { + coro.wait(org.wpilib.units.Units.Second.of(1)); + + state.positions = drive.getWheelRadiusCharacterizationPositions(); + state.lastAngle = drive.getRotation(); + state.gyroDelta = 0.0; + + while (true) { + var rotation = drive.getRotation(); + state.gyroDelta += Math.abs(rotation.minus(state.lastAngle).getRadians()); + state.lastAngle = rotation; + + coro.yield(); + } + } + ).whenCanceled(() -> { + double[] positions = drive.getWheelRadiusCharacterizationPositions(); + double wheelDelta = 0.0; + for (int i = 0; i < 4; i++) { + wheelDelta += Math.abs(positions[i] - state.positions[i]) / 4.0; + } + double wheelRadius = + (state.gyroDelta * DriveConstants.driveBaseRadius) / wheelDelta; + + NumberFormat formatter = new DecimalFormat("#0.000"); + System.out.println( + "********** Wheel Radius Characterization Results **********"); + System.out.println( + "\tWheel Delta: " + formatter.format(wheelDelta) + " radians"); + System.out.println( + "\tGyro Delta: " + formatter.format(state.gyroDelta) + " radians"); + System.out.println( + "\tWheel Radius: " + + formatter.format(wheelRadius) + + " meters, " + + formatter.format(Units.metersToInches(wheelRadius)) + + " inches"); + }).named("Measurement sequence") + ).named("Wheel Radius Characterization"); } private static class WheelRadiusCharacterizationState { double[] positions = new double[4]; - Rotation2d lastAngle = Rotation2d.kZero; + Rotation2d lastAngle = Rotation2d.ZERO; double gyroDelta = 0.0; } } diff --git a/src/main/java/frc/robot/commands/drive/DriveWithDpad.java b/src/main/java/frc/robot/commands/drive/DriveWithDpad.java deleted file mode 100644 index 62d1f7a2a..000000000 --- a/src/main/java/frc/robot/commands/drive/DriveWithDpad.java +++ /dev/null @@ -1,32 +0,0 @@ -package frc.robot.commands.drive; - -import edu.wpi.first.math.kinematics.ChassisSpeeds; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.wpilibj2.command.Command; -import frc.robot.subsystems.drive.Drive; -import java.util.function.Supplier; - -public class DriveWithDpad extends Command { - private final Drive drive; - private final Supplier povSupplier; - public static final double SLOW_SPEED = Units.inchesToMeters(20); - - public DriveWithDpad(Drive drive, Supplier povSupplier) { - this.drive = drive; - this.povSupplier = povSupplier; - addRequirements(drive); - } - - @Override - public void execute() { - int pov = povSupplier.get(); - - switch (pov) { - case 0 -> drive.runVelocity(new ChassisSpeeds(SLOW_SPEED, 0, 0)); - case 90 -> drive.runVelocity(new ChassisSpeeds(0, -SLOW_SPEED, 0)); - case 180 -> drive.runVelocity(new ChassisSpeeds(-SLOW_SPEED, 0, 0)); - case 270 -> drive.runVelocity(new ChassisSpeeds(0, SLOW_SPEED, 0)); - default -> drive.stop(); - } - } -} diff --git a/src/main/java/frc/robot/subsystems/drive/Drive.java b/src/main/java/frc/robot/subsystems/drive/Drive.java index 4d405d38d..c89cb341d 100644 --- a/src/main/java/frc/robot/subsystems/drive/Drive.java +++ b/src/main/java/frc/robot/subsystems/drive/Drive.java @@ -1,31 +1,31 @@ package frc.robot.subsystems.drive; -import static edu.wpi.first.units.Units.*; +import static org.wpilib.units.Units.*; import static frc.robot.subsystems.drive.DriveConstants.*; import com.pathplanner.lib.auto.AutoBuilder; import com.pathplanner.lib.path.PathPlannerPath; -import edu.wpi.first.math.Matrix; -import edu.wpi.first.math.controller.PIDController; -import edu.wpi.first.math.estimator.SwerveDrivePoseEstimator; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Pose3d; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.geometry.Rotation3d; -import edu.wpi.first.math.geometry.Twist2d; -import edu.wpi.first.math.kinematics.ChassisSpeeds; -import edu.wpi.first.math.kinematics.SwerveDriveKinematics; -import edu.wpi.first.math.kinematics.SwerveModulePosition; -import edu.wpi.first.math.kinematics.SwerveModuleState; -import edu.wpi.first.math.numbers.N1; -import edu.wpi.first.math.numbers.N3; -import edu.wpi.first.wpilibj.Alert; -import edu.wpi.first.wpilibj.Alert.AlertType; -import edu.wpi.first.wpilibj.DriverStation; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.SubsystemBase; -import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine; +import org.wpilib.math.kinematics.ChassisVelocities; +import org.wpilib.util.Alert.Level; +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.Pose3d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Rotation3d; +import org.wpilib.math.geometry.Twist2d; +import org.wpilib.math.kinematics.ChassisVelocities; // Removed or renamed (maybe Velocities) +import org.wpilib.math.kinematics.SwerveDriveKinematics; +import org.wpilib.math.kinematics.SwerveModulePosition; +import org.wpilib.math.kinematics.SwerveModuleState; // Removed or renamed +import org.wpilib.math.numbers.N1; +import org.wpilib.math.numbers.N3; +import org.wpilib.util.Alert; +import org.wpilib.driverstation.DriverStation; +import org.wpilib.command3.Command; +import org.wpilib.command3.Mechanism; +import org.wpilib.command2.sysid.SysIdRoutine; import frc.robot.Constants; import frc.robot.Constants.Mode; import frc.robot.subsystems.vision.VisionConstants; @@ -34,19 +34,19 @@ import org.littletonrobotics.junction.AutoLogOutput; import org.littletonrobotics.junction.Logger; -public class Drive extends SubsystemBase { +public class Drive implements Mechanism { static final Lock odometryLock = new ReentrantLock(); private final GyroIO gyroIO; private final GyroIOInputsAutoLogged gyroInputs = new GyroIOInputsAutoLogged(); private final Alert impactAlert = - new Alert("Impact Detected, lowering elevator to prevent flipping.", AlertType.kWarning); + new Alert("Impact Detected, lowering elevator to prevent flipping.", Level.MEDIUM); private final Alert tiltAlert = new Alert( - ("Tilt Threshold reached, lowering elevator to prevent flipping"), AlertType.kWarning); + ("Tilt Threshold reached, lowering elevator to prevent flipping"), Level.MEDIUM); 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.", Level.HIGH); private SwerveDriveKinematics kinematics = new SwerveDriveKinematics(moduleTranslations); private Rotation2d rawGyroRotation = Rotation2d.kZero; @@ -160,15 +160,15 @@ public void periodic() { * * @param speeds Speeds in meters/sec */ - public void runVelocity(ChassisSpeeds speeds) { + public void runVelocity(ChassisVelocities speeds) { // Calculate module setpoints - ChassisSpeeds discreteSpeeds = ChassisSpeeds.discretize(speeds, 0.02); + ChassisVelocities discreteSpeeds = ChassisVelocities.discretize(speeds, 0.02); SwerveModuleState[] setpointStates = kinematics.toSwerveModuleStates(discreteSpeeds); SwerveDriveKinematics.desaturateWheelSpeeds(setpointStates, maxSpeedMetersPerSec); // Log unoptimized setpoints Logger.recordOutput("SwerveStates/Setpoints", setpointStates); - Logger.recordOutput("SwerveChassisSpeeds/Setpoints", discreteSpeeds); + Logger.recordOutput("SwerveChassisVelocities/Setpoints", discreteSpeeds); // Send setpoints to modules for (int i = 0; i < 4; i++) { @@ -201,7 +201,7 @@ public Command getAutonomousCommand(String Path) { /** Stops the drive. */ public void stop() { - runVelocity(new ChassisSpeeds()); + runVelocity(new ChassisVelocities()); } /** @@ -249,9 +249,9 @@ private SwerveModulePosition[] getModulePositions() { } /** Returns the measured chassis speeds of the robot. */ - @AutoLogOutput(key = "SwerveChassisSpeeds/Measured") - public ChassisSpeeds getChassisSpeeds() { - return kinematics.toChassisSpeeds(getModuleStates()); + @AutoLogOutput(key = "SwerveChassisVelocities/Measured") + public ChassisVelocities getChassisVelocities() { + return kinematics.toChassisVelocities(getModuleStates()); } /** Returns the position of each module in radians. */ diff --git a/src/main/java/frc/robot/subsystems/drive/DriveConstants.java b/src/main/java/frc/robot/subsystems/drive/DriveConstants.java index a469e5c73..bdd04b1fd 100644 --- a/src/main/java/frc/robot/subsystems/drive/DriveConstants.java +++ b/src/main/java/frc/robot/subsystems/drive/DriveConstants.java @@ -7,10 +7,10 @@ import com.ctre.phoenix6.swerve.SwerveModuleConstants.ClosedLoopOutputType; import com.pathplanner.lib.config.ModuleConfig; import com.pathplanner.lib.config.RobotConfig; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.math.system.plant.DCMotor; -import edu.wpi.first.math.util.Units; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Translation2d; +import org.wpilib.math.system.DCMotor; +import org.wpilib.math.util.Units; import frc.robot.Constants; 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 b7a60e641..64e8d6608 100644 --- a/src/main/java/frc/robot/subsystems/drive/GyroIO.java +++ b/src/main/java/frc/robot/subsystems/drive/GyroIO.java @@ -1,6 +1,6 @@ package frc.robot.subsystems.drive; -import edu.wpi.first.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Rotation2d; import org.littletonrobotics.junction.AutoLog; public interface GyroIO { diff --git a/src/main/java/frc/robot/subsystems/drive/GyroIOPigeon2.java b/src/main/java/frc/robot/subsystems/drive/GyroIOPigeon2.java index 5ffc26320..b9fb49cb9 100644 --- a/src/main/java/frc/robot/subsystems/drive/GyroIOPigeon2.java +++ b/src/main/java/frc/robot/subsystems/drive/GyroIOPigeon2.java @@ -8,19 +8,19 @@ import com.ctre.phoenix6.StatusSignal; import com.ctre.phoenix6.configs.Pigeon2Configuration; import com.ctre.phoenix6.hardware.Pigeon2; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.units.measure.Angle; -import edu.wpi.first.units.measure.AngularVelocity; -import edu.wpi.first.units.measure.LinearAcceleration; -import edu.wpi.first.wpilibj.Alert; -import edu.wpi.first.wpilibj.Alert.AlertType; +import org.wpilib.util.Alert.Level; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.util.Units; +import org.wpilib.units.measure.Angle; +import org.wpilib.units.measure.AngularVelocity; +import org.wpilib.units.measure.LinearAcceleration; +import org.wpilib.util.Alert; import java.util.Queue; /** IO implementation for Pigeon 2. */ public class GyroIOPigeon2 implements GyroIO { private final Alert impactAlert = - new Alert("Impact Detected, lowering elevator to prevent flipping.", AlertType.kWarning); + new Alert("Impact Detected, lowering elevator to prevent flipping.", Level.MEDIUM); private final Pigeon2 pigeon = new Pigeon2(pigeonCanId); private final StatusSignal yaw = pigeon.getYaw(); private final Queue yawPositionQueue; diff --git a/src/main/java/frc/robot/subsystems/drive/Module.java b/src/main/java/frc/robot/subsystems/drive/Module.java index 16ba4889a..a31b998a5 100644 --- a/src/main/java/frc/robot/subsystems/drive/Module.java +++ b/src/main/java/frc/robot/subsystems/drive/Module.java @@ -2,12 +2,12 @@ import static frc.robot.subsystems.drive.DriveConstants.*; -import edu.wpi.first.math.MathUtil; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.kinematics.SwerveModulePosition; -import edu.wpi.first.math.kinematics.SwerveModuleState; -import edu.wpi.first.wpilibj.Alert; -import edu.wpi.first.wpilibj.Alert.AlertType; +import org.wpilib.util.Alert.Level; +import org.wpilib.math.util.MathUtil; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.kinematics.SwerveModulePosition; +import org.wpilib.math.kinematics.SwerveModuleState; // Removed or renamed (seems like it was broken down into parts) +import org.wpilib.util.Alert; import org.littletonrobotics.junction.Logger; public class Module { @@ -25,10 +25,10 @@ public Module(ModuleIO io, int index) { driveDisconnectedAlert = new Alert( "Disconnected drive motor on module " + Integer.toString(index) + ".", - AlertType.kError); + Level.HIGH); turnDisconnectedAlert = new Alert( - "Disconnected turn motor on module " + Integer.toString(index) + ".", AlertType.kError); + "Disconnected turn motor on module " + Integer.toString(index) + ".", Level.HIGH); } public void periodic() { diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIO.java b/src/main/java/frc/robot/subsystems/drive/ModuleIO.java index 4e5705a54..ef0bd6ae1 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIO.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIO.java @@ -1,6 +1,6 @@ package frc.robot.subsystems.drive; -import edu.wpi.first.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Rotation2d; import org.littletonrobotics.junction.AutoLog; public interface ModuleIO { diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIOSim.java b/src/main/java/frc/robot/subsystems/drive/ModuleIOSim.java index 98e945c51..fefb66dcb 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIOSim.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIOSim.java @@ -2,12 +2,12 @@ import static frc.robot.subsystems.drive.DriveConstants.*; -import edu.wpi.first.math.MathUtil; -import edu.wpi.first.math.controller.PIDController; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.system.plant.LinearSystemId; -import edu.wpi.first.wpilibj.Timer; -import edu.wpi.first.wpilibj.simulation.DCMotorSim; +import org.wpilib.math.util.MathUtil; +import org.wpilib.math.controller.PIDController; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.system.LinearSystemId; // Removed or renamed (likely LinearSystem now) +import org.wpilib.system.Timer; +import org.wpilib.simulation.DCMotorSim; /** Physics sim implementation of module IO. */ public class ModuleIOSim implements ModuleIO { diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIOSpark.java b/src/main/java/frc/robot/subsystems/drive/ModuleIOSpark.java index dfa079eb2..1fb261dd0 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIOSpark.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIOSpark.java @@ -12,18 +12,18 @@ import com.revrobotics.RelativeEncoder; import com.revrobotics.spark.*; import com.revrobotics.spark.FeedbackSensor; -import com.revrobotics.spark.SparkBase.ControlType; -import com.revrobotics.spark.SparkBase.PersistMode; -import com.revrobotics.spark.SparkBase.ResetMode; +import com.revrobotics.spark.SparkLowLevel.ControlType; +import com.revrobotics.PersistMode; +import com.revrobotics.ResetMode; import com.revrobotics.spark.SparkClosedLoopController.ArbFFUnits; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; import com.revrobotics.spark.config.SparkMaxConfig; -import edu.wpi.first.math.MathUtil; -import edu.wpi.first.math.filter.Debouncer; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.units.measure.Angle; +import org.wpilib.math.util.MathUtil; +import org.wpilib.math.filter.Debouncer; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.util.Units; +import org.wpilib.units.measure.Angle; import java.util.Queue; import java.util.function.DoubleSupplier; diff --git a/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonSpark.java b/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonSpark.java index 6842806dd..0b36ee8ef 100644 --- a/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonSpark.java +++ b/src/main/java/frc/robot/subsystems/drive/ModuleIOTalonSpark.java @@ -21,22 +21,22 @@ import com.revrobotics.RelativeEncoder; import com.revrobotics.spark.FeedbackSensor; import com.revrobotics.spark.SparkBase; -import com.revrobotics.spark.SparkBase.ControlType; -import com.revrobotics.spark.SparkBase.PersistMode; -import com.revrobotics.spark.SparkBase.ResetMode; +import com.revrobotics.spark.SparkLowLevel.ControlType; +import com.revrobotics.PersistMode; +import com.revrobotics.ResetMode; import com.revrobotics.spark.SparkClosedLoopController; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; import com.revrobotics.spark.config.SparkMaxConfig; -import edu.wpi.first.math.MathUtil; -import edu.wpi.first.math.filter.Debouncer; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.units.measure.Angle; -import edu.wpi.first.units.measure.AngularVelocity; -import edu.wpi.first.units.measure.Current; -import edu.wpi.first.units.measure.Voltage; +import org.wpilib.math.util.MathUtil; +import org.wpilib.math.filter.Debouncer; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.util.Units; +import org.wpilib.units.measure.Angle; +import org.wpilib.units.measure.AngularVelocity; +import org.wpilib.units.measure.Current; +import org.wpilib.units.measure.Voltage; import frc.lib.utils.PhoenixUtil; import java.util.Queue; import java.util.function.DoubleSupplier; diff --git a/src/main/java/frc/robot/subsystems/drive/OdometryThread.java b/src/main/java/frc/robot/subsystems/drive/OdometryThread.java index 9b3b7f31a..505daa3bb 100644 --- a/src/main/java/frc/robot/subsystems/drive/OdometryThread.java +++ b/src/main/java/frc/robot/subsystems/drive/OdometryThread.java @@ -5,8 +5,8 @@ import com.ctre.phoenix6.StatusSignal; import com.revrobotics.REVLibError; import com.revrobotics.spark.SparkBase; -import edu.wpi.first.units.measure.Angle; -import edu.wpi.first.wpilibj.RobotController; +import org.wpilib.units.measure.Angle; +import org.wpilib.system.RobotController; import java.util.ArrayList; import java.util.List; import java.util.Queue; diff --git a/src/main/java/frc/robot/subsystems/indexer/Indexer.java b/src/main/java/frc/robot/subsystems/indexer/Indexer.java index 6f43a6785..521797c4c 100644 --- a/src/main/java/frc/robot/subsystems/indexer/Indexer.java +++ b/src/main/java/frc/robot/subsystems/indexer/Indexer.java @@ -2,13 +2,12 @@ import static frc.robot.subsystems.indexer.IndexerConstants.FEEDUP_VOLT; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import org.wpilib.command3.Command; +import org.wpilib.command3.Mechanism; import frc.robot.RobotState; import org.littletonrobotics.junction.Logger; -public class Indexer extends SubsystemBase { +public class Indexer implements Mechanism { private final IndexerIO io; private final IndexerIOInputsAutoLogged inputs = new IndexerIOInputsAutoLogged(); diff --git a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkMax.java b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkMax.java index 4536f6fdb..e9966b56e 100644 --- a/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkMax.java +++ b/src/main/java/frc/robot/subsystems/indexer/IndexerIOSparkMax.java @@ -4,8 +4,8 @@ import static frc.robot.subsystems.indexer.IndexerConstants.ENCODER_FEEDUP_POSITION_CONVERSION; import static frc.robot.subsystems.indexer.IndexerConstants.ENCODER_FEEDUP_VELOCITY_CONVERSION; -import com.revrobotics.spark.SparkBase.PersistMode; -import com.revrobotics.spark.SparkBase.ResetMode; +import com.revrobotics.PersistMode; +import com.revrobotics.ResetMode; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.EncoderConfig; diff --git a/src/main/java/frc/robot/subsystems/intake/Intake.java b/src/main/java/frc/robot/subsystems/intake/Intake.java index 4d41fba74..80968f642 100644 --- a/src/main/java/frc/robot/subsystems/intake/Intake.java +++ b/src/main/java/frc/robot/subsystems/intake/Intake.java @@ -2,8 +2,7 @@ import static frc.robot.subsystems.intake.IntakeConstants.*; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; +import org.wpilib.command3.Command; import frc.robot.subsystems.intake.extend.IntakeExtend; import frc.robot.subsystems.intake.rollers.IntakeRollers; diff --git a/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtend.java b/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtend.java index bbf147252..9516e27db 100644 --- a/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtend.java +++ b/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtend.java @@ -6,18 +6,16 @@ import static frc.robot.subsystems.intake.IntakeConstants.POSITION_TOLERANCE; import static frc.robot.subsystems.intake.IntakeConstants.STALL_VELOCITY; -import edu.wpi.first.wpilibj.Timer; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.ConditionalCommand; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import org.wpilib.system.Timer; +import org.wpilib.command2.Command; +import org.wpilib.command3.Mechanism; import frc.robot.RobotState; import frc.robot.RobotState.IntakePosition; import java.util.function.BooleanSupplier; import java.util.function.DoubleSupplier; import org.littletonrobotics.junction.Logger; -public class IntakeExtend extends SubsystemBase { +public class IntakeExtend implements Mechanism { private final IntakeExtendIO io; private final IntakeExtendIOInputsAutoLogged inputs = new IntakeExtendIOInputsAutoLogged(); private final Timer stallExtendTimer = new Timer(); diff --git a/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtendIOKraken.java b/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtendIOKraken.java index 814cfc72f..75adae735 100644 --- a/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtendIOKraken.java +++ b/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtendIOKraken.java @@ -13,16 +13,16 @@ import com.ctre.phoenix6.signals.InvertedValue; import com.ctre.phoenix6.signals.NeutralModeValue; import com.revrobotics.RelativeEncoder; -import com.revrobotics.spark.SparkBase.ControlType; -import com.revrobotics.spark.SparkBase.PersistMode; -import com.revrobotics.spark.SparkBase.ResetMode; +import com.revrobotics.spark.SparkLowLevel.ControlType; +import com.revrobotics.PersistMode; +import com.revrobotics.ResetMode; import com.revrobotics.spark.SparkClosedLoopController; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.EncoderConfig; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; import com.revrobotics.spark.config.SparkMaxConfig; -import edu.wpi.first.wpilibj.DigitalInput; +import org.wpilib.hardware.discrete.DigitalInput; public class IntakeExtendIOKraken implements IntakeExtendIO { private final SparkMax extendMotor; diff --git a/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtendIOSparkMax.java b/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtendIOSparkMax.java index c21bc77d9..7d67a3cb1 100644 --- a/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtendIOSparkMax.java +++ b/src/main/java/frc/robot/subsystems/intake/extend/IntakeExtendIOSparkMax.java @@ -11,16 +11,16 @@ import com.revrobotics.RelativeEncoder; import com.revrobotics.spark.FeedbackSensor; -import com.revrobotics.spark.SparkBase.ControlType; -import com.revrobotics.spark.SparkBase.PersistMode; -import com.revrobotics.spark.SparkBase.ResetMode; +import com.revrobotics.spark.SparkLowLevel.ControlType; +import com.revrobotics.PersistMode; +import com.revrobotics.ResetMode; import com.revrobotics.spark.SparkClosedLoopController; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.EncoderConfig; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; import com.revrobotics.spark.config.SparkMaxConfig; -import edu.wpi.first.wpilibj.DigitalInput; +import org.wpilib.hardware.discrete.DigitalInput; public class IntakeExtendIOSparkMax implements IntakeExtendIO { diff --git a/src/main/java/frc/robot/subsystems/intake/rollers/IntakeRollers.java b/src/main/java/frc/robot/subsystems/intake/rollers/IntakeRollers.java index 0cec68ba6..073ad9d3b 100644 --- a/src/main/java/frc/robot/subsystems/intake/rollers/IntakeRollers.java +++ b/src/main/java/frc/robot/subsystems/intake/rollers/IntakeRollers.java @@ -3,13 +3,12 @@ import static frc.robot.subsystems.intake.IntakeConstants.INTAKE_VOLTS; import static frc.robot.subsystems.intake.IntakeConstants.OUTTAKE_VOLTS; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import org.wpilib.command3.Command; import frc.robot.RobotState; import org.littletonrobotics.junction.Logger; +import org.wpilib.command3.Mechanism; -public class IntakeRollers extends SubsystemBase { +public class IntakeRollers implements Mechanism { private final IntakeRollersIO io; private final IntakeRollersIOInputsAutoLogged inputs = new IntakeRollersIOInputsAutoLogged(); diff --git a/src/main/java/frc/robot/subsystems/intake/rollers/IntakeRollersIOKraken.java b/src/main/java/frc/robot/subsystems/intake/rollers/IntakeRollersIOKraken.java index cbe116e01..f782a9369 100644 --- a/src/main/java/frc/robot/subsystems/intake/rollers/IntakeRollersIOKraken.java +++ b/src/main/java/frc/robot/subsystems/intake/rollers/IntakeRollersIOKraken.java @@ -10,8 +10,8 @@ import com.ctre.phoenix6.hardware.TalonFX; import com.ctre.phoenix6.signals.InvertedValue; import com.ctre.phoenix6.signals.NeutralModeValue; -import edu.wpi.first.units.measure.Current; -import edu.wpi.first.units.measure.Voltage; +import org.wpilib.units.measure.Current; +import org.wpilib.units.measure.Voltage; public class IntakeRollersIOKraken implements IntakeRollersIO { diff --git a/src/main/java/frc/robot/subsystems/leds/LedPatterns.java b/src/main/java/frc/robot/subsystems/leds/LedPatterns.java index 21b4f6f7b..2b7d9d4a4 100644 --- a/src/main/java/frc/robot/subsystems/leds/LedPatterns.java +++ b/src/main/java/frc/robot/subsystems/leds/LedPatterns.java @@ -1,12 +1,12 @@ package frc.robot.subsystems.leds; -import static edu.wpi.first.units.Units.Meters; -import static edu.wpi.first.units.Units.MetersPerSecond; -import static edu.wpi.first.units.Units.Seconds; +import static org.wpilib.units.Units.Meters; +import static org.wpilib.units.Units.MetersPerSecond; +import static org.wpilib.units.Units.Seconds; -import edu.wpi.first.units.measure.Distance; -import edu.wpi.first.wpilibj.LEDPattern; -import edu.wpi.first.wpilibj.util.Color; +import org.wpilib.units.measure.Distance; +import org.wpilib.hardware.led.LEDPattern; +import org.wpilib.util.Color; import java.util.Map; public enum LedPatterns { diff --git a/src/main/java/frc/robot/subsystems/leds/Leds.java b/src/main/java/frc/robot/subsystems/leds/Leds.java index c4f7d94e1..fe82de816 100644 --- a/src/main/java/frc/robot/subsystems/leds/Leds.java +++ b/src/main/java/frc/robot/subsystems/leds/Leds.java @@ -1,23 +1,27 @@ package frc.robot.subsystems.leds; -import edu.wpi.first.networktables.GenericEntry; -import edu.wpi.first.wpilibj.AddressableLED; -import edu.wpi.first.wpilibj.AddressableLED.ColorOrder; -import edu.wpi.first.wpilibj.AddressableLEDBuffer; -import edu.wpi.first.wpilibj.AddressableLEDBufferView; -import edu.wpi.first.wpilibj.LEDPattern; -import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; -import edu.wpi.first.wpilibj.shuffleboard.BuiltInWidgets; -import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; -import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; -import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; -import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import org.wpilib.command3.Mechanism; +import org.wpilib.networktables.GenericEntry; +import org.wpilib.hardware.led.AddressableLED; +import org.wpilib.hardware.led.AddressableLED.ColorOrder; +import org.wpilib.hardware.led.AddressableLEDBuffer; +import org.wpilib.hardware.led.AddressableLEDBufferView; +import org.wpilib.hardware.led.LEDPattern; + +// (Begin): Removed or replaced +import org.wpilib.wpilibj.shuffleboard.BuiltInLayouts; +import org.wpilib.wpilibj.shuffleboard.BuiltInWidgets; +import org.wpilib.wpilibj.shuffleboard.Shuffleboard; +import org.wpilib.wpilibj.shuffleboard.ShuffleboardLayout; +import org.wpilib.wpilibj.shuffleboard.ShuffleboardTab; +// (End): Removed or replaced + +import org.wpilib.smartdashboard.SendableChooser; import frc.robot.Robot; import frc.robot.RobotState; import frc.robot.RobotState.Mode; -public class Leds extends SubsystemBase { +public class Leds implements Mechanism { private static final boolean debug = false; private RobotState state = RobotState.getInstance(); private final AddressableLED leds; diff --git a/src/main/java/frc/robot/subsystems/magicCarpet/MagicCarpet.java b/src/main/java/frc/robot/subsystems/magicCarpet/MagicCarpet.java index 3b49a1522..13da0f95c 100644 --- a/src/main/java/frc/robot/subsystems/magicCarpet/MagicCarpet.java +++ b/src/main/java/frc/robot/subsystems/magicCarpet/MagicCarpet.java @@ -1,11 +1,11 @@ package frc.robot.subsystems.magicCarpet; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import org.wpilib.command3.Command; import frc.robot.RobotState; import org.littletonrobotics.junction.Logger; +import frc.lib.SubsystemBase; + public class MagicCarpet extends SubsystemBase { private final MagicCarpetIO io; private final MagicCarpetIOInputsAutoLogged inputs = new MagicCarpetIOInputsAutoLogged(); @@ -27,19 +27,22 @@ public MagicCarpet(MagicCarpetIO io) { * @return A command to run the magic carpet at a constant speed */ public Command run() { - return setManualControl(true) - .andThen(Commands.run(() -> io.setSpeed(MagicCarpetConstants.BELT_SPEED), this)) - .finallyDo(() -> setManualControl(false).schedule()) - .withName("start"); + return this.run( + coro -> { + io.setSpeed(MagicCarpetConstants.BELT_SPEED); + coro.fork(setManualControl(false)); + } + ).named("MagicCarpet Start"); } + /** * Control whether to run magic carpet through commands or periodic * * @param manual Call run manually instead of through periodic */ public Command setManualControl(boolean manual) { - return Commands.runOnce(() -> this.manualRun = manual, this); + return this.run(_ -> this.manualRun = manual).named("MagicCarpet SetManualControl"); } @Override diff --git a/src/main/java/frc/robot/subsystems/magicCarpet/MagicCarpetSparkMax.java b/src/main/java/frc/robot/subsystems/magicCarpet/MagicCarpetSparkMax.java index f87337a63..358295b05 100644 --- a/src/main/java/frc/robot/subsystems/magicCarpet/MagicCarpetSparkMax.java +++ b/src/main/java/frc/robot/subsystems/magicCarpet/MagicCarpetSparkMax.java @@ -4,13 +4,14 @@ package frc.robot.subsystems.magicCarpet; import com.revrobotics.RelativeEncoder; -import com.revrobotics.spark.SparkBase.PersistMode; -import com.revrobotics.spark.SparkBase.ResetMode; +import com.revrobotics.PersistMode; +import com.revrobotics.ResetMode; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; import com.revrobotics.spark.config.SparkMaxConfig; -import edu.wpi.first.math.MathUtil; +import org.wpilib.hardware.bus.CANPort; +import org.wpilib.math.util.MathUtil; import frc.robot.Schematic; public class MagicCarpetSparkMax implements MagicCarpetIO { @@ -20,7 +21,7 @@ public class MagicCarpetSparkMax implements MagicCarpetIO { public MagicCarpetSparkMax() { - motor = new SparkMax(Schematic.magicCarpetCanId, MotorType.kBrushless); + motor = new SparkMax(CANPort.CAN_D0, Schematic.magicCarpetCanId, MotorType.kBrushless); SparkMaxConfig config = new SparkMaxConfig(); config @@ -37,15 +38,14 @@ public MagicCarpetSparkMax() { @Override public void updateInputs(MagicCarpetIOInputs inputs) { // Called every 20 ms by subsystem periodic - inputs.appliedVolts = motor.getAppliedOutput() * motor.getBusVoltage(); - inputs.currentAmps = motor.getOutputCurrent(); - inputs.motorVelocity = encoder.getVelocity(); + inputs.appliedVolts = motor.getAppliedOutput().get() * motor.getBusVoltage().get(); + inputs.currentAmps = motor.getOutputCurrent().get(); + inputs.motorVelocity = encoder.getVelocity().get(); } @Override public void setSpeed(double speed) { - - motor.set(MathUtil.clamp(speed, 0.0, 1.0)); // so the is between 0 and 1, 1==100% + motor.setVoltage(MagicCarpetConstants.CURRENT_LIMIT * Math.clamp(speed, 0.0, 1.0)); } /** @@ -53,6 +53,6 @@ public void setSpeed(double speed) { */ @Override public void stop() { - motor.set(0.0); + motor.setVoltage(0); } } diff --git a/src/main/java/frc/robot/subsystems/shooter/Shooter.java b/src/main/java/frc/robot/subsystems/shooter/Shooter.java index 80c857bb0..864adae0f 100644 --- a/src/main/java/frc/robot/subsystems/shooter/Shooter.java +++ b/src/main/java/frc/robot/subsystems/shooter/Shooter.java @@ -1,33 +1,29 @@ package frc.robot.subsystems.shooter; -import static edu.wpi.first.units.Units.*; -import static edu.wpi.first.units.Units.Second; -import static edu.wpi.first.units.Units.Volts; +import static org.wpilib.units.Units.*; +import static org.wpilib.units.Units.Second; +import static org.wpilib.units.Units.Volts; import static frc.robot.subsystems.shooter.ShooterConstants.FF_SCALAR; import static frc.robot.subsystems.shooter.ShooterConstants.KA; import static frc.robot.subsystems.shooter.ShooterConstants.KS; import static frc.robot.subsystems.shooter.ShooterConstants.KV; import static frc.robot.subsystems.shooter.ShooterConstants.TOLERANCE; -import edu.wpi.first.math.controller.PIDController; -import edu.wpi.first.math.controller.SimpleMotorFeedforward; -import edu.wpi.first.math.filter.SlewRateLimiter; -import edu.wpi.first.units.*; -import edu.wpi.first.units.measure.AngularVelocity; -import edu.wpi.first.units.measure.Distance; -import edu.wpi.first.units.measure.Time; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.SubsystemBase; -import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine; -import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Config; -import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Mechanism; +import org.wpilib.math.controller.PIDController; +import org.wpilib.math.controller.SimpleMotorFeedforward; +import org.wpilib.math.filter.SlewRateLimiter; +import org.wpilib.units.*; +import org.wpilib.units.measure.AngularVelocity; +import org.wpilib.units.measure.Distance; +import org.wpilib.units.measure.Time; +import org.wpilib.smartdashboard.SmartDashboard; +import org.wpilib.command3.Command; +import org.wpilib.command3.Mechanism; import frc.robot.RobotState; import java.util.function.Supplier; import org.littletonrobotics.junction.Logger; -public class Shooter extends SubsystemBase { +public class Shooter implements Mechanism { private final ShooterIO io; private final ShooterIOInputsAutoLogged inputs = new ShooterIOInputsAutoLogged(); private final SysIdRoutine sysId; diff --git a/src/main/java/frc/robot/subsystems/shooter/ShooterConstants.java b/src/main/java/frc/robot/subsystems/shooter/ShooterConstants.java index f784e5bea..98eff4b4c 100644 --- a/src/main/java/frc/robot/subsystems/shooter/ShooterConstants.java +++ b/src/main/java/frc/robot/subsystems/shooter/ShooterConstants.java @@ -1,10 +1,10 @@ package frc.robot.subsystems.shooter; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.geometry.Transform2d; -import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.math.util.Units; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Transform2d; +import org.wpilib.math.geometry.Translation2d; +import org.wpilib.math.util.Units; public class ShooterConstants { public static final double ENCODER_POSITION_CONVERSION = 1; diff --git a/src/main/java/frc/robot/subsystems/shooter/ShooterIOSparkMax.java b/src/main/java/frc/robot/subsystems/shooter/ShooterIOSparkMax.java index 17cb653a8..742ba0ee6 100644 --- a/src/main/java/frc/robot/subsystems/shooter/ShooterIOSparkMax.java +++ b/src/main/java/frc/robot/subsystems/shooter/ShooterIOSparkMax.java @@ -7,8 +7,8 @@ import static frc.robot.subsystems.shooter.ShooterConstants.*; import com.revrobotics.RelativeEncoder; -import com.revrobotics.spark.SparkBase.PersistMode; -import com.revrobotics.spark.SparkBase.ResetMode; +import com.revrobotics.PersistMode; +import com.revrobotics.ResetMode; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.EncoderConfig; diff --git a/src/main/java/frc/robot/subsystems/vision/Vision.java b/src/main/java/frc/robot/subsystems/vision/Vision.java index 51b86e592..6537e8f4e 100644 --- a/src/main/java/frc/robot/subsystems/vision/Vision.java +++ b/src/main/java/frc/robot/subsystems/vision/Vision.java @@ -2,22 +2,22 @@ import static frc.robot.subsystems.vision.VisionConstants.*; -import edu.wpi.first.math.Matrix; -import edu.wpi.first.math.VecBuilder; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Pose3d; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.numbers.N1; -import edu.wpi.first.math.numbers.N3; -import edu.wpi.first.wpilibj.Alert; -import edu.wpi.first.wpilibj.Alert.AlertType; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import org.wpilib.command3.Mechanism; +import org.wpilib.util.Alert.Level; +import org.wpilib.math.linalg.Matrix; +import org.wpilib.math.linalg.VecBuilder; +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.util.Alert; import frc.robot.RobotState; import java.util.LinkedList; import java.util.List; import org.littletonrobotics.junction.Logger; -public class Vision extends SubsystemBase { +public class Vision implements Mechanism { private final VisionConsumer consumer; private final VisionIO[] io; private final VisionIOInputsAutoLogged[] inputs; @@ -38,7 +38,7 @@ public Vision(VisionConsumer consumer, VisionIO... io) { 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.", Level.MEDIUM); } } diff --git a/src/main/java/frc/robot/subsystems/vision/VisionConstants.java b/src/main/java/frc/robot/subsystems/vision/VisionConstants.java index 463e6ce91..17953bf11 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionConstants.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionConstants.java @@ -1,10 +1,10 @@ package frc.robot.subsystems.vision; -import edu.wpi.first.apriltag.AprilTagFieldLayout; -import edu.wpi.first.math.geometry.Rotation3d; -import edu.wpi.first.math.geometry.Transform3d; -import edu.wpi.first.math.geometry.Translation3d; -import edu.wpi.first.math.util.Units; +import org.wpilib.vision.apriltag.AprilTagFieldLayout; +import org.wpilib.math.geometry.Rotation3d; +import org.wpilib.math.geometry.Transform3d; +import org.wpilib.math.geometry.Translation3d; +import org.wpilib.math.util.Units; import frc.robot.FieldConstants; public class VisionConstants { diff --git a/src/main/java/frc/robot/subsystems/vision/VisionIO.java b/src/main/java/frc/robot/subsystems/vision/VisionIO.java index 64ca15120..3e2cf2c41 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionIO.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionIO.java @@ -1,7 +1,7 @@ package frc.robot.subsystems.vision; -import edu.wpi.first.math.geometry.Pose3d; -import edu.wpi.first.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Pose3d; +import org.wpilib.math.geometry.Rotation2d; import org.littletonrobotics.junction.AutoLog; public interface VisionIO { diff --git a/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVision.java b/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVision.java index 0832ee9e1..9f3015d7b 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVision.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVision.java @@ -2,9 +2,9 @@ import static frc.robot.subsystems.vision.VisionConstants.*; -import edu.wpi.first.math.geometry.Pose3d; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.math.geometry.Transform3d; +import org.wpilib.math.geometry.Pose3d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Transform3d; import java.util.HashSet; import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVisionSim.java b/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVisionSim.java index 973025523..97a6eb365 100644 --- a/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVisionSim.java +++ b/src/main/java/frc/robot/subsystems/vision/VisionIOPhotonVisionSim.java @@ -2,8 +2,8 @@ import static frc.robot.subsystems.vision.VisionConstants.aprilTagLayout; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Transform3d; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Transform3d; import java.util.function.Supplier; import org.photonvision.simulation.PhotonCameraSim; import org.photonvision.simulation.SimCameraProperties; diff --git a/src/main/java/frc/robot/util/CustomTriggers.java b/src/main/java/frc/robot/util/CustomTriggers.java index f1abc88d8..c229f235d 100644 --- a/src/main/java/frc/robot/util/CustomTriggers.java +++ b/src/main/java/frc/robot/util/CustomTriggers.java @@ -1,7 +1,7 @@ package frc.robot.util; -import edu.wpi.first.wpilibj2.command.CommandScheduler; -import edu.wpi.first.wpilibj2.command.button.Trigger; +import org.wpilib.command2.CommandScheduler; +import org.wpilib.command2.button.Trigger; import java.util.HashMap; import java.util.Map; import java.util.function.BooleanSupplier; diff --git a/src/main/java/frc/robot/util/ShooterLeadCompensator.java b/src/main/java/frc/robot/util/ShooterLeadCompensator.java index ccaecb1dc..66ce5d290 100644 --- a/src/main/java/frc/robot/util/ShooterLeadCompensator.java +++ b/src/main/java/frc/robot/util/ShooterLeadCompensator.java @@ -1,12 +1,12 @@ package frc.robot.util; -import static edu.wpi.first.units.Units.Meters; -import static edu.wpi.first.units.Units.Seconds; +import static org.wpilib.units.Units.Meters; +import static org.wpilib.units.Units.Seconds; -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.units.measure.Time; +import org.wpilib.math.geometry.Pose2d; +import org.wpilib.math.geometry.Rotation2d; +import org.wpilib.math.geometry.Translation2d; +import org.wpilib.units.measure.Time; import frc.robot.subsystems.drive.Drive; import frc.robot.subsystems.shooter.Shooter; import frc.robot.subsystems.shooter.ShooterConstants; @@ -32,8 +32,8 @@ public ShooterLeadCompensator(Drive drive, Shooter shooter) { this.robotVelocity = () -> new Translation2d( - drive.getChassisSpeeds().vxMetersPerSecond, - drive.getChassisSpeeds().vyMetersPerSecond); + drive.getChassisVelocities().vxMetersPerSecond, + drive.getChassisVelocities().vyMetersPerSecond); this.shooter = shooter; } diff --git a/src/main/java/frc/robot/util/Zone.java b/src/main/java/frc/robot/util/Zone.java index 3862daccd..140a482bf 100644 --- a/src/main/java/frc/robot/util/Zone.java +++ b/src/main/java/frc/robot/util/Zone.java @@ -1,6 +1,6 @@ package frc.robot.util; -import edu.wpi.first.math.geometry.Pose2d; +import org.wpilib.math.geometry.Pose2d; import frc.lib.utils.AllianceFlipUtil; import java.util.Objects; import java.util.function.Supplier; diff --git a/vendordeps/AdvantageKit.json b/vendordeps/AdvantageKit.json index 2faa4db80..c923bbef2 100644 --- a/vendordeps/AdvantageKit.json +++ b/vendordeps/AdvantageKit.json @@ -1,9 +1,9 @@ { "fileName": "AdvantageKit.json", "name": "AdvantageKit", - "version": "26.0.0", + "version": "27.0.0-alpha-4", "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", - "frcYear": "2026", + "wpilibYear": "2027_alpha7", "mavenUrls": [ "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" ], @@ -12,18 +12,18 @@ { "groupId": "org.littletonrobotics.akit", "artifactId": "akit-java", - "version": "26.0.0" + "version": "27.0.0-alpha-4" } ], "jniDependencies": [ { "groupId": "org.littletonrobotics.akit", "artifactId": "akit-wpilibio", - "version": "26.0.0", + "version": "27.0.0-alpha-4", "skipInvalidPlatforms": false, "isJar": false, "validPlatforms": [ - "linuxathena", + "linuxsystemcore", "linuxx86-64", "linuxarm64", "osxuniversal", diff --git a/vendordeps/CommandsV3.json b/vendordeps/CommandsV3.json new file mode 100644 index 000000000..7b118ed77 --- /dev/null +++ b/vendordeps/CommandsV3.json @@ -0,0 +1,25 @@ +{ + "fileName": "CommandsV3.json", + "name": "Commands v3", + "version": "1.0.0", + "uuid": "4decdc05-a056-46cf-9561-39449bbb0130", + "wpilibYear": "2027_alpha7", + "mavenUrls": [], + "jsonUrl": "", + "conflictsWith": [ + { + "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266", + "errorMessage": "Users can not have both Commands v2 and Commands v3 vendordeps in their robot program.", + "offlineFileName": "CommandsV2.json" + } + ], + "javaDependencies": [ + { + "groupId": "org.wpilib", + "artifactId": "commandsv3-java", + "version": "wpilib" + } + ], + "jniDependencies": [], + "cppDependencies": [] +} \ No newline at end of file diff --git a/vendordeps/PathplannerLib.json b/vendordeps/PathplannerLib.json index 6d78d24b4..0c94a9ce6 100644 --- a/vendordeps/PathplannerLib.json +++ b/vendordeps/PathplannerLib.json @@ -1,18 +1,18 @@ { - "fileName": "PathplannerLib.json", + "fileName": "PathplannerLibSystemCoreAlpha.json", "name": "PathplannerLib", - "version": "2026.1.2", + "version": "2027.0.0-alpha-3", "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", - "frcYear": "2026", + "wpilibYear": "2027_alpha7", "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-3" } ], "jniDependencies": [], @@ -20,7 +20,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-cpp", - "version": "2026.1.2", + "version": "2027.0.0-alpha-3", "libName": "PathplannerLib", "headerClassifier": "headers", "sharedLibrary": false, @@ -29,8 +29,7 @@ "windowsx86-64", "linuxx86-64", "osxuniversal", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "linuxarm64" ] } diff --git a/vendordeps/Phoenix6.json b/vendordeps/Phoenix6.json index 328a963c2..0f8d5a4cd 100644 --- a/vendordeps/Phoenix6.json +++ b/vendordeps/Phoenix6.json @@ -1,60 +1,60 @@ { - "fileName": "Phoenix6-frc2026-latest.json", + "fileName": "Phoenix6-26.50.0-alpha-1.json", "name": "CTRE-Phoenix (v6)", - "version": "26.1.0", - "frcYear": "2026", + "version": "26.50.0-alpha-1", + "wpilibYear": "2027_alpha7", "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-frc2027-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" + "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.1.0" + "version": "26.50.0-alpha-1" } ], "jniDependencies": [ { "groupId": "com.ctre.phoenix6", "artifactId": "api-cpp", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", "linuxarm64", - "linuxathena" + "linuxsystemcore" ], "simMode": "hwsim" }, { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "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.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -68,7 +68,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -82,7 +82,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -96,7 +96,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -110,7 +110,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -124,7 +124,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -138,7 +138,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFXS", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -152,7 +152,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -166,7 +166,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -180,7 +180,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANrange", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -194,7 +194,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdi", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -208,7 +208,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdle", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -224,7 +224,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-cpp", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "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.1.0", + "version": "26.50.0-alpha-1", "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.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_Phoenix6_WPISim", "headerClassifier": "headers", "sharedLibrary": true, @@ -272,7 +272,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_PhoenixTools_Sim", "headerClassifier": "headers", "sharedLibrary": true, @@ -288,7 +288,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_SimTalonSRX", "headerClassifier": "headers", "sharedLibrary": true, @@ -304,7 +304,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_SimVictorSPX", "headerClassifier": "headers", "sharedLibrary": true, @@ -320,7 +320,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_SimPigeonIMU", "headerClassifier": "headers", "sharedLibrary": true, @@ -336,7 +336,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_SimProTalonFX", "headerClassifier": "headers", "sharedLibrary": true, @@ -352,7 +352,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFXS", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_SimProTalonFXS", "headerClassifier": "headers", "sharedLibrary": true, @@ -368,7 +368,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_SimProCANcoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -384,7 +384,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_SimProPigeon2", "headerClassifier": "headers", "sharedLibrary": true, @@ -400,7 +400,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANrange", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_SimProCANrange", "headerClassifier": "headers", "sharedLibrary": true, @@ -416,7 +416,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdi", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_SimProCANdi", "headerClassifier": "headers", "sharedLibrary": true, @@ -432,7 +432,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdle", - "version": "26.1.0", + "version": "26.50.0-alpha-1", "libName": "CTRE_SimProCANdle", "headerClassifier": "headers", "sharedLibrary": true, diff --git a/vendordeps/REVLib.json b/vendordeps/REVLib.json index bb613bf67..773db168c 100644 --- a/vendordeps/REVLib.json +++ b/vendordeps/REVLib.json @@ -1,63 +1,60 @@ { "fileName": "REVLib.json", "name": "REVLib", - "version": "2026.0.1", - "frcYear": "2026", + "version": "2027.0.0-alpha-7", + "wpilibYear": "2027_alpha7", "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.1" + "version": "2027.0.0-alpha-7" } ], "jniDependencies": [ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2026.0.1", + "version": "2027.0.0-alpha-7", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] }, { "groupId": "com.revrobotics.frc", "artifactId": "RevLibBackendDriver", - "version": "2026.0.1", + "version": "2027.0.0-alpha-7", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] }, { "groupId": "com.revrobotics.frc", "artifactId": "RevLibWpiBackendDriver", - "version": "2026.0.1", + "version": "2027.0.0-alpha-7", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] } @@ -66,7 +63,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-cpp", - "version": "2026.0.1", + "version": "2027.0.0-alpha-7", "libName": "REVLib", "headerClassifier": "headers", "sharedLibrary": false, @@ -75,15 +72,14 @@ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] }, { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2026.0.1", + "version": "2027.0.0-alpha-7", "libName": "REVLibDriver", "headerClassifier": "headers", "sharedLibrary": false, @@ -92,15 +88,14 @@ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] }, { "groupId": "com.revrobotics.frc", "artifactId": "RevLibBackendDriver", - "version": "2026.0.1", + "version": "2027.0.0-alpha-7", "libName": "BackendDriver", "sharedLibrary": true, "skipInvalidPlatforms": true, @@ -108,15 +103,14 @@ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] }, { "groupId": "com.revrobotics.frc", "artifactId": "RevLibWpiBackendDriver", - "version": "2026.0.1", + "version": "2027.0.0-alpha-7", "libName": "REVLibWpi", "sharedLibrary": true, "skipInvalidPlatforms": true, @@ -124,8 +118,7 @@ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] } diff --git a/vendordeps/URCL.json b/vendordeps/URCL.json deleted file mode 100644 index f5b535e53..000000000 --- a/vendordeps/URCL.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "fileName": "URCL.json", - "name": "URCL", - "version": "2026.0.0", - "frcYear": "2026", - "uuid": "84246d17-a797-4d1e-bd9f-c59cd8d2477c", - "mavenUrls": [ - "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" - ], - "jsonUrl": "https://raw.githubusercontent.com/Mechanical-Advantage/URCL/main/URCL.json", - "javaDependencies": [ - { - "groupId": "org.littletonrobotics.urcl", - "artifactId": "URCL-java", - "version": "2026.0.0" - } - ], - "jniDependencies": [ - { - "groupId": "org.littletonrobotics.urcl", - "artifactId": "URCL-driver", - "version": "2026.0.0", - "skipInvalidPlatforms": true, - "isJar": false, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena", - "osxuniversal" - ] - } - ], - "cppDependencies": [ - { - "groupId": "org.littletonrobotics.urcl", - "artifactId": "URCL-cpp", - "version": "2026.0.0", - "libName": "URCL", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena", - "osxuniversal" - ] - }, - { - "groupId": "org.littletonrobotics.urcl", - "artifactId": "URCL-driver", - "version": "2026.0.0", - "libName": "URCLDriver", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxathena", - "osxuniversal" - ] - } - ] -} diff --git a/vendordeps/WPILibNewCommands.json b/vendordeps/WPILibNewCommands.json deleted file mode 100644 index c54ae11fa..000000000 --- a/vendordeps/WPILibNewCommands.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "fileName": "WPILibNewCommands.json", - "name": "WPILib-New-Commands", - "version": "1.0.0", - "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266", - "frcYear": "2026", - "mavenUrls": [], - "jsonUrl": "", - "javaDependencies": [ - { - "groupId": "edu.wpi.first.wpilibNewCommands", - "artifactId": "wpilibNewCommands-java", - "version": "wpilib" - } - ], - "jniDependencies": [], - "cppDependencies": [ - { - "groupId": "edu.wpi.first.wpilibNewCommands", - "artifactId": "wpilibNewCommands-cpp", - "version": "wpilib", - "libName": "wpilibNewCommands", - "headerClassifier": "headers", - "sourcesClassifier": "sources", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena", - "linuxarm32", - "linuxarm64", - "windowsx86-64", - "windowsx86", - "linuxx86-64", - "osxuniversal" - ] - } - ] -} diff --git a/vendordeps/photonlib.json b/vendordeps/photonlib.json index 9326447d4..1cb9ff7c2 100644 --- a/vendordeps/photonlib.json +++ b/vendordeps/photonlib.json @@ -1,9 +1,9 @@ { "fileName": "photonlib.json", "name": "photonlib", - "version": "v2025.3.1", + "version": "v2027.0.0-alpha-2", "uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004", - "frcYear": "2026", + "wpilibYear": "2027_alpha7", "mavenUrls": [ "https://maven.photonvision.org/repository/internal", "https://maven.photonvision.org/repository/snapshots" @@ -13,12 +13,12 @@ { "groupId": "org.photonvision", "artifactId": "photontargeting-cpp", - "version": "v2026.1.1-rc-2", + "version": "v2027.0.0-alpha-2", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ "windowsx86-64", - "linuxathena", + "linuxsystemcore", "linuxx86-64", "osxuniversal" ] @@ -28,14 +28,14 @@ { "groupId": "org.photonvision", "artifactId": "photonlib-cpp", - "version": "v2026.1.1-rc-2", + "version": "v2027.0.0-alpha-2", "libName": "photonlib", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", - "linuxathena", + "linuxsystemcore", "linuxx86-64", "osxuniversal" ] @@ -43,14 +43,14 @@ { "groupId": "org.photonvision", "artifactId": "photontargeting-cpp", - "version": "v2026.1.1-rc-2", + "version": "v2027.0.0-alpha-2", "libName": "photontargeting", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", - "linuxathena", + "linuxsystemcore", "linuxx86-64", "osxuniversal" ] @@ -60,12 +60,12 @@ { "groupId": "org.photonvision", "artifactId": "photonlib-java", - "version": "v2026.1.1-rc-2" + "version": "v2027.0.0-alpha-2" }, { "groupId": "org.photonvision", "artifactId": "photontargeting-java", - "version": "v2026.1.1-rc-2" + "version": "v2027.0.0-alpha-2" } ] }