Class Util

java.lang.Object
frc.robot.util.Util

public class Util extends Object
Utility class for evaluating game-specific conditions and performing other geometry-related calculations.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Checks if the match is in the last 30 seconds of teleop.
    static boolean
    Evaluates if the hub is currently active.
    static boolean
    isHubEnabled(double seconds)
    Evaluate whether the hub will be enabled in N seconds.
    static boolean
    isHubEnabledAtTime(double time)
    Evaluates the game specific message to determine if the hub is enabled at a given match time.
    static boolean
    Checks if match mode is active.
    static boolean
    Checks if match mode is active only because of the SmartDashboard override toggle, not because a real FMS/timed match is running.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.