Package com.irurueta.navigation.gnss
Class GNSSKalmanFilteredEstimator
java.lang.Object
com.irurueta.navigation.gnss.GNSSKalmanFilteredEstimator
Calculates position, velocity, clock offset and clock drift using an
unweighted iterated least squares estimator along with a Kalman filter
to smooth results.
This implementation is based on the equations defined in "Principles of GNSS, Inertial, and Multi-sensor
Integrated Navigation Systems, Second Edition" and on the companion software available at:
https://github.com/ymjdz/MATLAB-Codes/blob/master/GNSS_Kalman_Filter.m
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate GNSSKalmanConfig
GNSS Kalman filter configuration parameters (usually obtained through calibration).private double
Minimum epoch interval expressed in seconds (s) between consecutive propagations or measurements.private GNSSEstimation
Current estimation containing user ECEF position, user ECEF velocity, clock offset and clock drift.private Double
Timestamp expressed in seconds since epoch time when Kalman filter state was last propagated.Listener to notify events raised by this instance.private final GNSSLeastSquaresPositionAndVelocityEstimator
Internal estimator to compute least squares solution for GNSS measurements.private Collection<GNSSMeasurement>
GNSS measurements of a collection of satellites.private boolean
Indicates whether this estimator is running or not.private GNSSKalmanState
Current Kalman filter state containing current GNSS estimation along with Kalman filter covariance error matrix. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.GNSSKalmanFilteredEstimator
(double epochInterval) Constructor.GNSSKalmanFilteredEstimator
(double epochInterval, GNSSKalmanFilteredEstimatorListener listener) Constructor.Constructor.GNSSKalmanFilteredEstimator
(GNSSKalmanConfig config, double epochInterval) Constructor.GNSSKalmanFilteredEstimator
(GNSSKalmanConfig config, double epochInterval, GNSSKalmanFilteredEstimatorListener listener) Constructor.GNSSKalmanFilteredEstimator
(GNSSKalmanConfig config, GNSSKalmanFilteredEstimatorListener listener) Constructor.GNSSKalmanFilteredEstimator
(GNSSKalmanConfig config, com.irurueta.units.Time epochInterval) Constructor.GNSSKalmanFilteredEstimator
(GNSSKalmanConfig config, com.irurueta.units.Time epochInterval, GNSSKalmanFilteredEstimatorListener listener) Constructor.Constructor.GNSSKalmanFilteredEstimator
(com.irurueta.units.Time epochInterval) Constructor.GNSSKalmanFilteredEstimator
(com.irurueta.units.Time epochInterval, GNSSKalmanFilteredEstimatorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGets GNSS Kalman configuration parameters (usually obtained through calibration).boolean
getConfig
(GNSSKalmanConfig result) Gets GNSS Kalman configuration parameters (usually obtained through calibration).double
Gets minimum epoch interval expressed in seconds (s) between consecutive propagations or measurements expressed in seconds.com.irurueta.units.Time
Gets minimum epoch interval between consecutive propagations or measurements.void
getEpochIntervalAsTime
(com.irurueta.units.Time result) Gets minimum epoch interval between consecutive propagations or measurements.Gets current estimation containing user ECEF position, user ECEF velocity, clock offset and clock drift.boolean
getEstimation
(GNSSEstimation result) Gets current estimation containing user ECEF position, user ECEF velocity, clock offset and clock drift.Gets timestamp expressed in seconds since epoch time when Kalman filter state was last propagated.com.irurueta.units.Time
Gets timestamp since epoch time when Kalman filter state was last propagated.boolean
getLastStateTimestampAsTime
(com.irurueta.units.Time result) Gets timestamp since epoch time when Kalman filter state was last propagated.Gets listener to notify events raised by this instance.Gets last updated GNSS measurements of a collection of satellites.getState()
Gets current Kalman filter state containing current GNSS estimation along with Kalman filter covariance error matrix.boolean
getState
(GNSSKalmanState result) Gets current Kalman filter state containing current GNSS estimation along with Kalman filter covariance error matrix.boolean
Indicates whether this estimator is ready for state propagations.boolean
Indicates whether this estimator is running or not.static boolean
isUpdateMeasurementsReady
(Collection<GNSSMeasurement> measurements) Indicates whether provided measurements are ready to be used for an update.boolean
propagate
(double timestamp) Propagates Kalman filter state held by this estimator at provided timestamp.boolean
propagate
(com.irurueta.units.Time timestamp) Propagates Kalman filter state held by this estimator at provided timestamp.void
reset()
Resets this estimator.void
setConfig
(GNSSKalmanConfig config) Sets GNSS Kalman configuration parameters (usually obtained through calibration).void
setEpochInterval
(double epochInterval) Sets minimum epoch interval expressed in seconds (s) between consecutive propagations or measurements expressed in seconds.void
setEpochInterval
(com.irurueta.units.Time epochInterval) Sets minimum epoch interval between consecutive propagations or measurements.void
Sets listener to notify events raised by this instance.boolean
updateMeasurements
(Collection<GNSSMeasurement> measurements, double timestamp) Updates GNSS measurements of this estimator when new satellite measurements are available.boolean
updateMeasurements
(Collection<GNSSMeasurement> measurements, com.irurueta.units.Time timestamp) Updates GNSS measurements of this estimator when new satellite measurements are available.
-
Field Details
-
lsEstimator
Internal estimator to compute least squares solution for GNSS measurements. -
listener
Listener to notify events raised by this instance. -
epochInterval
private double epochIntervalMinimum epoch interval expressed in seconds (s) between consecutive propagations or measurements. Attempting to propagate results using Kalman filter or updating measurements when intervals are lass than this value, will be ignored. -
config
GNSS Kalman filter configuration parameters (usually obtained through calibration). -
measurements
GNSS measurements of a collection of satellites. -
estimation
Current estimation containing user ECEF position, user ECEF velocity, clock offset and clock drift. -
state
Current Kalman filter state containing current GNSS estimation along with Kalman filter covariance error matrix. -
lastStateTimestamp
Timestamp expressed in seconds since epoch time when Kalman filter state was last propagated. -
running
private boolean runningIndicates whether this estimator is running or not.
-
-
Constructor Details
-
GNSSKalmanFilteredEstimator
public GNSSKalmanFilteredEstimator()Constructor. -
GNSSKalmanFilteredEstimator
public GNSSKalmanFilteredEstimator(double epochInterval) Constructor.- Parameters:
epochInterval
- minimum epoch interval expressed in seconds (s) between consecutive propagations or measurements.- Throws:
IllegalArgumentException
- if provided epoch interval is negative.
-
GNSSKalmanFilteredEstimator
public GNSSKalmanFilteredEstimator(com.irurueta.units.Time epochInterval) Constructor.- Parameters:
epochInterval
- minimum epoch interval between consecutive propagations or measurements.- Throws:
IllegalArgumentException
- if provided epoch interval is negative.
-
-
Method Details
-
getListener
Gets listener to notify events raised by this instance.- Returns:
- listener to notify events raised by this instance.
-
getEpochInterval
public double getEpochInterval()Gets minimum epoch interval expressed in seconds (s) between consecutive propagations or measurements expressed in seconds. Attempting to propagate results using Kalman filter or updating measurements when intervals are less than this value, will be ignored.- Returns:
- minimum epoch interval between consecutive propagations or measurements.
-
setEpochInterval
Sets minimum epoch interval expressed in seconds (s) between consecutive propagations or measurements expressed in seconds. Attempting to propagate results using Kalman filter or updating measurements when intervals are less than this value, will be ignored.- Parameters:
epochInterval
- minimum epoch interval expressed in seconds (s) between consecutive propagations or measurements.- Throws:
LockedException
- if this estimator is already running.IllegalArgumentException
- if provided epoch interval is negative.
-
getEpochIntervalAsTime
public void getEpochIntervalAsTime(com.irurueta.units.Time result) Gets minimum epoch interval between consecutive propagations or measurements. Attempting to propagate results using Kalman filter or updating measurements when intervals are less than this value, will be ignored.- Parameters:
result
- instance where minimum epoch interval will be stored.
-
getEpochIntervalAsTime
public com.irurueta.units.Time getEpochIntervalAsTime()Gets minimum epoch interval between consecutive propagations or measurements. Attempting to propagate results using Kalman filter or updating measurements when intervals are less than this value, will be ignored.- Returns:
- minimum epoch interval.
-
setEpochInterval
Sets minimum epoch interval between consecutive propagations or measurements. Attempting to propagate results using Kalman filter or updating measurements when intervals are less than this value, will be ignored.- Parameters:
epochInterval
- minimum epoch interval.- Throws:
LockedException
- if this estimator is already running.IllegalArgumentException
- if provided epoch interval is negative.
-
getConfig
Gets GNSS Kalman configuration parameters (usually obtained through calibration).- Returns:
- GNSS Kalman configuration parameters.
-
getMeasurements
Gets last updated GNSS measurements of a collection of satellites.- Returns:
- last updated GNSS measurements of a collection of satellites.
-
getEstimation
Gets current estimation containing user ECEF position, user ECEF velocity, clock offset and clock drift.- Returns:
- current estimation containing user ECEF position, user ECEF velocity, clock offset and clock drift.
-
getState
Gets current Kalman filter state containing current GNSS estimation along with Kalman filter covariance error matrix.- Returns:
- current Kalman filter state containing current GNSS estimation along with Kalman filter covariance error matrix.
-
getLastStateTimestamp
Gets timestamp expressed in seconds since epoch time when Kalman filter state was last propagated.- Returns:
- timestamp expressed in seconds since epoch time when Kalman filter state was last propagated.
-
getLastStateTimestampAsTime
public boolean getLastStateTimestampAsTime(com.irurueta.units.Time result) Gets timestamp since epoch time when Kalman filter state was last propagated.- Parameters:
result
- instance where timestamp since epoch time when Kalman filter state was last propagated will be stored.- Returns:
- true if result instance is updated, false otherwise.
-
getLastStateTimestampAsTime
public com.irurueta.units.Time getLastStateTimestampAsTime()Gets timestamp since epoch time when Kalman filter state was last propagated.- Returns:
- timestamp since epoch time when Kalman filter state was last propagated.
-
isRunning
public boolean isRunning()Indicates whether this estimator is running or not.- Returns:
- true if this estimator is running, false otherwise.
-
isUpdateMeasurementsReady
Indicates whether provided measurements are ready to be used for an update.- Parameters:
measurements
- measurements to be checked.- Returns:
- true if estimator is ready, false otherwise.
-
updateMeasurements
public boolean updateMeasurements(Collection<GNSSMeasurement> measurements, com.irurueta.units.Time timestamp) throws LockedException, NotReadyException, GNSSException Updates GNSS measurements of this estimator when new satellite measurements are available. Calls to this method will be ignored if interval between provided timestamp and last timestamp when Kalman filter was updated is less than epoch interval.- Parameters:
measurements
- GNSS measurements to be updated.timestamp
- timestamp since epoch time when GNSS measurements were updated.- Returns:
- true if measurements were updated, false otherwise.
- Throws:
LockedException
- if this estimator is already running.NotReadyException
- if estimator is not ready for measurements updates.GNSSException
- if estimation fails due to numerical instabilities.
-
updateMeasurements
public boolean updateMeasurements(Collection<GNSSMeasurement> measurements, double timestamp) throws LockedException, NotReadyException, GNSSException Updates GNSS measurements of this estimator when new satellite measurements are available. Call to this method will be ignored if interval between provided timestamp and last timestamp when Kalman filter was updated is less than epoch interval.- Parameters:
measurements
- GNSS measurements to be updated.timestamp
- timestamp expressed in seconds since epoch time when GNSS measurements were updated.- Returns:
- true if measurements were updated, false otherwise.
- Throws:
LockedException
- if this estimator is already running.NotReadyException
- if estimator is not ready for measurements updates.GNSSException
- if estimation fails due to numerical instabilities.
-
isPropagateReady
public boolean isPropagateReady()Indicates whether this estimator is ready for state propagations.- Returns:
- true if estimator is ready, false otherwise.
-
propagate
public boolean propagate(com.irurueta.units.Time timestamp) throws LockedException, NotReadyException, GNSSException Propagates Kalman filter state held by this estimator at provided timestamp. Call to this method will be ignored if interval between provided timestamp and last timestamp when Kalman filter was updated is less than epoch interval.- Parameters:
timestamp
- timestamp since epoch to propagate state.- Returns:
- true if state was propagated, false otherwise.
- Throws:
LockedException
- if this estimator is already running.NotReadyException
- if estimator is not ready for measurements updates.GNSSException
- if estimation fails due to numerical instabilities.
-
propagate
Propagates Kalman filter state held by this estimator at provided timestamp. Call to this method will be ignored if interval between provided timestamp and last timestamp when Kalman filter was updated is less than epoch interval.- Parameters:
timestamp
- timestamp expressed in seconds since epoch to propagate state.- Returns:
- true if state was propagated, false otherwise.
- Throws:
LockedException
- if this estimator is already running.NotReadyException
- if estimator is not ready for measurements updates.GNSSException
- if estimation fails due to numerical instabilities.
-
reset
Resets this estimator.- Throws:
LockedException
- if this estimator is already running.
-