Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 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,15 @@ 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) {
if (isReal || replayType.equals(ReplayType.NONE)) {
IS_SIMULATION = !isReal;
IS_REPLAY = false;
return;
}

IS_SIMULATION = replayType.equals(ReplayType.SIMULATION_REPLAY);
IS_REPLAY = true;
}

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

public enum ReplayType {
NONE,
SIMULATION_REPLAY,
REAL_REPLAY
}
}
Loading