Skip to content

Commit

Permalink
debug: Julia nightly Hermitian constructor with Bool vectors (fro…
Browse files Browse the repository at this point in the history
…m`I(n)`)
  • Loading branch information
franckgaga committed Aug 7, 2024
1 parent b5525c9 commit a9da68a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions src/estimator/kalman.jl
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ struct KalmanFilter{NT<:Real, SM<:LinModel} <: StateEstimator{NT}
validate_kfcov(nym, nx̂, Q̂, R̂, P̂_0)
lastu0 = zeros(NT, nu)
x̂0 = [zeros(NT, model.nx); zeros(NT, nxs)]
Q̂, R̂ = Hermitian(Q̂, :L), Hermitian(R̂, :L)
P̂_0 = Hermitian(P̂_0, :L)
P̂_0 = Hermitian(NT.(P̂_0), :L)
Q̂, R̂ = Hermitian(NT.(Q̂), :L), Hermitian(NT.(R̂), :L)
= copy(P̂_0)
K̂, M̂ = zeros(NT, nx̂, nym), zeros(NT, nx̂, nym)
corrected = [false]
Expand Down Expand Up @@ -478,8 +478,8 @@ struct UnscentedKalmanFilter{NT<:Real, SM<:SimModel} <: StateEstimator{NT}
nσ, γ, m̂, Ŝ = init_ukf(model, nx̂, α, β, κ)
lastu0 = zeros(NT, nu)
x̂0 = [zeros(NT, model.nx); zeros(NT, nxs)]
Q̂, R̂ = Hermitian(Q̂, :L), Hermitian(R̂, :L)
P̂_0 = Hermitian(P̂_0, :L)
P̂_0 = Hermitian(NT.(P̂_0), :L)
Q̂, R̂ = Hermitian(NT.(Q̂), :L), Hermitian(NT.(R̂), :L)
= copy(P̂_0)
= zeros(NT, nx̂, nym)
= Hermitian(zeros(NT, nym, nym), :L)
Expand Down Expand Up @@ -797,9 +797,8 @@ struct ExtendedKalmanFilter{NT<:Real, SM<:SimModel} <: StateEstimator{NT}
validate_kfcov(nym, nx̂, Q̂, R̂, P̂_0)
lastu0 = zeros(NT, nu)
x̂0 = [zeros(NT, model.nx); zeros(NT, nxs)]
P̂_0 = Hermitian(P̂_0, :L)
= Hermitian(Q̂, :L)
= Hermitian(R̂, :L)
P̂_0 = Hermitian(NT.(P̂_0), :L)
Q̂, R̂ = Hermitian(NT.(Q̂), :L), Hermitian(NT.(R̂), :L)
= copy(P̂_0)
K̂, M̂ = zeros(NT, nx̂, nym), zeros(NT, nx̂, nym)
F̂_û, Ĥ = zeros(NT, nx̂+nu, nx̂), zeros(NT, ny, nx̂)
Expand Down
4 changes: 2 additions & 2 deletions src/estimator/mhe/construct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ struct MovingHorizonEstimator{
validate_kfcov(nym, nx̂, Q̂, R̂, P̂_0)
lastu0 = zeros(NT, nu)
x̂0 = [zeros(NT, model.nx); zeros(NT, nxs)]
P̂_0 = Hermitian(P̂_0, :L)
Q̂, R̂ = Hermitian(, :L), Hermitian(, :L)
P̂_0 = Hermitian(NT.(P̂_0), :L)
Q̂, R̂ = Hermitian(NT.(Q̂), :L), Hermitian(NT.(R̂), :L)
invP̄ = Hermitian(inv(P̂_0), :L)
invQ̂_He = Hermitian(repeatdiag(inv(Q̂), He), :L)
invR̂_He = Hermitian(repeatdiag(inv(R̂), He), :L)
Expand Down

0 comments on commit a9da68a

Please sign in to comment.