Skip to content

Commit

Permalink
fix recursive call error
Browse files Browse the repository at this point in the history
Idiot me...
  • Loading branch information
MEFThunders7035 committed Feb 27, 2024
1 parent 7260e5e commit a3c0590
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/frc/utils/sim_utils/ColorSensorV3Wrapped.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,31 @@ public static void setRGBD(int red, int green, int blue, int distance) {
public int getRed() {
// we check if getRed() is 0 because the color sensor returns 0 when its not being "simulated"
// as this is only used for unit tests.
if (RobotBase.isReal() || colorSensor == null || colorSensor.getRed() != 0) {
if (RobotBase.isReal() || colorSensor == null || super.getRed() != 0) {
return super.getRed();
}
return rgbd[0];
}

@Override
public int getGreen() {
if (RobotBase.isReal() || colorSensor == null || colorSensor.getGreen() != 0) {
if (RobotBase.isReal() || colorSensor == null || super.getGreen() != 0) {
return super.getGreen();
}
return rgbd[1];
}

@Override
public int getBlue() {
if (RobotBase.isReal() || colorSensor == null || colorSensor.getBlue() != 0) {
if (RobotBase.isReal() || colorSensor == null || super.getBlue() != 0) {
return super.getBlue();
}
return rgbd[2];
}

@Override
public int getProximity() {
if (RobotBase.isReal() || colorSensor == null || colorSensor.getProximity() != 0) {
if (RobotBase.isReal() || colorSensor == null || super.getProximity() != 0) {
return super.getProximity();
}
return rgbd[3];
Expand Down

0 comments on commit a3c0590

Please sign in to comment.