Skip to content

Commit fedb137

Browse files
committed
changed: @error instead of @warn in MHE fallback for arrival covariance
following the "convention" throughout the package, a non fatal `@error` make more sense. It's similar to unfeasible MPC problem : something is wrong but there is a fallback: take the solution from the last time step
1 parent cc2a92f commit fedb137

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/estimator/mhe/execute.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ function correct_cov!(estim::MovingHorizonEstimator)
445445
invert_cov!(estim, estim.P̂arr_old)
446446
catch err
447447
if err isa PosDefException
448-
@warn("Arrival covariance is not positive definite: keeping the old one")
448+
@error("Arrival covariance is not positive definite: keeping the old one")
449449
else
450450
rethrow()
451451
end
@@ -465,7 +465,7 @@ function update_cov!(estim::MovingHorizonEstimator)
465465
invert_cov!(estim, estim.P̂arr_old)
466466
catch err
467467
if err isa PosDefException
468-
@warn("Arrival covariance is not positive definite: keeping the old one")
468+
@error("Arrival covariance is not positive definite: keeping the old one")
469469
else
470470
rethrow()
471471
end
@@ -479,7 +479,7 @@ function invert_cov!(estim::MovingHorizonEstimator, P̄)
479479
estim.invP̄ .= inv_cholesky!(estim.buffer.P̂, P̄)
480480
catch err
481481
if err isa PosDefException
482-
@warn("Arrival covariance is not invertible: keeping the old one")
482+
@error("Arrival covariance is not invertible: keeping the old one")
483483
else
484484
rethrow()
485485
end

0 commit comments

Comments
 (0)