Package frc.robot.util
Class Util
java.lang.Object
frc.robot.util.Util
Utility class for evaluating game-specific conditions and performing other geometry-related
calculations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if the match is in the last 30 seconds of teleop.static booleanEvaluates if the hub is currently active.static booleanisHubEnabled(double seconds) Evaluate whether the hub will be enabled in N seconds.static booleanisHubEnabledAtTime(double time) Evaluates the game specific message to determine if the hub is enabled at a given match time.static booleanChecks if match mode is active.static booleanChecks if match mode is active only because of the SmartDashboard override toggle, not because a real FMS/timed match is running.
-
Method Details
-
isHubEnabledAtTime
public static boolean isHubEnabledAtTime(double time) Evaluates the game specific message to determine if the hub is enabled at a given match time.- Parameters:
time- The match time in seconds (counts down from 135 to 0).- Returns:
- True if the hub is enabled, false otherwise.
-
isHubEnabled
public static boolean isHubEnabled()Evaluates if the hub is currently active.- Returns:
- True if the hub is currently active.
-
isHubEnabled
public static boolean isHubEnabled(double seconds) Evaluate whether the hub will be enabled in N seconds.- Parameters:
seconds- The number of seconds in the future to check.- Returns:
- True if the hub will be enabled in N seconds, false otherwise.
-
isMatchMode
public static boolean isMatchMode()Checks if match mode is active. Match mode enables automatically when a match timer is running (FMS or driver station practice mode). It can also be forced on via the dashboard toggle for testing.- Returns:
- True when match mode is active.
-
isMatchModeOverridden
public static boolean isMatchModeOverridden()Checks if match mode is active only because of the SmartDashboard override toggle, not because a real FMS/timed match is running.- Returns:
- True when match mode is active only because of the dashboard override.
-
isEndgame
public static boolean isEndgame()Checks if the match is in the last 30 seconds of teleop.- Returns:
- True when the match is in the last 30 seconds of teleop.
-