Skip to content

Commit

Permalink
Detect simulations in feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
AceiusRedshift committed Mar 5, 2024
1 parent faf008f commit 9ae5241
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/
public final class Constants {
public static enum Bot {
WOOD_BOT, COMP_BOT
WOOD_BOT,
COMP_BOT,
SIM_BOT
}

public static final Bot currentBot;
Expand All @@ -36,6 +38,10 @@ public static enum Bot {
serialNumber = RobotBase.isReal() ? RobotController.getSerialNumber() : "simulation";

switch (serialNumber) {
case "simulation":
currentBot = Bot.SIM_BOT;
break;

case "03282B00": // Wood Bot Serial Number
currentBot = Bot.WOOD_BOT;
break;
Expand All @@ -50,6 +56,7 @@ public static enum Bot {
public static class HangConstants {
static {
switch (currentBot) {
case SIM_BOT:
case WOOD_BOT:
HAS_HANG = false;
break;
Expand Down Expand Up @@ -95,6 +102,7 @@ public static class DriverConstants {
public static class ArmConstants {
static {
switch (currentBot) {
case SIM_BOT:
case WOOD_BOT:
HAS_ARM = false;
break;
Expand Down Expand Up @@ -135,6 +143,7 @@ public static class ArmConstants {
public static class IntakeShooterConstants {
static {
switch (currentBot) {
case SIM_BOT:
case WOOD_BOT:
HAS_INTAKE = false;
break;
Expand Down Expand Up @@ -184,6 +193,7 @@ public static class SwerveModuleConstants {

static {
switch (currentBot) {
case SIM_BOT:
case WOOD_BOT:
// Front Left
VELOCITY_MOTOR_ID_FL = 41;
Expand Down Expand Up @@ -292,6 +302,7 @@ public static class SwerveModuleConstants {
public static class SwerveDrivetrainConstants {
static {
switch (currentBot) {
case SIM_BOT:
case WOOD_BOT:
MODULE_LOCATION_X = 26.0 / 100;
MODULE_LOCATION_Y = 28.5 / 100;
Expand Down

0 comments on commit 9ae5241

Please sign in to comment.