Package com.flarerobotics.lib
Class Utils
java.lang.Object
com.flarerobotics.lib.Utils
A static utility class for generic functions.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Field Details
-
EPSILON
public static final double EPSILON- See Also:
-
-
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.
-