diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index f410d8e..30b20a5 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -7,21 +7,22 @@ import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.DriverStation.Alliance; import edu.wpi.first.wpilibj.Filesystem; +import edu.wpi.first.wpilibj.RobotController; import java.io.IOException; import java.nio.file.Path; import java.util.function.BooleanSupplier; public final class Constants { public static final Mode kCurrentMode = Mode.kReal; - public static final RobotName kRobot = RobotName.kBlackMamba; + public static final RobotName kRobot; - // static { - // final String rioSerialNumber = RobotController.getSerialNumber(); - // if (rioSerialNumber.equals(RobotName.kViper.rioSerialNumber)) kRobot = RobotName.kViper; - // else if (rioSerialNumber.equals(RobotName.kBlackMamba.rioSerialNumber)) - // kRobot = RobotName.kBlackMamba; - // else kRobot = RobotName.kBlackMamba; - // } + static { + final String rioSerialNumber = RobotController.getSerialNumber(); + if (rioSerialNumber.equals(RobotName.kViper.rioSerialNumber)) kRobot = RobotName.kBlackMamba; + else if (rioSerialNumber.equals(RobotName.kBlackMamba.rioSerialNumber)) + kRobot = RobotName.kBlackMamba; + else kRobot = RobotName.kBlackMamba; + } public static final boolean kIsViper = false; public static final boolean kIsSim = Constants.kCurrentMode.equals(Mode.kSim); @@ -29,7 +30,7 @@ public final class Constants { public static final String kSuperstructureCanBus = "CANivore2"; public static final boolean kInTuningMode = true; public static final Translation3d poseOffset = - new Translation3d(Units.inchesToMeters(0), 0.0, 0.0); + new Translation3d(Units.inchesToMeters(2.5), 0.0, 0.0); public static final BooleanSupplier onRedAllianceSupplier = () -> DriverStation.getAlliance().isPresent() @@ -62,7 +63,7 @@ public static enum RobotName { kViper("032380FD"), kBlackMamba("032243C9"); - public String rioSerialNumber; + public final String rioSerialNumber; private RobotName(String rioSerialNumber) { this.rioSerialNumber = rioSerialNumber;