From 7dda54969667bfdb3d268164525503d26a8b05c0 Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Thu, 14 Nov 2024 17:41:44 +0100 Subject: [PATCH] fix logging of height --- examples/autopilot.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/autopilot.jl b/examples/autopilot.jl index 7584a6e..8c78053 100644 --- a/examples/autopilot.jl +++ b/examples/autopilot.jl @@ -187,7 +187,7 @@ function simulate(integrator, stopped=true) # t_sim = @elapsed KiteModels.next_step!(app.kps4, integrator; set_speed=v_ro, dt=app.dt) sys_state.orient .= calc_orient_quat(app.kps4) - update_sys_state!(sys_state, app.kps4) + sys_state=SysState(app.kps4) acc = (app.kps4.vel_kite - last_vel)/app.dt last_vel = deepcopy(app.kps4.vel_kite) @@ -283,6 +283,7 @@ function simulate(integrator, stopped=true) end function play(stopped=false) + global flight_log while isopen(app.viewer.fig.scene) if ! app.initialized init(app) @@ -300,6 +301,7 @@ function play(stopped=false) if app.set.log_level > 0 println("Saving log... $(app.logger.index)") end + flight_log = KiteUtils.sys_log(app.logger) save_log(app.logger, basename(DEFAULT_LOG); path=dirname(DEFAULT_LOG)) end if @isdefined __PRECOMPILE__