Class TrcKalmanFilter

java.lang.Object
trclib.dataprocessor.TrcFilter
trclib.dataprocessor.TrcKalmanFilter

public class TrcKalmanFilter extends TrcFilter
This class implements the Kalman filter. It is useful for filtering noise from the sensor data.
  • Field Details

    • DEF_KQ

      private static final double DEF_KQ
      See Also:
    • DEF_KR

      private static final double DEF_KR
      See Also:
    • kQ

      private final double kQ
    • kR

      private final double kR
    • prevP

      private double prevP
    • prevXEst

      private double prevXEst
    • initialized

      private boolean initialized
  • Constructor Details

    • TrcKalmanFilter

      public TrcKalmanFilter(String instanceName, double kQ, double kR)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      kQ - specifies the KQ constant.
      kR - specifies the KR constant.
    • TrcKalmanFilter

      public TrcKalmanFilter(String instanceName)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
  • Method Details

    • reset

      public void reset()
      This method resets the filter.
      Specified by:
      reset in class TrcFilter
    • filterData

      public double filterData(double data)
      This method returns the filtered data.
      Specified by:
      filterData in class TrcFilter
      Parameters:
      data - specifies the data value to be filtered.
      Returns:
      filtered data.