Skip to content

Commit

Permalink
bugfix for small kite
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Fechner committed Jun 12, 2024
1 parent 0d337cf commit 5c770da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/flightpathplanner2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function on_new_data(fpp::FlightPathPlanner, depower, length, heading, height, t
elseif state == FLY_LEFT && phi > fpp.fpca._phi_sw
fpp.fpca.fig8 += 1
_switch(fpp, TURN_LEFT)
elseif state == TURN_LEFT && (psi > deg2rad(180.0 + fpp.fpca._heading_offset) || fpp.timeout > fpp.fpps.timeout)
elseif state == TURN_LEFT && (psi > deg2rad(180.0 - fpp.fpca._heading_offset) || fpp.timeout > fpp.fpps.timeout)
_switch(fpp, FLY_RIGHT)
elseif state == FLY_RIGHT && phi >= phi_3
if ! fpp.finish
Expand Down
8 changes: 4 additions & 4 deletions src/kiteobserver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function load_corr()
try
return JLD2.load(joinpath(get_data_path(), "corr_vec.jld2"))["corr_vec"]
catch
return -collect(0.1:0.15:3)*1
return zeros(20)
end
end
function save_corr(corr_vec)
Expand Down Expand Up @@ -82,8 +82,8 @@ end

# correction for first (lowest) turn
function corrected_elev(corr_vec, elev_nom)
if isnothing(corr_vec) || length(corr_vec) == 0 || abs(corr_vec[1]) < 1
return elev_nom+6.5
if isnothing(corr_vec) || length(corr_vec) == 0
return elev_nom
end
elev_nom + 0.7*corr_vec[1]
elev_nom + 0.5*corr_vec[1]
end

0 comments on commit 5c770da

Please sign in to comment.