Skip to content

Commit 9442a30

Browse files
committed
Merge origin/extension into extension
2 parents f66c105 + 321e447 commit 9442a30

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

ext/LinearMPCext.jl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ function Base.convert(::Type{LinearMPC.MPC}, mpc::ModelPredictiveControl.LinMPC)
1717
Nc = Hc = mpc.Hc
1818
newmpc = LinearMPC.MPC(F, G; Gd, C, Dd, Np, Nc)
1919
# --- Operating points ---
20-
xo = estim.x̂op
21-
uo = model.uop
22-
yo = model.yop
23-
if !iszero(model.dop)
24-
@warn "LinearMPC does not support measured disturbance operating points dop.\n" *
25-
"Ensure to subtract the operating point from the measurement at each time "*
26-
"step before solving the MPC problem."
27-
end
20+
uoff = model.uop
21+
doff = model.dop
22+
yoff = model.yop
23+
xoff = estim.x̂op
24+
foff = estim.f̂op
25+
LinearMPC.set_offset!(newmpc; uo=uoff, ho=yoff)
2826
# --- State observer parameters ---
2927
Q, R = estim.cov.Q̂, estim.cov.
3028
set_state_observer!(newmpc; C=estim.Ĉm, Q, R)

0 commit comments

Comments
 (0)