Skip to content

Commit ce5dc4d

Browse files
ufechner7Copilot
andcommitted
Fix global ssc definitions
Co-authored-by: Copilot <copilot@github.com>
1 parent 15f4c05 commit ce5dc4d

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎examples/learn_corrections.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ MAX_ITER = 70 # maximum number of training iterations
4949
using ControlPlots, KiteControllers, LinearAlgebra, NonlinearSolve
5050
import JLD2
5151

52-
ssc = nothing
52+
global ssc::SystemStateControl
5353

5454
# Effective norm: exclude residuals for elements that are floor-clamped and still
5555
# pushing lower — those crossings are physically unreachable and should not block
@@ -101,7 +101,7 @@ function residual(corr_vec=nothing; full_sim=false)
101101
fpps.log_level = full_sim ? fpps.log_level : 1 # dots only during training; full output for full_sim
102102
u_d0 = 0.01 * set.depower_offset
103103
u_d = 0.01 * set.depowers[1]
104-
ssc = SystemStateControl(wcs, fcs, fpps; u_d0, u_d, v_wind=set.v_wind)
104+
ssc::SystemStateControl = SystemStateControl(wcs, fcs, fpps; u_d0, u_d, v_wind=set.v_wind)
105105
if ! isnothing(corr_vec)
106106
ssc.fpp.corr_vec = corr_vec
107107
end

‎examples/minipilot.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function init_globals(kcu, wcs, fcs, fpps)
3030
fpps = FPPSettings(true)
3131
u_d0 = 0.01 * set.depower_offset
3232
u_d = 0.01 * set.depowers[1]
33-
ssc = SystemStateControl(wcs, fcs, fpps; u_d0, u_d, v_wind=set.v_wind)
33+
ssc::SystemStateControl = SystemStateControl(wcs, fcs, fpps; u_d0, u_d, v_wind=set.v_wind)
3434
end
3535

3636
# the following values can be changed to match your interest

‎examples/minipilot_12.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function init_globals(kcu, wcs, fcs, fpps)
3232
fpps = FPPSettings(true)
3333
u_d0 = 0.01 * set.depower_offset
3434
u_d = 0.01 * set.depowers[1]
35-
ssc = SystemStateControl(wcs, fcs, fpps; u_d0, u_d, v_wind=set.v_wind)
35+
ssc::SystemStateControl = SystemStateControl(wcs, fcs, fpps; u_d0, u_d, v_wind=set.v_wind)
3636
end
3737

3838
# the following values can be changed to match your interest

0 commit comments

Comments
 (0)