From 2dc7f2d9ccb23c3a89bfc315c55de05bb56b670c Mon Sep 17 00:00:00 2001 From: spellingcat <70864274+spellingcat@users.noreply.github.com> Date: Sun, 25 Jan 2026 13:34:35 -0800 Subject: [PATCH 1/2] fix --- src/main/java/frc/robot/Robot.java | 34 ++++++++++++++----- .../subsystems/swerve/SwerveSubsystem.java | 9 +++-- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index d6d290e..a94a93f 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -78,19 +78,37 @@ public enum RobotEdition { public static final RobotMode ROBOT_MODE = Robot.isReal() ? RobotMode.REAL : RobotMode.SIM; // public static final RobotEdition ROBOT_EDITION = RobotEdition.COMP; public static final RobotEdition ROBOT_EDITION; + public static final RobotEdition SIM_ROBOT_EDITION = RobotEdition.ALPHA; + public static final RobotEdition REPLAY_ROBOT_EDITION = RobotEdition.ALPHA; - // TODO get rio serial numbers + // for replay to work properly this needs to match the edition in the log static { - switch (RobotController.getSerialNumber()) { - case "1": - ROBOT_EDITION = RobotEdition.ALPHA; + switch (ROBOT_MODE) { + case REAL: + switch (RobotController.getSerialNumber()) { + case "023D2BD2": + ROBOT_EDITION = RobotEdition.ALPHA; + break; + case "2": // TODO get comp rio serial number + ROBOT_EDITION = RobotEdition.COMP; + break; + default: + // defaulting to comp is probably safer? + ROBOT_EDITION = RobotEdition.COMP; + } break; - case "2": - ROBOT_EDITION = RobotEdition.COMP; + case SIM: + // you're gonna have to just lock in on this + ROBOT_EDITION = SIM_ROBOT_EDITION; break; + case REPLAY: + // you're gonna have to just lock in on this + ROBOT_EDITION = REPLAY_ROBOT_EDITION; + break; + default: - // defaulting to comp is probably safer? - ROBOT_EDITION = RobotEdition.COMP; + // TODO change to comp once there is a comp bot + ROBOT_EDITION = RobotEdition.ALPHA; } } diff --git a/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java b/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java index e422313..bd005a5 100644 --- a/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java @@ -27,13 +27,11 @@ import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Robot; -import frc.robot.Robot.RobotEdition; import frc.robot.Robot.RobotMode; import frc.robot.components.camera.Camera; import frc.robot.components.camera.CameraIOReal; import frc.robot.components.camera.CameraIOSim; import frc.robot.subsystems.swerve.constants.AlphaSwerveConstants; -import frc.robot.subsystems.swerve.constants.CompBotSwerveConstants; import frc.robot.subsystems.swerve.constants.SwerveConstants; import frc.robot.subsystems.swerve.gyro.GyroIO; import frc.robot.subsystems.swerve.gyro.GyroIOInputsAutoLogged; @@ -68,9 +66,10 @@ public class SwerveSubsystem extends SubsystemBase { // decide which set of swerve constants to use based on robot edition // defaulting to comp is probably safer? public static final SwerveConstants SWERVE_CONSTANTS = - Robot.ROBOT_EDITION == RobotEdition.ALPHA - ? new AlphaSwerveConstants() - : new CompBotSwerveConstants(); + // Robot.ROBOT_EDITION == RobotEdition.ALPHA + // ? new AlphaSwerveConstants() + // : new CompBotSwerveConstants(); + new AlphaSwerveConstants(); private final Module[] modules; // Front Left, Front Right, Back Left, Back Right private final GyroIO gyroIO; From 1a7b6f298256eb32c85ec05f58d07424a94020b6 Mon Sep 17 00:00:00 2001 From: spellingcat <70864274+spellingcat@users.noreply.github.com> Date: Sun, 25 Jan 2026 13:35:53 -0800 Subject: [PATCH 2/2] make swerve constants also do that --- .../frc/robot/subsystems/swerve/SwerveSubsystem.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java b/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java index bd005a5..e422313 100644 --- a/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java @@ -27,11 +27,13 @@ import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Robot; +import frc.robot.Robot.RobotEdition; import frc.robot.Robot.RobotMode; import frc.robot.components.camera.Camera; import frc.robot.components.camera.CameraIOReal; import frc.robot.components.camera.CameraIOSim; import frc.robot.subsystems.swerve.constants.AlphaSwerveConstants; +import frc.robot.subsystems.swerve.constants.CompBotSwerveConstants; import frc.robot.subsystems.swerve.constants.SwerveConstants; import frc.robot.subsystems.swerve.gyro.GyroIO; import frc.robot.subsystems.swerve.gyro.GyroIOInputsAutoLogged; @@ -66,10 +68,9 @@ public class SwerveSubsystem extends SubsystemBase { // decide which set of swerve constants to use based on robot edition // defaulting to comp is probably safer? public static final SwerveConstants SWERVE_CONSTANTS = - // Robot.ROBOT_EDITION == RobotEdition.ALPHA - // ? new AlphaSwerveConstants() - // : new CompBotSwerveConstants(); - new AlphaSwerveConstants(); + Robot.ROBOT_EDITION == RobotEdition.ALPHA + ? new AlphaSwerveConstants() + : new CompBotSwerveConstants(); private final Module[] modules; // Front Left, Front Right, Back Left, Back Right private final GyroIO gyroIO;