Skip to content

Commit

Permalink
add timeout to fpp_settings.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Fechner committed May 1, 2024
1 parent 6c04114 commit f9c99db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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 > 145)
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 All @@ -120,7 +120,7 @@ function on_new_data(fpp::FlightPathPlanner, depower, length, heading, height, t
_switch(fpp, UP_TURN_LEFT)
elseif state == FLY_RIGHT && phi < -fpp.fpca._phi_sw # &&
_switch(fpp, TURN_RIGHT)
elseif state == TURN_RIGHT && (psi < deg2rad(180.0 + fpp.fpca._heading_offset) || fpp.timeout > 145)
elseif state == TURN_RIGHT && (psi < deg2rad(180.0 + fpp.fpca._heading_offset) || fpp.timeout > fpp.fpps.timeout)
if fpp.fpps.log_level > 0
println("timeout TURN_RIGHT: $(fpp.timeout)")
end
Expand Down
1 change: 1 addition & 0 deletions src/fpp_settings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
heading_offset_up::Float64 = 60.0
heading_upper_turn::Float64 = 360.0-25.0
k_factor::Float64 = 1.0
timeout::Float64 = 145
end

StructTypes.StructType(::Type{FPPSettings}) = StructTypes.Mutable()
Expand Down

0 comments on commit f9c99db

Please sign in to comment.