Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
Fixed wrong angle calculation, I got the wrong distance measurement f…
Browse files Browse the repository at this point in the history
…or it.

Also retweaked the timing of the audio, again...
  • Loading branch information
Uriei committed Oct 11, 2018
1 parent 718dc82 commit b95c427
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions EDPlanetBearing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ def calcAngDesc(): # Angle of descent


try:
descent_angle = - int(math.degrees(math.atan(current_alt / distance_meters)))
descent_angle = - int(math.degrees(math.atan(current_alt / distance_surface)))
print("Angle of Descent: " + str(descent_angle))

try:
Expand All @@ -1026,18 +1026,28 @@ def calcAngDesc(): # Angle of descent
else: # Angle calculations for normal flight and supercruise
# WIP Delay calculations need testing!!!
current_delay = 10.0
angle_delay = {
-5:2.0,
-10:1.8,
-20:1.6,
-30:1.4,
-40:1.2,
-50:1.0,
-60:0.75,
-90:0.0
}
if flag_sc != 0:
angle_delay = {
-5:2.0,
-10:1.8,
-20:1.4,
-30:1.0,
-40:0.75,
-90:0.0
}
else:
angle_delay = {
-5: 2.0,
-10: 1.8,
-20: 1.6,
-30: 1.4,
-40: 1.2,
-50: 1.0,
-60: 0.75,
-90: 0.0
}
for a, d in angle_delay.items():
if descent_angle > a:
if descent_angle >= a:
current_delay = d
break
ping_delay_mult = current_delay
Expand Down

0 comments on commit b95c427

Please sign in to comment.