Closed Grey-Hat-07 closed 9 months ago
The total track distance flown for each aircraft is stored in traf.distflown
. You can use it in a plugin like this:
import bluesky as bs
def somefunction():
print(bs.traf.distflown)
You can also plot it while running bluesky: PLOT traf.distflown
Or log it to a CSV file with the following commands:
CRELOG MYLOG 1.0
MYLOG ADD traf.id traf.distflown
MYLOG ON
thanks, it is working.
Is there any similar exists for time taken by the aircraft to complete the trip?
No, although if you are using a logger you can take the difference of the timestep of first occurrence of a callsign and the last occurrence.
Note: While traveling one point to another the aircraft taking 100s of turns.
The function must calculate the total distance traveled by the aircraft