Class ShotLog
java.lang.Object
frc.robot.subsystems.ShotLog
One row per volley, under
ShotLog/: what was aimed, and what the mechanisms were doing,
on the loop the feed opened. From the offseason bot's shot record (eb2d86e,
ShotCalc/Shot/*), extended with the gate's view and the pose's trust. Schema and how to read it:
docs/shot-log.md; tools/shot_log.py turns a log into a CSV.
The row is written on the rising edge of the feed: the first loop fuel is allowed into the
flywheel, and so the last loop on which the aim is still a prediction. When the feed closes, an
end row under ShotLog/End/ gives the volley's length and how many flywheel dips (roughly,
balls) it saw.
AdvantageKit writes a value only when it changes, so a key that is the same as last shot's has
no record at this shot's time. Read a row as each key's last value at or before the row's
Index record; the tool does exactly that. Main thread only, like every Telemetry call.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordEverything a row needs that the log cannot look up itself. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcount()Volleys logged since boot.voidduring(double rpm, double targetRpm) Called every loop while a volley is feeding.voidend(double nowSeconds) Writes the end row for the volley that stopped feeding this loop.voidstart(ShotLog.Shot shot) Writes the row for a volley that starts this loop.
-
Constructor Details
-
ShotLog
public ShotLog()
-
-
Method Details
-
count
public long count()Volleys logged since boot. -
start
Writes the row for a volley that starts this loop. -
during
public void during(double rpm, double targetRpm) Called every loop while a volley is feeding. -
end
public void end(double nowSeconds) Writes the end row for the volley that stopped feeding this loop.
-