Skip to content

Commit 74a5f5c

Browse files
committed
debug: linear constraints MHE now works
1 parent d42e165 commit 74a5f5c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/estimator/mhe/execute.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ end
253253

254254
"Set `b` excluding state and sensor noise bounds if `model` is not a [`LinModel`](@ref)."
255255
function linconstraint!(estim::MovingHorizonEstimator, ::SimModel)
256-
Ŵmax, Ŵmax = trunc_bounds(estim, estim.con.Ŵmax, estim.con.Ŵmax, estim.nx̂)
256+
Ŵmin, Ŵmax = trunc_bounds(estim, estim.con.Ŵmin, estim.con.Ŵmax, estim.nx̂)
257257
estim.con.b[:] = [
258258
-estim.con.x̃min
259259
+estim.con.x̃max
260-
-Ŵmax
260+
-Ŵmin
261261
+Ŵmax
262262
]
263263
lincon = estim.optim[:linconstraint]

test/test_state_estim.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Ts = 4.0
22
sys = [ tf(1.90,[18.0,1]) tf(1.90,[18.0,1]) tf(1.90,[18.0,1]);
33
tf(-0.74,[8.0,1]) tf(0.74,[8.0,1]) tf(-0.74,[8.0,1]) ]
4-
#=
4+
55
@testset "SteadyKalmanFilter construction" begin
66
linmodel1 = LinModel(sys,Ts,i_u=[1,2])
77
skalmanfilter1 = SteadyKalmanFilter(linmodel1)
@@ -549,7 +549,7 @@ end
549549
@test [0, 0]
550550
@test isa(x̂, Vector{Float32})
551551
end
552-
=#
552+
553553
@testset "MovingHorizonEstimator construction" begin
554554
linmodel1 = LinModel(sys,Ts,i_d=[3])
555555
f(x,u,d) = linmodel1.A*x + linmodel1.Bu*u + linmodel1.Bd*d

0 commit comments

Comments
 (0)