Class IMULinearMovingAverageFilter

java.lang.Object
swervelib.math.IMULinearMovingAverageFilter

public class IMULinearMovingAverageFilter extends Object
A linear filter that does not calculate() each time a value is added to the DoubleCircularBuffer.
  • Constructor Details

    • IMULinearMovingAverageFilter

      public IMULinearMovingAverageFilter(int bufferLength)
      Construct a linear moving average fitler
      Parameters:
      bufferLength - The number of values to average across
  • Method Details

    • addValue

      public void addValue(double input)
      Add a value to the DoubleCircularBuffer
      Parameters:
      input - Value to add
    • calculate

      public double calculate()
      Calculate the average of the samples in the buffer
      Returns:
      The average of the values in the buffer