Class HoodHoming
Hood fills an HoodHoming.Inputs from logged inputs each loop and applies the HoodHoming.Output, so homing replays and is unit tested.
Homing drives the hood down at HoodHoming.Params.volts until its speed stays under HoodHoming.Params.stallDegPerSec for HoodHoming.Params.stallSeconds, then sets the position to the stop. It
runs at auto start, at teleop start unless already zeroed, and each time the hood is sent home
and gets within HoodHoming.Params.nearHomeDeg of the stop (1678's re-home on stow). Until the first
success the hood refuses closed-loop setpoints and holds in brake. A reboot of the hood motor
restarts its position, so it un-zeroes the hood and re-homes it at once if enabled.
No attempt runs while the hood's tracking stop holds it: a jammed hood stalls, and homing would take the jam for the stop and zero there. An attempt due meanwhile waits for the operator's clear; disabling drops it, and the next mode start asks again.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic final recordOne loop's view of the hood, every field from a logged input.static final classLogged as an input underHood/Homing, true on every robot and sim run, so a log says whether it was recorded with homing.static final recordThe homing answer for one loop.static final recordHoming constants.static enumLogged asHood/HomingState. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HoodHoming.OutputThe output whileassumeZeroedForReplay(boolean, boolean): zeroed, closed loop, no zero written.static booleanassumeZeroedForReplay(boolean replay, boolean recordedWithHoming) Whether to skip homing and treat the hood as zeroed: only when replaying a log recorded before homing existed.booleanisZeroed()Advances homing one loop.
-
Constructor Details
-
HoodHoming
-
-
Method Details
-
assumeZeroedForReplay
public static boolean assumeZeroedForReplay(boolean replay, boolean recordedWithHoming) Whether to skip homing and treat the hood as zeroed: only when replaying a log recorded before homing existed. That robot trusted its boot angle and never wrote a zero, so its readings never show one, and waiting for one would hold the replayed shot gate where the robot fired.- Parameters:
replay- running in replayrecordedWithHoming- the log'sHoodHoming.LogMarker- Returns:
trueto treat the hood as zeroed without homing
-
assumedZeroed
The output whileassumeZeroedForReplay(boolean, boolean): zeroed, closed loop, no zero written. -
getParams
-
isZeroed
public boolean isZeroed() -
update
Advances homing one loop.- Parameters:
in- this loop's view of the hood- Returns:
- what the hood does
-