Board index FlightGear Support

Output of Data for a project  Topic is solved

All general support: help on flying, installation, hardware, getting online etc. There are lots of users and developers to help you out.
Forum rules
In order to help you, we need to know a lot of information. Make sure to include answers to at least the following questions in your initial post.

- what OS (Windows Xp/Vista, Mac etc.) are you running?
- what FlightGear version do you use?
- what graphics card do you have?
- does the problem occur with any aircraft, at any airport?
- where did you download your aircraft/scenery from?
- is there any output printed to the console (black window)?
- copy&paste your commandline (tick the "Show commandline box on the last page of FGRun or the "Others" section on the Mac launcher).

Please report any bugs not specific to an aircraft on the issue tracker.
To run FlightGear on old computers with bad OpenGL support, please take a look at this wiki article.

Note: If you did not get a reponse, even after 7 days, you may want to check out the FlightGear mailing lists to ask your question there.

Output of Data for a project

Postby nakedMoleRat » Fri Mar 15, 2019 2:40 pm

I am in my final year of uni and I am looking for a flight simulator that will allow me to output real-time data of the aircraft. I am looking for a data dump once per second or so to a file or http so I can take it and make a fuzzy logic flight controller. I have seen you guys output your panels to a web browser and wondered if there is a quick way I can get the rest of the data out. I.'m willing to dev it myself if I can just get a heads up of where to start. Cheers
nakedMoleRat
 
Posts: 2
Joined: Fri Mar 15, 2019 2:35 pm
Version: 2018.3.2
OS: Windows 10

Re: Output of Data for a project

Postby legoboyvdlp » Fri Mar 15, 2019 3:02 pm

You can output the data using the generic protocol to a .csv file: for example,

add this to a file (e.g. fdr.xml) under data/Protocol

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>


Then run FlightGear with:
Code: Select all
--generic=file,out,RATE,fdr.csv,fdr


The rate is in Hz - e.g. 20 would be 20 times a second.

See this for more documentation:
http://wiki.flightgear.org/Generic_protocol
http://wiki.flightgear.org/Howto:Create ... c_protocol
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Output of Data for a project  

Postby nakedMoleRat » Sun Mar 17, 2019 12:41 pm

Thank you for the quick response, seems to be working for me. Hopefully this gives me everything I need
nakedMoleRat
 
Posts: 2
Joined: Fri Mar 15, 2019 2:35 pm
Version: 2018.3.2
OS: Windows 10


Return to Support

Who is online

Users browsing this forum: No registered users and 10 guests