Class AutoStartCheck
java.lang.Object
frc.spectrumLib.checks.AutoStartCheck
- All Implemented Interfaces:
Check
An auto is selected, its file loaded, and the robot sits on its starting pose (254 2025's "Near
Auto Starting Pose").
The pose comparison needs a multi-tag vision seed taken after the code last put the pose on the start. Before that the pose is only where the code put it, and comparing it with the start would compare the start with itself, so the check warns that the start is unverified.
Once the robot is enabled it stops comparing: the robot has driven, and the start of the path is history. It re-arms for the next match on a rising edge of FMS attach or a new match number, and then needs a fresh seed too.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhat the check needs, from logged inputs. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleHow long the robot must stay off the start before it fails: it may be being placed.static final doubleFarther than this from the start is the wrong spot, side or alliance.static final double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluate(double now) Judges the robot now.doubleDistance from the start, metres, or NaN when not compared.doubleHeading error from the start, degrees, or NaN when not compared.voidobserve(double now) Called every loop, enabled or not, for checks that must see every loop: a reset flag that is true for one loop, or a condition that has to hold for some time.
-
Field Details
-
MAX_DISTANCE_METERS
public static final double MAX_DISTANCE_METERSFarther than this from the start is the wrong spot, side or alliance.- See Also:
-
MAX_HEADING_DEG
public static final double MAX_HEADING_DEG- See Also:
-
HOLD_SECONDS
public static final double HOLD_SECONDSHow long the robot must stay off the start before it fails: it may be being placed.- See Also:
-
-
Constructor Details
-
AutoStartCheck
- Parameters:
state- this loop's auto selection and robot pose
-
-
Method Details
-
observe
public void observe(double now) Description copied from interface:CheckCalled every loop, enabled or not, for checks that must see every loop: a reset flag that is true for one loop, or a condition that has to hold for some time. Keep it cheap. -
evaluate
Description copied from interface:CheckJudges the robot now. Called only while disabled, and not every loop:PreMatchChecksspreads the checks across loops. -
getDistanceMeters
public double getDistanceMeters()Distance from the start, metres, or NaN when not compared. -
getHeadingErrorDeg
public double getHeadingErrorDeg()Heading error from the start, degrees, or NaN when not compared.
-