TwinFan / LiveTraffic

LiveTraffic is an X-Plane multiplayer plugin, which fills your sky with live air traffic based on public flight tracking data.
https://twinfan.gitbook.io/livetraffic/
Other
99 stars 24 forks source link

Landing planes don't stay on centerline, turning on touch-down already towards taxiways #210

Closed TwinFan closed 3 years ago

TwinFan commented 3 years ago

Describe the bug Most planes turn at the very moment of touch-down already left or right toward the direction of their later taxiway, not staying on the rwy's centerline during deceleration.

To Reproduce Just watch landings on a busy airport. Attached Log.txt file is from KLAX on 25-JAN-2021, 15:00 Zulu.

Expected behavior Plane stays on centerline until exiting for a taxiway, following runway and taxi centerlines.

Technical Info:

Log.txt Log Turn-on-touch-down.txt

The following landing where followed with full position details per flight:

TwinFan commented 3 years ago

Artificial guidance positions Final and Touch Down are entered to the position list:

0:10:58.365 LiveTraffic DEBUG LTFlightData.cpp:982/CalcNextPos: A0E5D7 OO5854: Added final 33.9375 N / 118.3810 W
0:10:58.365 LiveTraffic DEBUG LTFlightData.cpp:987/CalcNextPos: A0E5D7 OO5854: Added touch-down 33.9370 N / 118.3863 W
0:10:58.365 LiveTraffic DEBUG LTFlightData.cpp:1309/CalcNextPos: DEBUG POS DATA: a/c A0E5D7 OO5854 SimTime: 1611587164.1 - 2021-01-25 15:06:04
a/c ICAO A0E5D7 (E75L OO5854)
<undefined>  <- turn
1611587164.1: (33.93797, -118.37655)   260.4ft  GND_OFF        Final              {h 263 , p   4, r   0} Y: 88.6ft 124kn -600ft/m Phase: 61 Final
posList:
1611587150.0: (33.93900, -118.36688)   401.3ft  GND_OFF        Final              {h 263 , p   4, r   0} <h 263,   960m @ 124kt, -600ft/m>
1611587165.0: (33.93790, -118.37720)   251.0ft  GND_OFF                           {h 263 , p   4, r   0} <h 263,   350m @ 124kt, -703ft/m>
posDeque:
1611587170.5: (33.93754, -118.38097)   186.8ft  GND_OFF RWY    Final              {h 263*, p   0, r   0} <h 263,   500m @ 124kt, -703ft/m>
1611587178.3: (33.93699, -118.38634)    95.1ft   GND_ON RWY    Touch Down         {h 263*, p  10, r   0}

Watch that the Final position is marked RWY...is that correct? That position is still in the air, not down on the runway. On the other hand, the Touch Down position, while correctly marked RWY, does not seem to have snapped to the runway. There is no number indicating which edge in the rwy/taxi network the touch-down point is on. Without that info no proper rwy/taxiway path can be properly followed.

Note: Final and Touch Down are added in the part for auto-land! So the taxi position was so late that LiveTraffic took already action. This is not a normal landing with upfront information down the runway.

When the first Taxi position is added after the Touch Down position snap-to-taxiway takes places, but no intermediate nodes are added to properly roll off the rwy. That's what we need to figure out why!

0:11:07.575 LiveTraffic DEBUG LTFlightData.cpp:1597/AddNewPos: DEBUG ADDED   NEW POS: 1611587233.8: (33.93621, -118.40491)     nanft   GND_ON                           {h 263 , p nan, r nan}
0:11:07.668 LiveTraffic DEBUG LTFlightData.cpp:1796/AppendNewPos: DEBUG POS DATA: a/c A0E5D7 OO5854 SimTime: 1611587173.4 - 2021-01-25 15:06:13
a/c ICAO A0E5D7 (E75L OO5854)
<undefined>  <- turn
1611587173.3: (33.93735, -118.38288)   154.1ft  GND_OFF RWY    Final              {h 263 , p   4, r   0} Y: 91.8ft 124kn -703ft/m Phase: 61 Final
posList:
1611587170.4: (33.93755, -118.38092)   187.6ft  GND_OFF RWY    Final              {h 263 , p   4, r  -1} <h 263,   504m @ 124kt, -703ft/m>
1611587178.3: (33.93699, -118.38634)    95.1ft   GND_ON RWY    Touch Down         {h 263*, p   4, r   0} <h 267,  1715m @  60kt,   19ft/m>
posDeque:
1611587233.8: (33.93621, -118.40491)   113.0ft   GND_ON                           {h 267 , p   0, r   0}
posToAdd:
<empty>
0:11:07.668 LiveTraffic DEBUG LTApt.cpp:1294/SnapToTaxiway: Snapped to taxiway from (33.93621, -118.40491) to (33.93620, -118.40491; edge 1711)
0:11:07.668 LiveTraffic DEBUG LTFlightData.cpp:1309/CalcNextPos: DEBUG POS DATA: a/c A0E5D7 OO5854 SimTime: 1611587173.4 - 2021-01-25 15:06:13
a/c ICAO A0E5D7 (E75L OO5854)
<undefined>  <- turn
1611587173.4: (33.93734, -118.38295)   153.0ft  GND_OFF RWY    Final              {h 263 , p   4, r   0} Y: 91.8ft 124kn -703ft/m Phase: 61 Final
posList:
1611587170.4: (33.93755, -118.38092)   187.6ft  GND_OFF RWY    Final              {h 263 , p   4, r  -1} <h 263,   504m @ 124kt, -703ft/m>
1611587178.3: (33.93699, -118.38634)    95.1ft   GND_ON RWY    Touch Down         {h 263*, p   4, r   0} <h 267,  1715m @  60kt,   19ft/m>
posDeque:
1611587233.8: (33.93620, -118.40491)   113.0ft   GND_ON TXI    Taxi          1711 {h 263*, p   0, r   0}
TwinFan commented 3 years ago

When trying to reproduce in my standard EDKB scenario I had to note that the taxiway positions after touch down are discarded as invalid:

0:05:02.986 LiveTraffic DEBUG LTFlightData.cpp:1567/IsPosOK: BC614E DEEZU: Invalid vector <h 283,   814m @  40kt, -272ft/m> with headingDiff = -7 (max vsi = 2500ft/min, max speed = 280kn, min speed = 50kn, max hdg diff = 180)

Here because the speed restriction is not met. In real logs I do see many "Invalid vector" lines due to too slow speeds, too. This here might be a valid reason. This needs to be avoided!

Fix: No IsPosOK comparison between positions for which the ground flag differs, so that we don't use flight rules when on ground and vice versa.

TwinFan commented 3 years ago

Lot's of scattered fixes in the SnapToTaxiway function like wrong heading calculation. Inserted special handling if coming from a rwy, e.g. allowing for higher speed in total and especially in the first leg.