Class Utils

java.lang.Object
com.flarerobotics.lib.Utils

public class Utils extends Object
A static utility class for generic functions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    disableLoopOverrunWarnings(edu.wpi.first.wpilibj.IterativeRobotBase robot)
    Disables the "command loop overrun" warning.
    static boolean
    epsilonEquals(double a, double b)
    Returns whether a number is close to another number by a negligible amount (10^-6).
    static boolean
    setLoopOverrunTimeout(edu.wpi.first.wpilibj.IterativeRobotBase robot, double timeout)
    Sets the duration before a "command loop overrun" warning is thrown.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • epsilonEquals

      public static boolean epsilonEquals(double a, double b)
      Returns whether a number is close to another number by a negligible amount (10^-6).
      Parameters:
      a - The first number.
      b - The second number.
      Returns:
      True if roughly equal.
    • disableLoopOverrunWarnings

      public static boolean disableLoopOverrunWarnings(edu.wpi.first.wpilibj.IterativeRobotBase robot)
      Disables the "command loop overrun" warning.
      Parameters:
      robot - The main "Robot.java" class.
      Returns:
      True if successful.
    • setLoopOverrunTimeout

      public static boolean setLoopOverrunTimeout(edu.wpi.first.wpilibj.IterativeRobotBase robot, double timeout)
      Sets the duration before a "command loop overrun" warning is thrown.
      Parameters:
      robot - The main "Robot.java" class.
      timeout - The timeout in seconds.
      Returns:
      True if successful.