Skip to content

Commit 05e4156

Browse files
committed
debug julia 1.6 Diagonal coversions
1 parent d091191 commit 05e4156

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/predictive_control.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ struct LinMPC{S<:StateEstimator} <: PredictiveController
7979
model = estim.model
8080
nu, ny = model.nu, model.ny
8181
validate_weights(model, Hp, Hc, Mwt, Nwt, Lwt, Cwt, ru)
82-
M_Hp = Diagonal(repeat(Mwt, Hp))
83-
N_Hc = Diagonal(repeat(Nwt, Hc))
84-
L_Hp = Diagonal(repeat(Lwt, Hp))
82+
M_Hp = Diagonal(convert(Vector{Float64}, repeat(Mwt, Hp)))
83+
N_Hc = Diagonal(convert(Vector{Float64}, repeat(Nwt, Hc)))
84+
L_Hp = Diagonal(convert(Vector{Float64}, repeat(Lwt, Hp)))
8585
C = Cwt
8686
# manipulated input setpoint predictions are constant over Hp :
8787
R̂u = ~iszero(Lwt) ? repeat(ru, Hp) : R̂u = Float64[]
@@ -312,9 +312,9 @@ struct NonLinMPC{S<:StateEstimator} <: PredictiveController
312312
model = estim.model
313313
nu, ny = model.nu, model.ny
314314
validate_weights(model, Hp, Hc, Mwt, Nwt, Lwt, Cwt, ru, Ewt)
315-
M_Hp = Diagonal(repeat(Mwt, Hp))
316-
N_Hc = Diagonal(repeat(Nwt, Hc))
317-
L_Hp = Diagonal(repeat(Lwt, Hp))
315+
M_Hp = Diagonal(convert(Vector{Float64}, repeat(Mwt, Hp)))
316+
N_Hc = Diagonal(convert(Vector{Float64}, repeat(Nwt, Hc)))
317+
L_Hp = Diagonal(convert(Vector{Float64}, repeat(Lwt, Hp)))
318318
C = Cwt
319319
# manipulated input setpoint predictions are constant over Hp :
320320
R̂u = ~iszero(Lwt) ? repeat(ru, Hp) : R̂u = Float64[]

0 commit comments

Comments
 (0)