Python script to convert flight simulator data to KML format similar to BlackBox flightlogger
Currently, FlightGear and X-Plane 11 are supported. However, other versions of X-Plane might also work, though they were not tested yet. The operating system does not matter, which is the main goal of the project.
- Python 3.6 or later
- Python modules:
- Pandas
- YAML
- simplekml
In order to receive flight data from a simulator, the latter should be configured properly.
Go to the Settings menu, and navigate to "Data Output" tab and "General Data Output" subtab. In the table in the column "Disk (data.txt) File" check boxes for the following options:
- Timers (1)
- Speeds (3)
- Mach, VVI, g-load (4)
- Trim, flap, stats, & speedbrakes (13)
- Pitch, roll, & headings (17)
- Latitude, longitude, & altitude (20)
- Marker status (105)
- Warning status (127)
Optional. You might also want to check those options in the "Show in cockpit" column in order to see all parameters in flight. Though, it is not recommended as it could distract the pilot, which is not what we want to get during critical stages of flight.
Optional. In addition, you might want to play with the "Disk Rate" parameter. In sets data write times per second. Howver, the default value of 10 is recommended.
Now, after every flight you should find "Data.txt" file in your X-Plane 11 installation folder.
Copy sim_to_kml.py from Protol folder to the existing Protocol folder in your FlightGear instalation directory ($FG_ROOT/Protocol).
In FlightGear launcher window under Settings -> Additional settings or in command line as an argument to fgfs add the following text, replacing <Export dir> with the path to the desired flight log output directory:
--generic=file,out,10,<Export dir>/flightlog.csv,sim_to_kml
Remark. You should probaably use backslash ("\") if running on Windows.
Use the following syntax:
sim_to_kml.py src_file [dst_file]
"src_file" is a path to X-Plane's Data.txt or flightlog.csv from the plugin for FlightGear.
"dst_file" is a path to the file you would like to get. If not stated, the file will be called "Flightlog <flight-date/time>.kml" in the current folder.
