Class AccelerometerGyroscopeAndMagnetometerMeasurementsGenerator

java.lang.Object
com.irurueta.navigation.inertial.calibration.generators.AccelerometerGyroscopeAndMagnetometerMeasurementsGenerator
All Implemented Interfaces:
AccelerometerNoiseRootPsdSource, GyroscopeNoiseRootPsdSource

public class AccelerometerGyroscopeAndMagnetometerMeasurementsGenerator extends Object implements AccelerometerNoiseRootPsdSource, GyroscopeNoiseRootPsdSource
Generates measurements for the calibration of accelerometers and gyroscopes by alternating static and dynamic intervals where device is kept static or moved. Generated measurements must be used with accelerometer calibrators based on the knowledge of gravity norm (or Earth position) when the device orientation is unknown, with easy gyroscope calibrators and with magnetometer calibrators based on the knowledge of position on Earth and time instant. Notice that accuracy of the gyroscope calibration is very sensitive to the accuracy of detected dynamic intervals respect the average specific forces during static intervals. In order to increase the accuracy, calibration should be repeated trying different threshold factors getThresholdFactor().
See Also:
  • Field Details

  • Constructor Details

    • AccelerometerGyroscopeAndMagnetometerMeasurementsGenerator

      public AccelerometerGyroscopeAndMagnetometerMeasurementsGenerator()
      Constructor.
    • AccelerometerGyroscopeAndMagnetometerMeasurementsGenerator

      public AccelerometerGyroscopeAndMagnetometerMeasurementsGenerator(AccelerometerGyroscopeAndMagnetometerMeasurementsGeneratorListener listener)
      Constructor.
      Parameters:
      listener - listener to handle events raised by this generator.
  • Method Details

    • getTimeInterval

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

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

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

      public void getTimeIntervalAsTime(com.irurueta.units.Time result)
      Gets time interval between input 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 input samples.
      Parameters:
      timeInterval - time interval between input samples.
      Throws:
      IllegalArgumentException - if provided value is negative.
      com.irurueta.navigation.LockedException - if estimator is currently running.
    • getMinStaticSamples

      public int getMinStaticSamples()
      Gets minimum number of samples required in a static interval to be taken into account. Smaller static intervals will be discarded.
      Returns:
      minimum number of samples required in a static interval to be taken into account.
    • setMinStaticSamples

      public void setMinStaticSamples(int minStaticSamples) throws com.irurueta.navigation.LockedException
      Sets minimum number of samples required in a static interval to be taken into account. Smaller static intervals will be discarded.
      Parameters:
      minStaticSamples - minimum number of samples required in a static interval to be taken into account.
      Throws:
      com.irurueta.navigation.LockedException - if generator is busy.
      IllegalArgumentException - if provided value is less than 2.
    • getMaxDynamicSamples

      public int getMaxDynamicSamples()
      Gets maximum number of samples allowed in dynamic intervals.
      Returns:
      maximum number of samples allowed in dynamic intervals.
    • setMaxDynamicSamples

      public void setMaxDynamicSamples(int maxDynamicSamples) throws com.irurueta.navigation.LockedException
      Sets maximum number of samples allowed in dynamic intervals.
      Parameters:
      maxDynamicSamples - maximum number of samples allowed in dynamic intervals.
      Throws:
      com.irurueta.navigation.LockedException - if generator is busy.
      IllegalArgumentException - if provided value is less than 2.
    • getListener

      Gets listener to handle generated events.
      Returns:
      listener to handle generated events.
    • setListener

      public void setListener(AccelerometerGyroscopeAndMagnetometerMeasurementsGeneratorListener listener) throws com.irurueta.navigation.LockedException
      Sets listener to handle generated events.
      Parameters:
      listener - listener to handle generated events.
      Throws:
      com.irurueta.navigation.LockedException - if generator is busy.
    • getWindowSize

      public int getWindowSize()
      Gets length of number of samples to keep within the window being processed to determine instantaneous accelerometer noise level.
      Returns:
      length of number of samples to keep within the window.
    • setWindowSize

      public void setWindowSize(int windowSize) throws com.irurueta.navigation.LockedException
      Sets length of number of samples to keep within the window being processed to determine instantaneous accelerometer noise level. Window size must always be larger than allowed minimum value, which is 2 and must have an odd value.
      Parameters:
      windowSize - length of number of samples to keep within the window.
      Throws:
      com.irurueta.navigation.LockedException - if detector is busy processing a previous sample.
      IllegalArgumentException - if provided value is not valid.
    • getInitialStaticSamples

      public int getInitialStaticSamples()
      Gets number of samples to be processed initially while keeping the sensor static in order to find the base noise level when device is static.
      Returns:
      number of samples to be processed initially.
    • setInitialStaticSamples

      public void setInitialStaticSamples(int initialStaticSamples) throws com.irurueta.navigation.LockedException
      Sets number of samples to be processed initially while keeping the sensor static in order to find the base noise level when device is static.
      Parameters:
      initialStaticSamples - number of samples to be processed initially.
      Throws:
      com.irurueta.navigation.LockedException - if detector is busy.
      IllegalArgumentException - if provided value is less than TriadStaticIntervalDetector.MINIMUM_INITIAL_STATIC_SAMPLES
    • getThresholdFactor

      public double getThresholdFactor()
      Gets factor to be applied to detected base noise level in order to determine threshold for static/dynamic period changes. This factor is unit-less.
      Returns:
      factor to be applied to detected base noise level.
    • setThresholdFactor

      public void setThresholdFactor(double thresholdFactor) throws com.irurueta.navigation.LockedException
      Sets factor to be applied to detected base noise level in order to determine threshold for static/dynamic period changes. This factor is unit-less.
      Parameters:
      thresholdFactor - factor to be applied to detected base noise level.
      Throws:
      com.irurueta.navigation.LockedException - if detector is busy.
      IllegalArgumentException - if provided value is zero or negative.
    • getInstantaneousNoiseLevelFactor

      public double getInstantaneousNoiseLevelFactor()
      Gets factor to determine that a sudden movement has occurred during initialization if instantaneous noise level exceeds accumulated noise level by this factor amount. This factor is unit-less.
      Returns:
      factor to determine that a sudden movement has occurred.
    • setInstantaneousNoiseLevelFactor

      public void setInstantaneousNoiseLevelFactor(double instantaneousNoiseLevelFactor) throws com.irurueta.navigation.LockedException
      Sets factor to determine that a sudden movement has occurred during initialization if instantaneous noise level exceeds accumulated noise level by this factor amount. This factor is unit-less.
      Parameters:
      instantaneousNoiseLevelFactor - factor to determine that a sudden movement has occurred during initialization.
      Throws:
      com.irurueta.navigation.LockedException - if detector is busy.
      IllegalArgumentException - if provided value is zero or negative.
    • getBaseNoiseLevelAbsoluteThreshold

      public double getBaseNoiseLevelAbsoluteThreshold()
      Gets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase. Failure will be detected if estimated base noise level exceeds this threshold when initialization completes. This threshold is expressed in meters per squared second (m/s^2).
      Returns:
      overall absolute threshold to determine whether there has been excessive motion.
    • setBaseNoiseLevelAbsoluteThreshold

      public void setBaseNoiseLevelAbsoluteThreshold(double baseNoiseLevelAbsoluteThreshold) throws com.irurueta.navigation.LockedException
      Sets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase. Failure will be detected if estimated base noise level exceeds this threshold when initialization completes. This threshold is expressed in meters per squared second (m/s^2).
      Parameters:
      baseNoiseLevelAbsoluteThreshold - overall absolute threshold to determine whether there has been excessive motion.
      Throws:
      com.irurueta.navigation.LockedException - if detector is busy.
      IllegalArgumentException - if provided value is zero or negative.
    • getBaseNoiseLevelAbsoluteThresholdAsMeasurement

      public com.irurueta.units.Acceleration getBaseNoiseLevelAbsoluteThresholdAsMeasurement()
      Gets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase. Failure will be detected if estimated base noise level exceeds this threshold when initialization completes.
      Returns:
      overall absolute threshold to determine whether there has been excessive motion.
    • getBaseNoiseLevelAbsoluteThresholdAsMeasurement

      public void getBaseNoiseLevelAbsoluteThresholdAsMeasurement(com.irurueta.units.Acceleration result)
      Gets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase. Failure will be detected if estimated base noise level exceeds this threshold when initialization completes.
      Parameters:
      result - instance where result will be stored.
    • setBaseNoiseLevelAbsoluteThreshold

      public void setBaseNoiseLevelAbsoluteThreshold(com.irurueta.units.Acceleration baseNoiseLevelAbsoluteThreshold) throws com.irurueta.navigation.LockedException
      Sets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase. Failure will be detected if estimated base noise level exceeds this threshold when initialization completes.
      Parameters:
      baseNoiseLevelAbsoluteThreshold - overall absolute threshold to determine whether there has been excessive motion.
      Throws:
      com.irurueta.navigation.LockedException - if detector is busy.
      IllegalArgumentException - if provided value is zero or negative.
    • getStatus

      Gets internal status of this generator.
      Returns:
      internal status of this generator.
    • getAccelerometerBaseNoiseLevel

      public double getAccelerometerBaseNoiseLevel()
      Gets accelerometer base noise level that has been detected during initialization expressed in meters per squared second (m/s^2). This is equal to the standard deviation of the accelerometer measurements during initialization phase.
      Returns:
      accelerometer base noise level.
    • getAccelerometerBaseNoiseLevelAsMeasurement

      public com.irurueta.units.Acceleration getAccelerometerBaseNoiseLevelAsMeasurement()
      Gets accelerometer base noise level that has been detected during initialization. This is equal to the standard deviation of the accelerometer measurements during initialization phase.
      Returns:
      measurement base noise level.
    • getAccelerometerBaseNoiseLevelAsMeasurement

      public void getAccelerometerBaseNoiseLevelAsMeasurement(com.irurueta.units.Acceleration result)
      Gets accelerometer base noise level that has been detected during initialization.
      Parameters:
      result - instance where result will be stored.
    • getAccelerometerBaseNoiseLevelPsd

      public double getAccelerometerBaseNoiseLevelPsd()
      Gets accelerometer base noise level PSD (Power Spectral Density) expressed in (m^2 * s^-3).
      Returns:
      accelerometer base noise level PSD.
    • getAccelerometerBaseNoiseLevelRootPsd

      public double getAccelerometerBaseNoiseLevelRootPsd()
      Gets accelerometer base noise level root PSD (Power Spectral Density) expressed in (m * s^-1.5).
      Specified by:
      getAccelerometerBaseNoiseLevelRootPsd in interface AccelerometerNoiseRootPsdSource
      Returns:
      accelerometer base noise level root PSD.
    • getThreshold

      public double getThreshold()
      Gets threshold to determine static/dynamic period changes expressed in meters per squared second (m/s^2).
      Returns:
      threshold to determine static/dynamic period changes.
    • getThresholdAsMeasurement

      public com.irurueta.units.Acceleration getThresholdAsMeasurement()
      Gets threshold to determine static/dynamic period changes.
      Returns:
      threshold to determine static/dynamic period changes.
    • getThresholdAsMeasurement

      public void getThresholdAsMeasurement(com.irurueta.units.Acceleration result)
      Gets threshold to determine static/dynamic period changes.
      Parameters:
      result - instance where result will be stored.
    • getProcessedStaticSamples

      public int getProcessedStaticSamples()
      Gets number of samples that have been processed in a static period so far.
      Returns:
      number of samples that have been processed in a static period so far.
    • getProcessedDynamicSamples

      public int getProcessedDynamicSamples()
      Gets number of samples that have been processed in a dynamic period so far.
      Returns:
      number of samples that have been processed in a dynamic period so far.
    • isStaticIntervalSkipped

      public boolean isStaticIntervalSkipped()
      Indicates whether last static interval must be skipped.
      Returns:
      true if last static interval must be skipped.
    • isDynamicIntervalSkipped

      public boolean isDynamicIntervalSkipped()
      Indicates whether last dynamic interval must be skipped.
      Returns:
      true if last dynamic interval must be skipped.
    • isRunning

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

      public boolean process(TimedBodyKinematicsAndMagneticFluxDensity sample) throws com.irurueta.navigation.LockedException
      Processes a sample of data.
      Parameters:
      sample - sample of data to be processed.
      Returns:
      true if provided samples has been processed, false if provided triad has been skipped because generator previously failed. If generator previously failed, it will need to be reset before processing additional samples.
      Throws:
      com.irurueta.navigation.LockedException - if generator is busy processing a previous sample.
    • reset

      public void reset() throws com.irurueta.navigation.LockedException
      Resets this generator.
      Throws:
      com.irurueta.navigation.LockedException - if generator is busy.
    • getInitialAvgAngularSpeedTriad

      public AngularSpeedTriad getInitialAvgAngularSpeedTriad()
      Gets estimated average angular rate during initialization phase.
      Returns:
      estimated average angular rate during initialization phase.
    • getInitialAvgAngularSpeedTriad

      public void getInitialAvgAngularSpeedTriad(AngularSpeedTriad result)
      Gets estimated average angular rate during initialization phase.
      Parameters:
      result - instance where result will be stored.
    • getInitialAngularSpeedTriadStandardDeviation

      public AngularSpeedTriad getInitialAngularSpeedTriadStandardDeviation()
      Gets estimated standard deviation of angular rate during initialization phase.
      Returns:
      estimated standard deviation of angular rate during initialization phase.
    • getInitialAngularSpeedTriadStandardDeviation

      public void getInitialAngularSpeedTriadStandardDeviation(AngularSpeedTriad result)
      Gets estimated standard deviation of angular rate during initialization phase.
      Parameters:
      result - instance where result will be stored.
    • getGyroscopeBaseNoiseLevel

      public double getGyroscopeBaseNoiseLevel()
      Gets gyroscope base noise level that has been detected during initialization expressed in radians per second (rad/s). This is equal to the standard deviation of the gyroscope measurements during initialization phase.
      Returns:
      gyroscope base noise level.
    • getGyroscopeBaseNoiseLevelAsMeasurement

      public com.irurueta.units.AngularSpeed getGyroscopeBaseNoiseLevelAsMeasurement()
      Gets gyroscope base noise level that has been detected during initialization. This is equal to the standard deviation of the gyroscope measurements during initialization phase.
      Returns:
      gyroscope base noise level.
    • getGyroscopeBaseNoiseLevelAsMeasurement

      public void getGyroscopeBaseNoiseLevelAsMeasurement(com.irurueta.units.AngularSpeed result)
      Gets gyroscope base noise level that has been detected during initialization. This is equal to the standard deviation of the gyroscope measurements during initialization phase.
      Parameters:
      result - instance where result will be stored.
    • getGyroscopeBaseNoiseLevelPsd

      public double getGyroscopeBaseNoiseLevelPsd()
      Gets gyroscope base noise level PSD (Power Spectral Density) expressed in (rad^2/s).
      Returns:
      gyroscope base noise level PSD.
    • getGyroscopeBaseNoiseLevelRootPsd

      public double getGyroscopeBaseNoiseLevelRootPsd()
      Gets gyroscope base noise level root PSD (Power Spectral Density) expressed in (rad * s^-0.5)
      Specified by:
      getGyroscopeBaseNoiseLevelRootPsd in interface GyroscopeNoiseRootPsdSource
      Returns:
      gyroscope base noise level root PSD.