Class AccumulatedMeasurementNoiseEstimator<U extends Enum<?>,M extends com.irurueta.units.Measurement<U>,E extends AccumulatedMeasurementNoiseEstimator<U,M,E,L>,L extends AccumulatedMeasurementNoiseEstimatorListener<U,M,E>>

java.lang.Object
com.irurueta.navigation.inertial.calibration.noise.AccumulatedMeasurementNoiseEstimator<U,M,E,L>
Type Parameters:
U - a measurement unit type.
M - a measurement type.
E - an estimator type.
L - a listener type.
Direct Known Subclasses:
AccumulatedAccelerationMeasurementNoiseEstimator, AccumulatedAngularSpeedMeasurementNoiseEstimator, AccumulatedMagneticFluxDensityMeasurementNoiseEstimator

public abstract class AccumulatedMeasurementNoiseEstimator<U extends Enum<?>,M extends com.irurueta.units.Measurement<U>,E extends AccumulatedMeasurementNoiseEstimator<U,M,E,L>,L extends AccumulatedMeasurementNoiseEstimatorListener<U,M,E>> extends Object
Base class to estimate measurement noise variances and PSD's (Power Spectral Densities) along with their average values. Implementations of this estimator may use norms of measurement triads to estimate noise levels. To compute PSD's, this estimator assumes that measurement samples are obtained at a constant provided rate equal to getTimeInterval() seconds. If not available, accelerometer sampling rate average can be estimated using TimeIntervalEstimator.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private double
    Contains estimated average of measurement expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density).
    static final double
    Default time interval between accelerometer samples expressed in seconds (s).
    private M
    Last provided measurement.
    private L
    Listener to handle events raised by this estimator.
    private int
    Number of processed body kinematics samples.
    private int
    Number of processed timestamp samples plus one.
    private boolean
    Indicates that estimator is running.
    private double
    Time interval expressed in seconds (s) between consecutive accelerometer samples.
    private double
    Contains estimated variance of measurement expressed in its default squared unit (m^2/s^4 for acceleration, rad^2/s^2 for angular speed or T^2 for magnetic flux density).
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
    protected
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addMeasurement(double value)
    Adds a measurement value expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density).
    void
    addMeasurement(M measurement)
    Adds a measurement value.
    protected abstract double
    Converts provided measurement into default unit.
    protected abstract M
    createMeasurement(double value, U unit)
    Creates a measurement with provided value and unit.
    double
    Gets estimated average of measurement expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density).
    Gets estimated average of measurement within current window.
    void
    Gets estimated average of measurement within current window.
    protected abstract U
    Gets default unit for a measurement.
    Gets last provided measurement or null if not available.
    boolean
    Gets last provided measurement.
    Gets listener to handle events raised by this estimator.
    int
    Gets number of samples that have been processed so far.
    double
    Gets measurement noise PSD (Power Spectral Density) expressed in (m^2 * s^-3) for accelerometer, (rad^2/s) for gyroscope or (T^2 * s) for magnetometer.
    double
    Gets measurement noise root PSD (Power Spectral Density) expressed in (m * s^-1.5) for accelerometer, (rad * s^-0.5) for gyroscope or (T * s^0.5) for magnetometer.
    double
    Gets estimated standard deviation of measurement within current window and expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density).
    Gets estimated standard deviation of measurement within current window.
    void
    Gets estimated standard deviation of measurement within current window.
    double
    Gets time interval between accelerometer triad samples expressed in seconds (s).
    com.irurueta.units.Time
    Gets time interval between accelerometer triad samples.
    void
    getTimeIntervalAsTime(com.irurueta.units.Time result)
    Gets time interval between accelerometer triad samples.
    double
    Gets estimated variance of measurement within current window expressed in its default squared unit (m^2/s^4 for acceleration, rad^2/s^2 for angular speed or T^2 for magnetic flux density).
    boolean
    Indicates whether estimator is currently running or not.
    boolean
    Resets current estimator.
    void
    setListener(L listener)
    Sets listener to handle events raised by this estimator.
    void
    setTimeInterval(double timeInterval)
    Sets time interval between accelerometer triad samples expressed in seconds (s).
    void
    setTimeInterval(com.irurueta.units.Time timeInterval)
    Sets time interval between accelerometer triad samples.

    Methods inherited from class java.lang.Object

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

    • DEFAULT_TIME_INTERVAL_SECONDS

      public static final double DEFAULT_TIME_INTERVAL_SECONDS
      Default time interval between accelerometer samples expressed in seconds (s).
      See Also:
    • timeInterval

      private double timeInterval
      Time interval expressed in seconds (s) between consecutive accelerometer samples.
    • listener

      private L extends AccumulatedMeasurementNoiseEstimatorListener<U,M,E> listener
      Listener to handle events raised by this estimator.
    • lastMeasurement

      private M extends com.irurueta.units.Measurement<U> lastMeasurement
      Last provided measurement.
    • avg

      private double avg
      Contains estimated average of measurement expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density).
    • variance

      private double variance
      Contains estimated variance of measurement expressed in its default squared unit (m^2/s^4 for acceleration, rad^2/s^2 for angular speed or T^2 for magnetic flux density).
    • numberOfProcessedSamples

      private int numberOfProcessedSamples
      Number of processed body kinematics samples.
    • numberOfProcessedSamplesPlusOne

      private int numberOfProcessedSamplesPlusOne
      Number of processed timestamp samples plus one.
    • running

      private boolean running
      Indicates that estimator is running.
  • Constructor Details

    • AccumulatedMeasurementNoiseEstimator

      protected AccumulatedMeasurementNoiseEstimator()
      Constructor.
    • AccumulatedMeasurementNoiseEstimator

      protected AccumulatedMeasurementNoiseEstimator(L listener)
      Constructor.
      Parameters:
      listener - listener to handle events raised by this estimator.
  • Method Details

    • getTimeInterval

      public double getTimeInterval()
      Gets time interval between accelerometer triad samples expressed in seconds (s).
      Returns:
      time interval between accelerometer triad samples.
    • setTimeInterval

      public void setTimeInterval(double timeInterval) throws com.irurueta.navigation.LockedException
      Sets time interval between accelerometer triad samples expressed in seconds (s).
      Parameters:
      timeInterval - time interval between accelerometer triad samples.
      Throws:
      IllegalArgumentException - if provided value is negative.
      com.irurueta.navigation.LockedException - if estimator is currently running.
    • getTimeIntervalAsTime

      public com.irurueta.units.Time getTimeIntervalAsTime()
      Gets time interval between accelerometer triad samples.
      Returns:
      time interval between accelerometer triad samples.
    • getTimeIntervalAsTime

      public void getTimeIntervalAsTime(com.irurueta.units.Time result)
      Gets time interval between accelerometer triad samples.
      Parameters:
      result - instance where time interval will be stored.
    • setTimeInterval

      public void setTimeInterval(com.irurueta.units.Time timeInterval) throws com.irurueta.navigation.LockedException
      Sets time interval between accelerometer triad samples.
      Parameters:
      timeInterval - time interval between accelerometer triad samples.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is currently running.
    • getListener

      public L getListener()
      Gets listener to handle events raised by this estimator.
      Returns:
      listener to handle events raised by this estimator.
    • setListener

      public void setListener(L listener) throws com.irurueta.navigation.LockedException
      Sets listener to handle events raised by this estimator.
      Parameters:
      listener - listener to handle events raised by this estimator.
      Throws:
      com.irurueta.navigation.LockedException - if this estimator is running.
    • getLastMeasurement

      public M getLastMeasurement()
      Gets last provided measurement or null if not available.
      Returns:
      last provided measurement or null.
    • getLastMeasurement

      public boolean getLastMeasurement(M result)
      Gets last provided measurement.
      Parameters:
      result - instance where last provided measurement will be stored.
      Returns:
      true if result instance was updated, false otherwise.
    • getAvg

      public double getAvg()
      Gets estimated average of measurement expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density).
      Returns:
      average of measurement in current window.
    • getAvgAsMeasurement

      public M getAvgAsMeasurement()
      Gets estimated average of measurement within current window.
      Returns:
      average of measurement in current window
    • getAvgAsMeasurement

      public void getAvgAsMeasurement(M result)
      Gets estimated average of measurement within current window.
      Parameters:
      result - instance where average of measurement will be stored.
    • getVariance

      public double getVariance()
      Gets estimated variance of measurement within current window expressed in its default squared unit (m^2/s^4 for acceleration, rad^2/s^2 for angular speed or T^2 for magnetic flux density).
      Returns:
      estimated variance of measurement within current window.
    • getStandardDeviation

      public double getStandardDeviation()
      Gets estimated standard deviation of measurement within current window and expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density).
      Returns:
      estimated standard of measurement.
    • getStandardDeviationAsMeasurement

      public M getStandardDeviationAsMeasurement()
      Gets estimated standard deviation of measurement within current window.
      Returns:
      estimated standard deviation of measurement.
    • getStandardDeviationAsMeasurement

      public void getStandardDeviationAsMeasurement(M result)
      Gets estimated standard deviation of measurement within current window.
      Parameters:
      result - instance where estimated standard deviation of measurement will be stored.
    • getPsd

      public double getPsd()
      Gets measurement noise PSD (Power Spectral Density) expressed in (m^2 * s^-3) for accelerometer, (rad^2/s) for gyroscope or (T^2 * s) for magnetometer.
      Returns:
      measurement noise PSD.
    • getRootPsd

      public double getRootPsd()
      Gets measurement noise root PSD (Power Spectral Density) expressed in (m * s^-1.5) for accelerometer, (rad * s^-0.5) for gyroscope or (T * s^0.5) for magnetometer.
      Returns:
      measurement noise root PSD.
    • getNumberOfProcessedSamples

      public int getNumberOfProcessedSamples()
      Gets number of samples that have been processed so far.
      Returns:
      number of samples that have been processed so far.
    • isRunning

      public boolean isRunning()
      Indicates whether estimator is currently running or not.
      Returns:
      true if estimator is running, false otherwise.
    • addMeasurement

      public void addMeasurement(double value) throws com.irurueta.navigation.LockedException
      Adds a measurement value expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density).
      Parameters:
      value - value to be added.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is currently running.
    • addMeasurement

      public void addMeasurement(M measurement) throws com.irurueta.navigation.LockedException
      Adds a measurement value.
      Parameters:
      measurement - measurement to be added.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is currently running.
    • reset

      public boolean reset() throws com.irurueta.navigation.LockedException
      Resets current estimator.
      Returns:
      true if estimator was successfully reset, false if no reset was needed.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is currently running.
    • getDefaultUnit

      protected abstract U getDefaultUnit()
      Gets default unit for a measurement.
      Returns:
      default unit for a measurement.
    • createMeasurement

      protected abstract M createMeasurement(double value, U unit)
      Creates a measurement with provided value and unit.
      Parameters:
      value - value to be set.
      unit - unit to be set.
      Returns:
      created measurement.
    • convertToDefaultUnit

      protected abstract double convertToDefaultUnit(M value)
      Converts provided measurement into default unit.
      Parameters:
      value - measurement to be converted.
      Returns:
      converted value.