Class AccelerometerAndGyroscopeMeasurementsGenerator
java.lang.Object
com.irurueta.navigation.inertial.calibration.generators.AccelerometerAndGyroscopeMeasurementsGenerator
- All Implemented Interfaces:
AccelerometerNoiseRootPsdSource
,GyroscopeNoiseRootPsdSource
public class AccelerometerAndGyroscopeMeasurementsGenerator
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, and with easy gyroscope calibrators.
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()
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AccelerometerMeasurementsGeneratorListener
Listener for internal accelerometer measurements generator.private final AccelerometerMeasurementsGenerator
Internal accelerometer measurements generator.private final GyroscopeMeasurementsGeneratorListener
Listener for internal gyroscope measurements generator.private final GyroscopeMeasurementsGenerator
Internal gyroscope measurements generator.Listener to handle generated events.private boolean
Indicates whether generator is running or not. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.AccelerometerAndGyroscopeMeasurementsGenerator
(AccelerometerAndGyroscopeMeasurementsGeneratorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Gets accelerometer base noise level that has been detected during initialization expressed in meters per squared second (m/s^2).com.irurueta.units.Acceleration
Gets accelerometer base noise level that has been detected during initialization.void
getAccelerometerBaseNoiseLevelAsMeasurement
(com.irurueta.units.Acceleration result) Gets accelerometer base noise level that has been detected during initialization.double
Gets accelerometer base noise level PSD (Power Spectral Density) expressed in (m^2 * s^-3).double
Gets accelerometer base noise level root PSD (Power Spectral Density) expressed in (m * s^-1.5).double
Gets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase.com.irurueta.units.Acceleration
Gets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase.void
getBaseNoiseLevelAbsoluteThresholdAsMeasurement
(com.irurueta.units.Acceleration result) Gets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase.double
Gets gyroscope base noise level that has been detected during initialization expressed in radians per second (rad/s).com.irurueta.units.AngularSpeed
Gets gyroscope base noise level that has been detected during initialization.void
getGyroscopeBaseNoiseLevelAsMeasurement
(com.irurueta.units.AngularSpeed result) Gets gyroscope base noise level that has been detected during initialization.double
Gets gyroscope base noise level PSD (Power Spectral Density) expressed in (rad^2/s).double
Gets 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.void
Gets estimated standard deviation of angular rate during initialization phase.Gets estimated average angular rate during initialization phase.void
Gets estimated average angular rate during initialization phase.int
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.double
Gets 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.int
Gets maximum number of samples allowed in dynamic intervals.int
Gets minimum number of samples required in a static interval to be taken into account.int
Gets number of samples that have been processed in a dynamic period so far.int
Gets number of samples that have been processed in a static period so far.Gets internal status of this generator.double
Gets threshold to determine static/dynamic period changes expressed in meters per squared second (m/s^2).com.irurueta.units.Acceleration
Gets threshold to determine static/dynamic period changes.void
getThresholdAsMeasurement
(com.irurueta.units.Acceleration result) Gets threshold to determine static/dynamic period changes.double
Gets factor to be applied to detected base noise level in order to determine threshold for static/dynamic period changes.double
Gets time interval between input samples expressed in seconds (s).com.irurueta.units.Time
Gets time interval between input samples.void
getTimeIntervalAsTime
(com.irurueta.units.Time result) Gets time interval between input samples.int
Gets length of number of samples to keep within the window being processed to determine instantaneous accelerometer noise level.boolean
Indicates whether last dynamic interval must be skipped.boolean
Indicates whether generator is running or not.boolean
Indicates whether last static interval must be skipped.boolean
process
(TimedBodyKinematics sample) Processes a sample of data.void
reset()
Resets this generator.void
setBaseNoiseLevelAbsoluteThreshold
(double baseNoiseLevelAbsoluteThreshold) Sets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase.void
setBaseNoiseLevelAbsoluteThreshold
(com.irurueta.units.Acceleration baseNoiseLevelAbsoluteThreshold) Sets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase.void
setInitialStaticSamples
(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.void
setInstantaneousNoiseLevelFactor
(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.void
Sets listener to handle generated events.void
setMaxDynamicSamples
(int maxDynamicSamples) Sets maximum number of samples allowed in dynamic intervals.void
setMinStaticSamples
(int minStaticSamples) Sets minimum number of samples required in a static interval to be taken into account.void
setThresholdFactor
(double thresholdFactor) Sets factor to be applied to detected base noise level in order to determine threshold for static/dynamic period changes.void
setTimeInterval
(double timeInterval) Sets time interval between input samples expressed in seconds (s).void
setTimeInterval
(com.irurueta.units.Time timeInterval) Sets time interval between input samples.void
setWindowSize
(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. -
accelerometerMeasurementsGenerator
Internal accelerometer measurements generator. -
gyroscopeMeasurementsGenerator
Internal gyroscope measurements generator. -
running
private boolean runningIndicates whether generator is running or not.
-
-
Constructor Details
-
AccelerometerAndGyroscopeMeasurementsGenerator
public AccelerometerAndGyroscopeMeasurementsGenerator()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:
getAccelerometerBaseNoiseLevelRootPsd
in 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:
getGyroscopeBaseNoiseLevelRootPsd
in interfaceGyroscopeNoiseRootPsdSource
- Returns:
- gyroscope base noise level root PSD.
-