Class ShotLog

java.lang.Object
frc.robot.subsystems.ShotLog

public final class ShotLog extends Object
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 Classes
    Modifier and Type
    Class
    Description
    static final record 
    Everything a row needs that the log cannot look up itself.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Volleys logged since boot.
    void
    during(double rpm, double targetRpm)
    Called every loop while a volley is feeding.
    void
    end(double nowSeconds)
    Writes the end row for the volley that stopped feeding this loop.
    void
    Writes the row for a volley that starts this loop.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ShotLog

      public ShotLog()
  • Method Details

    • count

      public long count()
      Volleys logged since boot.
    • start

      public void start(ShotLog.Shot shot)
      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.