Package frc.lib.util
Class FaultUtil
java.lang.Object
frc.lib.util.FaultUtil
Utility class for parsing raw fault bitfields from REV hardware into readable strings. Ideal for
logging faults via AdvantageKit or SmartDashboard.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendCanandgyroFaults(StringBuilder sb, int faults) Appends Canandgyro faults to a StringBuilder based on bitfields.static voidappendGyroFaults(StringBuilder sb, GyroType type, int faults) Appends gyro faults to a StringBuilder based on the gyro type and fault flags.static voidappendNavXFaults(StringBuilder sb, int faults) Appends NavX faults to a StringBuilder based on bitfields.static voidappendPdhFaults(StringBuilder sb, int faults, boolean isSticky) Appends PDH faults to a StringBuilder based on bitfields.static voidappendSparkFaults(StringBuilder sb, int faults) Appends Spark Max faults to a StringBuilder based on bitfields.static voidappendSparkWarnings(StringBuilder sb, int warnings) Appends Spark Max warnings to a StringBuilder based on bitfields.
-
Method Details
-
appendSparkFaults
Appends Spark Max faults to a StringBuilder based on bitfields.- Parameters:
sb- The StringBuilder to append faults to.faults- The integer representing the fault flags.
-
appendSparkWarnings
Appends Spark Max warnings to a StringBuilder based on bitfields.- Parameters:
sb- The StringBuilder to append warnings to.warnings- The integer representing the warning flags.
-
appendPdhFaults
Appends PDH faults to a StringBuilder based on bitfields.- Parameters:
sb- The StringBuilder to append faults to.faults- The integer representing the fault flags.isSticky- Whether to append sticky faults.
-
appendCanandgyroFaults
Appends Canandgyro faults to a StringBuilder based on bitfields.- Parameters:
sb- The StringBuilder to append faults to.faults- The 8-bit integer representing the fault flags.
-
appendGyroFaults
Appends gyro faults to a StringBuilder based on the gyro type and fault flags.- Parameters:
sb- The StringBuilder to append faults to.type- The type of the gyro.faults- The integer representing the fault flags.
-