Class YawRateHistory

java.lang.Object
frc.spectrumLib.localization.YawRateHistory

public class YawRateHistory extends Object
Ring buffer of chassis yaw-rate samples, for the lookback spin gate.

From the 2026 offseason Vision.peakYawRateRadPerSec(): frames that reach the robot now were captured up to a few tenths of a second ago, so the gate has to ask whether the robot was spinning then, not whether it is spinning now. A frame arriving just after a spin stops was captured during it.

  • Constructor Summary

    Constructors
    Constructor
    Description
    YawRateHistory(int capacity)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    peak(double nowSeconds, double lookbackSeconds)
    Largest |yaw rate| recorded within lookbackSeconds of nowSeconds.
    void
    record(double timeSeconds, double yawRateRadPerSec)
    Records |yaw rate| at a time.

    Methods inherited from class Object

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

    • YawRateHistory

      public YawRateHistory(int capacity)
      Parameters:
      capacity - samples kept; at 50 Hz, 64 covers well over a second
  • Method Details

    • record

      public void record(double timeSeconds, double yawRateRadPerSec)
      Records |yaw rate| at a time.
    • peak

      public double peak(double nowSeconds, double lookbackSeconds)
      Largest |yaw rate| recorded within lookbackSeconds of nowSeconds.