Skip to content

Commit

Permalink
added new is sim logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Nummun14 committed Nov 11, 2024
1 parent 0841029 commit 2245cd8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/java/org/trigon/hardware/RobotHardwareStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ public class RobotHardwareStats {
private static boolean IS_REPLAY = false;
private static double PERIODIC_TIME_SECONDS = 0.02;

public static void setCurrentRobotStats(boolean isReal, boolean isSimulation, boolean isReplay) {
IS_SIMULATION = isSimulation && !isReal;
IS_REPLAY = isReplay && !isReal;
public static void setCurrentRobotStats(boolean isReal, ReplayType replayType) {
IS_SIMULATION = isReal || replayType.equals(ReplayType.NONE) ? !isReal : replayType.equals(ReplayType.SIMULATION_REPLAY);
IS_REPLAY = !isReal && !replayType.equals(ReplayType.NONE);
}

public static void setPeriodicTimeSeconds(double periodicTimeSeconds) {
Expand All @@ -25,4 +25,10 @@ public static boolean isReplay() {
public static boolean isSimulation() {
return IS_SIMULATION;
}
}

public enum ReplayType {
NONE,
SIMULATION_REPLAY,
REAL_REPLAY
}
}

0 comments on commit 2245cd8

Please sign in to comment.