Class HomingCheck
java.lang.Object
frc.spectrumLib.checks.HomingCheck
- All Implemented Interfaces:
Check
Every mechanism that relies on its position knows where it is.
A mechanism reports a HomingCheck.State. addMechanism(Mechanism) covers any soft-limited Mechanism from what it already tracks (Mechanism.isPositionLost()); a mechanism with its
own homing routine adds a supplier that maps that routine's state.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(String name, Supplier<HomingCheck.State> state) Adds a mechanism with a state of its own.voidAdds a mechanism by its reboot tracking.evaluate(double now) Judges the robot now.static HomingCheck.StateA mechanism's state from its reboot tracking alone.
-
Constructor Details
-
HomingCheck
public HomingCheck()
-
-
Method Details
-
add
Adds a mechanism with a state of its own.- Parameters:
name- its name in messagesstate- its homing state, from logged inputs
-
addMechanism
Adds a mechanism by its reboot tracking. Skipped unless it is attached and soft-limited (only then does its position matter).- Parameters:
m- the mechanism
-
stateOf
A mechanism's state from its reboot tracking alone. -
evaluate
Description copied from interface:CheckJudges the robot now. Called only while disabled, and not every loop:PreMatchChecksspreads the checks across loops.
-