Board index FlightGear Support Interfacing

Extracting flight data from recorded flights

Connecting two computers, using generic protocol, connecting with Matlab?

Extracting flight data from recorded flights

Postby CasJanM » Mon Feb 09, 2015 2:47 pm

Good afternoon,

i would like to use the flight data recorded during the flight in the .fgtape format.

However, i don't want to watch the replay but compare the recordednumbers of the replay with i.e. an ideal flight curve. For this reason, i'd like to extract the data from the file to work with it. How can i proceed? Is it already implemented in a way?

Greetings
CasJanM
 
Posts: 5
Joined: Mon Feb 09, 2015 2:39 pm

Re: Extracting flight data from recorded flights

Postby Hooray » Mon Feb 09, 2015 3:12 pm

There are several ways to do this, but it's probably not recommended/designed to be used this way. It should be much easier to simply use any of the other logging methods to log the corresponding values/properties to a buffer and either put the data into a file or send it across a socket. FlightGear's I/O means are generally pretty simple and flexible, so it would probably be much more work to reverse engineer the serialization scheme used by the fgtape format - simply because you can configure your own "protocol" and do with the data whatever you want, without having to use any workarounds at all.

One of the most straightforward methods is this: http://wiki.flightgear.org/Generic_protocol
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11273
Joined: Tue Mar 25, 2008 8:40 am

Re: Extracting flight data from recorded flights

Postby CasJanM » Tue Feb 10, 2015 9:50 am

Thank you for the replies in both of the threads.

As i derived from them, you suggest to write a logging file, defining the parameters i want to use. This will then create me a CSV file during my "live" flight.

However i already have some .fgtape files i would like to analyze. The first solution coming to my mind now, is to replay the .fgtape using FlightGear and now log the parameters of the flight by using a new XML file.

Is there a solution to not use FlightGear, but to just (and excuse my lack of professional terms) take the .fgtape and extract all the recorded parameters in a CSV file? Or do i have to use FlightGear as a link, because of the structure?

Thank you in advance
CasJanM
 
Posts: 5
Joined: Mon Feb 09, 2015 2:39 pm

Re: Extracting flight data from recorded flights

Postby Hooray » Tue Feb 10, 2015 9:55 am

your "first solution" is the easiest one I can think of, and the one I woudl use.
If you cannot use FG, I would still use FG to convert the tape to the format to desire, using any of the means/methods listed above.
Otherwise, you will literally have to write a parser/converter for the fgtape format - which is possible, but much more tedious.
To do that however, you could basically come up with your own SGSubsystem-based program and simply include the flight recorder subsystem there to read/parse and process the file without having to manually re-implement the system.

to just (and excuse my lack of professional terms) take the .fgtape and extract all the recorded parameters in a CSV file? Or do i have to use FlightGear as a link, because of the structure?


I'd definitely favor your first method.
I would just use FG to convert the fgtape file into a CSV file (or any other format that you need) by coming up with either a generic protocol or a logging spec and then replaying the fgtape file to create the new file, which should roughly take 5-10 minutes.

Like you said, the structure is pretty "free-form", so will be based on the XML spec for the corresponding aircraft:

Subject: Replay Conversion
Hooray wrote:Johan_G is correct, see $FG_ROOT/Docs/flightrecorder.README for details

The flight data will be meaningless without being interpreted/run and visualized via FlightGear.


Subject: Replay Conversion
Hooray wrote:
HelldiverSquadron wrote in Mon Apr 21, 2014 6:54 pm:Seemed like a binary trait. I opened it in Notepad ++, but it was just rubbish. I don't mean that it is a video format, but rather could I import it into, say, Blender, and then export it as something else? It's way too optimistic, I know. Thanks, all!

again, the format is basically seralized FlightGear properties, please see $FG_ROOT/Docs/flightrecorder.README - these are all just "numbers", the format is determined by FlightGear, and these numbers do not mean ANYTHING outside FlightGear, and even inside FlightGear it's really just the flight recorder subsystem that is able to open/process those files, read in the numbers and map them to the corresponding FlightGear properties - which in turn allows things to be animated/replayed over time JUST VIA FlightGear.

There's really no need to continue this discussion at all - all the responses given so far were rather exact, detailed and 100% correct. There's no reasonable way to visually "replay" those files outside FlightGear, short of rewriting FlightGear itself, or extending another flight simulator to partially re-interpret certain values. Unless that is something that you are interested, willing and capable to do, I'd just leave it at that.

What FlightGear is writing to those files is not actual "visual" stuff at all, it's just "gibberish" in the sense of properties that are only meaningful to FlightGear itself, and its features, most properties are in fact aircraft specific. Imagine those files to be containers for binary FlightGear properties, i.e. things like altitude, longitude, latitude - but also engine settings, flap settings, gear status etc.

So there's really just numbers stored there, nothing visual that would make sense to visually re-interpret outside a flight simulator environment like FlightGear.

To actually replay even just a single aircraft specific animation in FlightGear, you would have to write a python script that 1) loads the aircraft, 2) looks up the 3D objects, 3) maps the properties to animations - and completely ignore anything related to scenery, because it's typically just aircraft specific stuff that is recorded.

Please just believe us, and consider spending more time reading and understanding what you're told, instead of re-asking redundant questions, thank you ! :D
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11273
Joined: Tue Mar 25, 2008 8:40 am

Re: Extracting flight data from recorded flights

Postby CasJanM » Tue Feb 10, 2015 12:05 pm

Thank you very much for the indepth answers. Please consider the matter solved, i will use the first method and replay the files while logging them.

Greetings
CasJanM
 
Posts: 5
Joined: Mon Feb 09, 2015 2:39 pm

Re: Extracting flight data from recorded flights

Postby Hooray » Tue Feb 10, 2015 12:23 pm

sounds like a good plan - if you'd like to "give back" to the community, I'd like to encourage you to check out the wiki, which is a very easy way to contribute back - e.g. you could write an article documenting your project there - or even just document the steps you took to convert an fgtape into a CSV via FlightGear, along with a few screen shots. Doing that may seem superfluous to you now, but it will help others -like you- getting started doing similar things. In addition, any content contributed there can be easily reused for the FlightGear newsletter, which is another worthwhile effort to support. So assuming that we have probably saved you hours of coding now, it would be great if you could spare a few minutes to document your project and contribute to the wiki, to help others wanting to do similar things.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11273
Joined: Tue Mar 25, 2008 8:40 am


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 1 guest