From f8120c8f1eb35ef1cdcd205c132cb95c2b6d82b2 Mon Sep 17 00:00:00 2001 From: SCool62 Date: Sat, 7 Mar 2026 09:27:14 -0800 Subject: [PATCH 1/2] Corrected swerve module config --- .../subsystems/swerve/SwerveSubsystem.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java b/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java index b3aba139..c9ba0f00 100644 --- a/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java @@ -1,5 +1,6 @@ package frc.robot.subsystems.swerve; +import static edu.wpi.first.units.Units.KilogramSquareMeters; import static edu.wpi.first.units.Units.Meter; import static edu.wpi.first.units.Units.Volts; @@ -73,7 +74,9 @@ import org.ironmaple.simulation.SimulatedArena; import org.ironmaple.simulation.drivesims.COTS; import org.ironmaple.simulation.drivesims.SwerveDriveSimulation; +import org.ironmaple.simulation.drivesims.SwerveModuleSimulation; import org.ironmaple.simulation.drivesims.configs.DriveTrainSimulationConfig; +import org.ironmaple.simulation.drivesims.configs.SwerveModuleSimulationConfig; import org.littletonrobotics.junction.AutoLogOutput; import org.littletonrobotics.junction.Logger; @@ -132,13 +135,19 @@ public class SwerveSubsystem extends SubsystemBase { DriveTrainSimulationConfig.Default() .withGyro(COTS.ofPigeon2()) .withSwerveModule( - COTS.ofMark4n( - DCMotor.getKrakenX60Foc(1), - DCMotor.getKrakenX60Foc(1), - // Still not sure where the 1.5 came from - 1.5, - // Running l2+ swerve modules - 2)) + new SwerveModuleSimulationConfig( + DCMotor.getKrakenX60Foc(1), + DCMotor.getKrakenX44Foc(1), + SWERVE_CONSTANTS.getDriveGearRatio(), + SWERVE_CONSTANTS.getTurnGearRatio(), + // These are from the maple sim cots module config for all modules (including mk5n) + Volts.of(0.1), + Volts.of(0.2), + Meter.of(SWERVE_CONSTANTS.getWheelRadiusMeters()), + // Also from cots config + KilogramSquareMeters.of(0.03), + 2.25) + ) .withTrackLengthTrackWidth( Meter.of(SwerveSubsystem.SWERVE_CONSTANTS.getTrackWidthX()), Meter.of(SwerveSubsystem.SWERVE_CONSTANTS.getTrackWidthY())) From ddc2d3144541ea9108ce7fe59e7ca31576b071f9 Mon Sep 17 00:00:00 2001 From: SCool62 Date: Sat, 7 Mar 2026 12:48:05 -0800 Subject: [PATCH 2/2] Spotless --- .../subsystems/swerve/SwerveSubsystem.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java b/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java index c9ba0f00..fb156ec0 100644 --- a/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java @@ -74,7 +74,6 @@ import org.ironmaple.simulation.SimulatedArena; import org.ironmaple.simulation.drivesims.COTS; import org.ironmaple.simulation.drivesims.SwerveDriveSimulation; -import org.ironmaple.simulation.drivesims.SwerveModuleSimulation; import org.ironmaple.simulation.drivesims.configs.DriveTrainSimulationConfig; import org.ironmaple.simulation.drivesims.configs.SwerveModuleSimulationConfig; import org.littletonrobotics.junction.AutoLogOutput; @@ -135,19 +134,19 @@ public class SwerveSubsystem extends SubsystemBase { DriveTrainSimulationConfig.Default() .withGyro(COTS.ofPigeon2()) .withSwerveModule( - new SwerveModuleSimulationConfig( - DCMotor.getKrakenX60Foc(1), - DCMotor.getKrakenX44Foc(1), - SWERVE_CONSTANTS.getDriveGearRatio(), - SWERVE_CONSTANTS.getTurnGearRatio(), - // These are from the maple sim cots module config for all modules (including mk5n) - Volts.of(0.1), - Volts.of(0.2), - Meter.of(SWERVE_CONSTANTS.getWheelRadiusMeters()), - // Also from cots config - KilogramSquareMeters.of(0.03), - 2.25) - ) + new SwerveModuleSimulationConfig( + DCMotor.getKrakenX60Foc(1), + DCMotor.getKrakenX44Foc(1), + SWERVE_CONSTANTS.getDriveGearRatio(), + SWERVE_CONSTANTS.getTurnGearRatio(), + // These are from the maple sim cots module config for all modules (including + // mk5n) + Volts.of(0.1), + Volts.of(0.2), + Meter.of(SWERVE_CONSTANTS.getWheelRadiusMeters()), + // Also from cots config + KilogramSquareMeters.of(0.03), + 2.25)) .withTrackLengthTrackWidth( Meter.of(SwerveSubsystem.SWERVE_CONSTANTS.getTrackWidthX()), Meter.of(SwerveSubsystem.SWERVE_CONSTANTS.getTrackWidthY()))