Skip to content

Commit

Permalink
change Constants.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mpatankar6 committed Mar 30, 2024
1 parent 4f58bc5 commit 888a0c7
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,30 @@
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);
public static final String kDrivetrainCanBus = "CANivore1";
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()
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 888a0c7

Please sign in to comment.