diff --git a/bin/create_sys_image b/bin/create_sys_image index e82f8682..2dcd5b24 100755 --- a/bin/create_sys_image +++ b/bin/create_sys_image @@ -48,4 +48,5 @@ julia --project -e "using Pkg; Pkg.precompile()" cd src touch *.jl # make sure all modules get recompiled in the next step cd .. -julia --project -J bin/kps-image-${julia_major}-${branch}.so -e "using KiteUtils, KiteControllers, PyPlot" +julia --project -J bin/kps-image-${julia_major}-${branch}.so -e "using KiteUtils, KiteControllers" +julia --project -J bin/kps-image-${julia_major}-${branch}.so -e "using TestEnv; TestEnv.activate(); using PyPlot" diff --git a/examples/autopilot.jl b/examples/autopilot.jl index c04940f7..347f0b68 100644 --- a/examples/autopilot.jl +++ b/examples/autopilot.jl @@ -140,6 +140,9 @@ function play(stopped=false) steps = simulate(integrator, stopped) stopped = ! viewer.sw.active[] GC.enable(true) + if @isdefined __PRECOMPILE__ + break + end end end @@ -164,13 +167,18 @@ on(viewer.btn_PARKING.clicks) do c; parking(); end on(viewer.btn_AUTO.clicks) do c; autopilot(); end on(viewer.btn_STOP.clicks) do c; stop_(); end -play(true) +if @isdefined __PRECOMPILE__ + MAX_TIME = 30 + play(false) +else + play(true) +end stop_() KiteViewers.GLMakie.closeall() GC.enable(true) -if maximum(DELTA_T) > 0 && haskey(ENV, "PLOT") +if maximum(DELTA_T) > 0 && haskey(ENV, "PLOT") && ! @isdefined __PRECOMPILE__ include("../test/plot.jl") plotx(T[1:LAST_I], DELTA_T[1:LAST_I], 100*STEERING[1:LAST_I], 100*DEPOWER_[1:LAST_I], labels=["t_sim [ms]", "steering [%]", "depower [%]"], diff --git a/test/test_for_precompile.jl b/test/test_for_precompile.jl index ba41a90a..e19162a5 100644 --- a/test/test_for_precompile.jl +++ b/test/test_for_precompile.jl @@ -1,5 +1,5 @@ -MAX_TIME::Float64 = 5 -let +__PRECOMPILE__ = true +let include("test_speedcontroller1.jl") include("../examples/autopilot.jl") end