Class EKF¶
Defined in File ekf.h
Inheritance Relationships¶
Base Type¶
public lupnt::KalmanFilter(Class KalmanFilter)
Derived Types¶
public lupnt::SRIF(Class SRIF)public lupnt::SchmidtEKF(Class SchmidtEKF)public lupnt::UDUEKF(Class UDUEKF)
Class Documentation¶
-
class EKF : public lupnt::KalmanFilter¶
Extended Kalman Filter (EKF): linearized predict/update with Joseph-form covariance update, residual-based outlier rejection, and RTS smoothing.
The standard recursive estimator used throughout LuPNT’s navigation applications (e.g. LNSS receiver/satellite state estimation) — registered with the
Filterasset factory under the name"EKF"so it can be constructed from YAML config.Subclassed by lupnt::SRIF, lupnt::SchmidtEKF, lupnt::UDUEKF
Public Functions
-
EKF() = default¶
-
EKF(Config &config)¶
Construct an EKF from a YAML config node, reading the optional
outlier_thresholdfield (default 3.0 sigma).
-
virtual ~EKF() = default¶
-
void SetOutlierThreshold(double outlier_threshold)¶
Set the outlier-rejection threshold (in standard deviations of the normalized residual
dz_i / sqrt(S_ii)) used byRemoveOutliers.- Parameters:
outlier_threshold – Threshold in sigma; must be non-negative
-
void SetConsiderStateCount(int n_consider)¶
Configure the trailing
n_considerelements of the state vector as Schmidt “consider” states, turning thisEKFinto a Schmidt (consider- parameter) Extended Kalman Filter (also available pre-configured asSchmidtEKF, seeschmidt_ekf.h).Consider states are still propagated (
Predict) and contribute to the measurement JacobianH_and hence to the Kalman gain and covariance bookkeeping inUpdate, but are never corrected:Updatezeros the trailingn_considerrows of the Kalman gainK_before applying the state correction, so their mean is left unchanged while their (co)variance — including cross-covariance with the estimated states — still updates consistently (the Joseph-form covariance update is valid for any gain, optimal or not). This is the standard “gain zeroing” implementation of the Schmidt-Kalman filter.- Parameters:
n_consider – Number of trailing state elements to treat as consider states (0 disables consider-state handling)
-
inline int GetConsiderStateCount() const¶
Get the number of trailing consider states configured via
SetConsiderStateCount(0 if this is a plain EKF).
-
void RemoveOutliers()¶
Drop measurement components whose normalized residual
|dz_i| / sqrt(S_ii)exceedsoutlier_threshold_, shrinkingdz_,H_,R_, and recomputingS_accordingly.Called by
Updateas the default fault-detection step (when no customf_fault_det_is registered viaSetFaultDetectionFunction), after the residualdz_and innovation covarianceS_have been computed but before the Kalman gain is applied.
-
virtual void Predict(Real t, const State *u = nullptr) override¶
EKF predict step: propagate
x_/P_viaf_dyn_(linearized by the returned STMF_) and add the process noiseQ_fromf_proc_, i.e.P_ = F_ P_ F_^T + Q_.
-
virtual void Update(const VecX &z_true) override¶
EKF update step: linearized measurement update with Joseph-form covariance propagation
P_ = (I - K H) P (I - K H)^T + K R K^T, including outlier rejection viaRemoveOutliers(or a registered fault-detection function) before the Kalman gainK_ = P H^T S^-1is applied.
-
virtual void InitializeLogger(int max_tidx) override¶
EKF implementation of
KalmanFilter::InitializeLogger: allocates thex_prior_log_/P_prior_log_/x_pos_log_/P_pos_log_/stm_log_/x_sm_/P_sm_buffers formax_tidxepochs.
-
virtual void InitializeSmootherState() override¶
EKF implementation of
KalmanFilter::InitializeSmootherState: seedsx_sm_/P_sm_at the final time index with the currentx_post_/P_post_.
-
virtual void LogFilterEstimate(int tidx) override¶
EKF implementation of
KalmanFilter::LogFilterEstimate: records the current prior/posterior state, covariance, and state-transition matrixF_at indextidx.
-
virtual void UpdateSmoother(int tidx) override¶
EKF implementation of
KalmanFilter::UpdateSmoother: standard RTS smoother recursion using the logged prior/posterior states, covariances, and state-transition matrices.
-
EKF() = default¶