Board index FlightGear Support Interfacing

How to extract flight data?

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

Re: How to extract flight data?

Postby V12 » Thu Aug 29, 2019 1:59 pm

I will try help You.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1567
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: How to extract flight data?

Postby wkitty42 » Fri Aug 30, 2019 12:28 am

sunxiaoe wrote in Thu Aug 29, 2019 6:59 am:I mainly do some research on airborne navigation systems and want to use FG to get some relevant data.

this sounds like you are wanting to gather flight properties of a craft in flight... if that's the case, you'll be likely looking into the generic protocol to communicate with an external device controlling the craft or possibly just logging the properties of a craft in FG that already exists... in this last case, it is simply a matter to add some slight code to the craft to have it log the desired properties in a CSV file which you can later process...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5695
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: How to extract flight data?

Postby sunxiaoe » Fri Aug 30, 2019 1:19 am

V12, thank you very much for your help.
sunxiaoe
 
Posts: 18
Joined: Tue Aug 27, 2019 10:53 am

Re: How to extract flight data?

Postby sunxiaoe » Fri Aug 30, 2019 1:21 am

Wkitty42, I mean this. I checked Wikipedia, FG does have this technology, I may need some time to deal with specific details, thank you very much for your advice.
sunxiaoe
 
Posts: 18
Joined: Tue Aug 27, 2019 10:53 am

Re: How to extract flight data?

Postby V12 » Fri Aug 30, 2019 6:41 am

sunxiaoe :
I'm logging data to the file via generic output protocol with command --generic=file,out,1,fdr.csv,fdr added to the startup parameters in launcher's Settings tab :

Image

Where fdr.csv is output file and fdr is fdr.xml file in Protocol folder. And here is exmaple of protocol definition :

Code: Select all
<?xml version="1.0"?>
<PropertyList>
 <generic>
  <output>
   <line_separator>newline</line_separator>
   <var_separator>:</var_separator>
   <chunk>
    <name>METAR</name>
    <type>string</type>
    <format>%s</format>
    <node>/environment/metar/station-id</node>
   </chunk>
   <chunk>
    <name>Indicated alt</name>
    <type>float</type>
    <format>%f</format>
    <node>/instrumentation/altimeter[0]/indicated-altitude-ft</node>
   </chunk>
   <chunk>
    <name>Pressure inhg</name>
    <type>float</type>
    <format>%f</format>
    <node>/environment/pressure-inhg</node>
   </chunk>
   <chunk>
    <name>Pressure sea level ingh</name>
    <type>float</type>
    <format>%f</format>
    <node>/environment/pressure-sea-level-inhg</node>
   </chunk>
   <chunk>
    <name>KIAS</name>
    <type>float</type>
    <format>%f</format>
    <node>/instrumentation/airspeed-indicator[0]/indicated-speed-kt</node>
   </chunk>
   <chunk>
    <name>TAS </name>
    <type>float</type>
    <format>%f</format>
    <node>instrumentation/tas-indicator/indicated-speed-fps</node>
    <factor>0.592484</factor>
   </chunk>
   <chunk>
    <name>GS </name>
    <type>float</type>
    <format>%f</format>
    <node>/velocities/groundspeed-kt</node>
   </chunk>
   <chunk>
    <name>wind direction</name>
    <type>float</type>
    <format>%f</format>
    <node>/environment/wind-from-heading-deg</node>
   </chunk>
   <chunk>
    <name>wind speed</name>
    <type>float</type>
    <format>%f</format>
    <node>/environment/wind-speed-kt</node>
   </chunk>
   <chunk>
    <name>stat_pressure</name>
    <type>float</type>
    <format>%f</format>
    <node>/systems/static[0]/pressure-inhg</node>
   </chunk>
   <chunk>
    <name>total_pressure</name>
    <type>float</type>
    <format>%f</format>
    <node>/systems/pitot[0]/measured-total-pressure-inhg</node>
   </chunk>
  </output>
 </generic>
</PropertyList>


Value 1 is frequency of the data logging - in this case meand log data every second. For 10 logs per second use parameter 10.

Specify please for what aircraft and what parameters do You want to logging, I can try make specific protocol for Your dataloger.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1567
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: How to extract flight data?

Postby sunxiaoe » Fri Aug 30, 2019 8:27 am

Ok, I will try it, thank you very much
sunxiaoe
 
Posts: 18
Joined: Tue Aug 27, 2019 10:53 am

Previous

Return to Interfacing

Who is online

Users browsing this forum: No registered users and 3 guests