Package com.irurueta.navigation.inertial
Class INSLooselyCoupledKalmanFilteredEstimator
java.lang.Object
com.irurueta.navigation.inertial.INSLooselyCoupledKalmanFilteredEstimator
Calculates position, velocity, attitude and IMU biases using an INS loosely
coupled Kalman filter to take into account inertial measurements to
smooth results and taking into account an initial position.
This implementation is based on the equations defined in "Principles of GNSS, Inertial, and Multisensor
Integrated Navigation Systems, Second Edition" and on the companion software available at:
https://github.com/ymjdz/MATLAB-Codes/blob/master/Loosely_coupled_INS_GNSS.m
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate INSLooselyCoupledKalmanConfig
INS loosely coupled Kalman filter configuration parameters (usually obtained through calibration).private BodyKinematics
Contains last provided user kinematics minus currently estimated bias for acceleration and angular rate values.private double
Minimum epoch interval expressed in seconds (s) between consecutive propagations or measurements.private com.irurueta.navigation.frames.ECEFFrame
Contains current or initial user position, velocity and attitude.Configuration containing uncertainty measures to set initial covariance matrix within estimated state.private BodyKinematics
Last provided user kinematics containing applied specific force and angular rates resolved in body axes.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 boolean
Indicates whether this estimator is running or not.private INSLooselyCoupledKalmanState
Current Kalman filter state containing current INS estimation along with Kalman filter covariance error matrix. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.INSLooselyCoupledKalmanFilteredEstimator
(double epochInterval) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(double epochInterval, com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(double epochInterval, com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(double epochInterval, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(double epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(double epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(double epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(double epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, double epochInterval) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, double epochInterval, com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, double epochInterval, com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, double epochInterval, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, double epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, double epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, double epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, double epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, INSLooselyCoupledKalmanInitializerConfig initialConfig) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, INSLooselyCoupledKalmanInitializerConfig initialConfig, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, com.irurueta.units.Time epochInterval) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, com.irurueta.units.Time epochInterval, com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, com.irurueta.units.Time epochInterval, com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, com.irurueta.units.Time epochInterval, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, com.irurueta.units.Time epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, com.irurueta.units.Time epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, com.irurueta.units.Time epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanConfig config, com.irurueta.units.Time epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.Constructor.Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(INSLooselyCoupledKalmanInitializerConfig initialConfig, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(com.irurueta.units.Time epochInterval) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(com.irurueta.units.Time epochInterval, com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(com.irurueta.units.Time epochInterval, com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(com.irurueta.units.Time epochInterval, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(com.irurueta.units.Time epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(com.irurueta.units.Time epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(com.irurueta.units.Time epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, com.irurueta.navigation.frames.ECEFFrame frame, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor.INSLooselyCoupledKalmanFilteredEstimator
(com.irurueta.units.Time epochInterval, INSLooselyCoupledKalmanInitializerConfig initialConfig, INSLooselyCoupledKalmanFilteredEstimatorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
correctKinematics
(BodyKinematics kinematics) Corrects provided kinematics by taking into account currently estimated specific force and angular rate biases.Gets INS loosely coupled Kalman configuration parameters (usually obtained through calibration).boolean
Gets INS loosely coupled Kalman configuration parameters (usually obtained through calibration).Gets corrected kinematics which are the last provided user kinematics after removal of the biases estimated by the Kalman filter.boolean
getCorrectedKinematics
(BodyKinematics result) Gets corrected kinematics which are the las provided user kinematics after removal of the biases estimated by the Kalman filter.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.com.irurueta.navigation.frames.ECEFFrame
getFrame()
Gets ECEF frame containing current or initial user position, velocity and attitude.boolean
getFrame
(com.irurueta.navigation.frames.ECEFFrame result) Gets ECEF frame containing current or initial user position, velocity and attitude.Gets initial INS loosely coupled Kalman configuration to set a proper initial covariance matrix during the first Kalman filter propagation.boolean
Gets initial INS loosely coupled Kalman configuration to set a proper initial covariance matrix during the first Kalman filter propagation.Gets last provided user kinematics containing applied specific force and angular rates resolved in body axes.boolean
getKinematics
(BodyKinematics result) Gets last provided user kinematics containing applied specific force and angular rates resolved in body axes.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.getState()
Gets current Kalman filter state containing current INS estimation along with Kalman filter covariance error matrix.boolean
getState
(INSLooselyCoupledKalmanState result) Gets current Kalman filter state containing current INS estimation along with Kalman filter covariance error matrix.private double
getValueOrZero
(double value) Returns provided value if not infinity and not NaN.private void
Initializes initial INS loosely coupled Kalman configuration to set a proper initial covariance matrix.boolean
Indicates whether this estimator is ready for state propagations.boolean
Indicates whether this estimator is running or not.boolean
Indicates whether this instance is ready to update state using available IMU data (specific force and angular rates).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
Sets INS loosely coupled 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
setFrame
(com.irurueta.navigation.frames.ECEFFrame frame) Sets ECEF frame containing current or initial user position, velocity and attitude.void
setInitialConfig
(INSLooselyCoupledKalmanInitializerConfig initialConfig) Sets initial INS loosely coupled Kalman configuration to set a proper initial covariance matrix during the first Kalman filter propagation.void
Sets listener to notify events raised by this instance.boolean
update
(BodyKinematics kinematics, double timestamp) Updates specific force and angular rate applied to the user's body expressed in coordinates resolved along body-frame axes.boolean
update
(BodyKinematics kinematics, com.irurueta.units.Time timestamp) Updates specific force and angular rate applied to the user's body expressed in coordinates resolved along body-frame axes.
-
Field Details
-
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 less than this value, will be ignored. -
config
INS loosely coupled Kalman filter configuration parameters (usually obtained through calibration). -
kinematics
Last provided user kinematics containing applied specific force and angular rates resolved in body axes. -
correctedKinematics
Contains last provided user kinematics minus currently estimated bias for acceleration and angular rate values. -
frame
private com.irurueta.navigation.frames.ECEFFrame frameContains current or initial user position, velocity and attitude. -
initialConfig
Configuration containing uncertainty measures to set initial covariance matrix within estimated state. Once this estimator is initialized, covariance will be updated with new provided INS measurements until convergence is reached. -
state
Current Kalman filter state containing current INS 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
-
INSLooselyCoupledKalmanFilteredEstimator
public INSLooselyCoupledKalmanFilteredEstimator()Constructor. -
INSLooselyCoupledKalmanFilteredEstimator
public INSLooselyCoupledKalmanFilteredEstimator(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.
-
INSLooselyCoupledKalmanFilteredEstimator
public INSLooselyCoupledKalmanFilteredEstimator(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
public void setEpochInterval(double epochInterval) throws com.irurueta.navigation.LockedException 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 interval are less than this value, will be ignored.- Parameters:
epochInterval
- minimum epoch interval expressed in seconds (s) between consecutive propagations or measurements.- Throws:
com.irurueta.navigation.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
public void setEpochInterval(com.irurueta.units.Time epochInterval) throws com.irurueta.navigation.LockedException 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:
com.irurueta.navigation.LockedException
- if this estimator is already running.IllegalArgumentException
- if provided epoch interval is negative.
-
getConfig
Gets INS loosely coupled Kalman configuration parameters (usually obtained through calibration).- Returns:
- INS loosely coupled Kalman configuration parameters.
-
getFrame
public com.irurueta.navigation.frames.ECEFFrame getFrame()Gets ECEF frame containing current or initial user position, velocity and attitude.- Returns:
- ECEF frame containing current or initial user position, velocity and attitude.
-
getInitialConfig
Gets initial INS loosely coupled Kalman configuration to set a proper initial covariance matrix during the first Kalman filter propagation. Once this estimator is initialized, covariance will be updated with new provided INS measurements until convergence is reached.- Returns:
- initial INS loosely coupled Kalman configuration.
-
getKinematics
Gets last provided user kinematics containing applied specific force and angular rates resolved in body axes.- Returns:
- last provided user kinematics.
-
getCorrectedKinematics
Gets corrected kinematics which are the last provided user kinematics after removal of the biases estimated by the Kalman filter.- Returns:
- corrected kinematics.
- See Also:
-
getState
Gets current Kalman filter state containing current INS estimation along with Kalman filter covariance error matrix.- Returns:
- current Kalman filter state containing current INS 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.
-
isUpdateReady
public boolean isUpdateReady()Indicates whether this instance is ready to update state using available IMU data (specific force and angular rates).- Returns:
- true if ready, false otherwise.
-
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 com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, INSException 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:
com.irurueta.navigation.LockedException
- if this estimator is already running.com.irurueta.navigation.NotReadyException
- if estimator is not ready for measurements updates.INSException
- if estimation fails due to numerical instabilities.
-
propagate
public boolean propagate(double timestamp) throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, INSException 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:
com.irurueta.navigation.LockedException
- if this estimator is already running.com.irurueta.navigation.NotReadyException
- if estimator is not ready for measurements updates.INSException
- if estimation fails due to numerical instabilities.
-
reset
public void reset() throws com.irurueta.navigation.LockedExceptionResets this estimator.- Throws:
com.irurueta.navigation.LockedException
- if this estimator is already running.
-
initInitialConfig
private void initInitialConfig()Initializes initial INS loosely coupled Kalman configuration to set a proper initial covariance matrix. This method makes no action if an initial configuration already exists. -
getValueOrZero
private double getValueOrZero(double value) Returns provided value if not infinity and not NaN.- Parameters:
value
- value to be returned.- Returns:
- value or 0.0.
-