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 Summary
FieldsModifier and TypeFieldDescriptionprivate final AccelerometerMeasurementsGeneratorListenerListener for internal accelerometer measurements generator.private final AccelerometerMeasurementsGeneratorInternal accelerometer measurements generator.private final GyroscopeMeasurementsGeneratorListenerListener for internal gyroscope measurements generator.private final GyroscopeMeasurementsGeneratorInternal gyroscope measurements generator.Listener to handle generated events.private final MagnetometerMeasurementsGeneratorListenerListener for internal magnetometer measurements generator.private final MagnetometerMeasurementsGeneratorInternal magnetometer measurements generator.private booleanIndicates whether generator is running or not.private final TimedBodyKinematicsTimed body kinematics instance to be reused. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.AccelerometerGyroscopeAndMagnetometerMeasurementsGenerator(AccelerometerGyroscopeAndMagnetometerMeasurementsGeneratorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets accelerometer base noise level that has been detected during initialization expressed in meters per squared second (m/s^2).com.irurueta.units.AccelerationGets accelerometer base noise level that has been detected during initialization.voidgetAccelerometerBaseNoiseLevelAsMeasurement(com.irurueta.units.Acceleration result) Gets accelerometer base noise level that has been detected during initialization.doubleGets accelerometer base noise level PSD (Power Spectral Density) expressed in (m^2 * s^-3).doubleGets accelerometer base noise level root PSD (Power Spectral Density) expressed in (m * s^-1.5).doubleGets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase.com.irurueta.units.AccelerationGets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase.voidgetBaseNoiseLevelAbsoluteThresholdAsMeasurement(com.irurueta.units.Acceleration result) Gets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase.doubleGets gyroscope base noise level that has been detected during initialization expressed in radians per second (rad/s).com.irurueta.units.AngularSpeedGets gyroscope base noise level that has been detected during initialization.voidgetGyroscopeBaseNoiseLevelAsMeasurement(com.irurueta.units.AngularSpeed result) Gets gyroscope base noise level that has been detected during initialization.doubleGets gyroscope base noise level PSD (Power Spectral Density) expressed in (rad^2/s).doubleGets gyroscope base noise level root PSD (Power Spectral Density) expressed in (rad * s^-0.5)Gets estimated standard deviation of angular rate during initialization phase.voidGets estimated standard deviation of angular rate during initialization phase.Gets estimated average angular rate during initialization phase.voidGets estimated average angular rate during initialization phase.intGets number of samples to be processed initially while keeping the sensor static in order to find the base noise level when device is static.doubleGets factor to determine that a sudden movement has occurred during initialization if instantaneous noise level exceeds accumulated noise level by this factor amount.Gets listener to handle generated events.intGets maximum number of samples allowed in dynamic intervals.intGets minimum number of samples required in a static interval to be taken into account.intGets number of samples that have been processed in a dynamic period so far.intGets number of samples that have been processed in a static period so far.Gets internal status of this generator.doubleGets threshold to determine static/dynamic period changes expressed in meters per squared second (m/s^2).com.irurueta.units.AccelerationGets threshold to determine static/dynamic period changes.voidgetThresholdAsMeasurement(com.irurueta.units.Acceleration result) Gets threshold to determine static/dynamic period changes.doubleGets factor to be applied to detected base noise level in order to determine threshold for static/dynamic period changes.doubleGets time interval between input samples expressed in seconds (s).com.irurueta.units.TimeGets time interval between input samples.voidgetTimeIntervalAsTime(com.irurueta.units.Time result) Gets time interval between input samples.intGets length of number of samples to keep within the window being processed to determine instantaneous accelerometer noise level.booleanIndicates whether last dynamic interval must be skipped.booleanIndicates whether generator is running or not.booleanIndicates whether last static interval must be skipped.booleanProcesses a sample of data.voidreset()Resets this generator.voidsetBaseNoiseLevelAbsoluteThreshold(double baseNoiseLevelAbsoluteThreshold) Sets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase.voidsetBaseNoiseLevelAbsoluteThreshold(com.irurueta.units.Acceleration baseNoiseLevelAbsoluteThreshold) Sets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase.voidsetInitialStaticSamples(int initialStaticSamples) 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.voidsetInstantaneousNoiseLevelFactor(double instantaneousNoiseLevelFactor) Sets factor to determine that a sudden movement has occurred during initialization if instantaneous noise level exceeds accumulated noise level by this factor amount.voidSets listener to handle generated events.voidsetMaxDynamicSamples(int maxDynamicSamples) Sets maximum number of samples allowed in dynamic intervals.voidsetMinStaticSamples(int minStaticSamples) Sets minimum number of samples required in a static interval to be taken into account.voidsetThresholdFactor(double thresholdFactor) Sets factor to be applied to detected base noise level in order to determine threshold for static/dynamic period changes.voidsetTimeInterval(double timeInterval) Sets time interval between input samples expressed in seconds (s).voidsetTimeInterval(com.irurueta.units.Time timeInterval) Sets time interval between input samples.voidsetWindowSize(int windowSize) Sets length of number of samples to keep within the window being processed to determine instantaneous accelerometer noise level.
-
Field Details
-
listener
Listener to handle generated events. -
accelerometerListener
Listener for internal accelerometer measurements generator. -
gyroscopeListener
Listener for internal gyroscope measurements generator. -
magnetometerListener
Listener for internal magnetometer measurements generator. -
accelerometerMeasurementsGenerator
Internal accelerometer measurements generator. -
gyroscopeMeasurementsGenerator
Internal gyroscope measurements generator. -
magnetometerMeasurementsGenerator
Internal magnetometer measurements generator. -
running
private boolean runningIndicates whether generator is running or not. -
timedKinematics
Timed body kinematics instance to be reused.
-
-
Constructor Details
-
AccelerometerGyroscopeAndMagnetometerMeasurementsGenerator
public AccelerometerGyroscopeAndMagnetometerMeasurementsGenerator()Constructor.
-
-
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.
-
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 thanTriadStaticIntervalDetector.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:
getAccelerometerBaseNoiseLevelRootPsdin interfaceAccelerometerNoiseRootPsdSource- 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.
-
reset
public void reset() throws com.irurueta.navigation.LockedExceptionResets this generator.- Throws:
com.irurueta.navigation.LockedException- if generator is busy.
-
getInitialAvgAngularSpeedTriad
Gets estimated average angular rate during initialization phase.- Returns:
- estimated average angular rate during initialization phase.
-
getInitialAngularSpeedTriadStandardDeviation
Gets estimated standard deviation of angular rate during initialization phase.- Returns:
- estimated standard deviation of angular rate during initialization phase.
-
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:
getGyroscopeBaseNoiseLevelRootPsdin interfaceGyroscopeNoiseRootPsdSource- Returns:
- gyroscope base noise level root PSD.
-