You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/estimator/kalman.jl
+21-13Lines changed: 21 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -698,13 +698,15 @@ function correct_estimate!(estim::UnscentedKalmanFilter, y0m, d0)
698
698
X̄, Ȳm = X̂0, Ŷ0m
699
699
X̄ .= X̂0 .- x̂0
700
700
Ȳm .= Ŷ0m .- ŷ0m
701
+
#TODO: use estim.buffer.R̂ here to reduce allocations
701
702
M̂.data .= Ȳm * Ŝ * Ȳm'.+ R̂
702
703
mul!(K̂, X̄, lmul!(Ŝ, Ȳm'))
703
704
rdiv!(K̂, cholesky(M̂))
704
705
v̂ = ŷ0m
705
706
v̂ .= y0m .- ŷ0m
706
707
x̂0corr, P̂corr = estim.x̂0, estim.P̂
707
708
mul!(x̂0corr, K̂, v̂, 1, 1)
709
+
#TODO: use estim.buffer.P̂ and estim.buffer.Q̂ here to reduce allocations
708
710
P̂corr .=Hermitian(P̂ .- K̂ * M̂ * K̂', :L)
709
711
returnnothing
710
712
end
@@ -714,14 +716,16 @@ end
714
716
715
717
Update [`UnscentedKalmanFilter`](@ref) state `estim.x̂0` and covariance estimate `estim.P̂`.
716
718
717
-
It implements the unscented Kalman Filter in its predictor (observer) form, based on the
718
-
generalized unscented transform[^3]. See [`init_ukf`](@ref) for the definition of the
719
-
constants ``\mathbf{m̂, Ŝ}`` and ``γ``.
719
+
It implements the unscented Kalman Filter based on the generalized unscented transform[^3].
720
+
See [`init_ukf`](@ref) for the definition of the constants ``\mathbf{m̂, Ŝ}`` and ``γ``. The
721
+
superscript in e.g. ``\mathbf{X̂}_{k-1}^j(k)`` refers the vector at the ``j``th column of
722
+
``\mathbf{X̂}_{k-1}(k)``. The symbol ``\mathbf{0}`` is a vector with zeros. The number of
723
+
sigma points is ``n_σ = 2 n_\mathbf{x̂} + 1``. The matrices ``\sqrt{\mathbf{P̂}_{k-1}(k)}``
724
+
and ``\sqrt{\mathbf{P̂}_{k}(k)}`` are the the lower triangular factors of [`cholesky`](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#LinearAlgebra.cholesky)
725
+
results. The correction and prediction step equations are provided below. The correction
726
+
step is skipped if `estim.direct == true` since it's already done by the user.
720
727
721
-
Denoting ``\mathbf{x̂}_{k-1}(k)`` as the state for the current time ``k`` estimated at the
722
-
last period ``k-1``, ``\mathbf{0}``, a null vector, ``n_σ = 2 n_\mathbf{x̂} + 1``, the number
723
-
of sigma points, and ``\mathbf{X̂}_{k-1}^j(k)``, the vector at the ``j``th column of
724
-
``\mathbf{X̂}_{k-1}(k)``, the estimator updates the states with:
0 commit comments