Skip to content

Commit 0590477

Browse files
committed
added: tips about ManualEstimator in error message
1 parent 5776a19 commit 0590477

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/controller/construct.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
const MSG_LINMODEL_ERR = "estim.model type must be a LinModel, see ManualEstimator docstring "*
2+
"to use a nonlinear state estimator with a linear controller"
3+
14
struct PredictiveControllerBuffer{NT<:Real}
25
u ::Vector{NT}
36
::Vector{NT}

src/controller/explicitmpc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function ExplicitMPC(
157157
N_Hc = Diagonal(repeat(Nwt, Hc)),
158158
L_Hp = Diagonal(repeat(Lwt, Hp)),
159159
) where {NT<:Real, SE<:StateEstimator{NT}}
160-
isa(estim.model, LinModel) || error("estim.model type must be a LinModel")
160+
isa(estim.model, LinModel) || error(MSG_LINMODEL_ERR)
161161
nk = estimate_delays(estim.model)
162162
if Hp nk
163163
@warn("prediction horizon Hp ($Hp) ≤ estimated number of delays in model "*

src/controller/linmpc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ function LinMPC(
256256
transcription::TranscriptionMethod = DEFAULT_LINMPC_TRANSCRIPTION,
257257
optim::JM = JuMP.Model(DEFAULT_LINMPC_OPTIMIZER, add_bridges=false),
258258
) where {NT<:Real, SE<:StateEstimator{NT}, JM<:JuMP.GenericModel}
259-
isa(estim.model, LinModel) || error("estim.model type must be a LinModel")
259+
isa(estim.model, LinModel) || error(MSG_LINMODEL_ERR)
260260
nk = estimate_delays(estim.model)
261261
if Hp nk
262262
@warn("prediction horizon Hp ($Hp) ≤ estimated number of delays in model "*

0 commit comments

Comments
 (0)