Board index FlightGear Support Interfacing

extract flight data in csv format and then read it by matlab

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

extract flight data in csv format and then read it by matlab

Postby nima.nader123 » Tue Jan 16, 2018 7:23 am

hello every body
I hope you all have a good day ahead .
I am pretty beginner in working with flightgear .
i need to have a fly with flightgear and record data in the csv file and then read that data via Matlab.
I take a glance on generic protocol, but i could not understand a lot :( :( :cry:
could you please help me to do that ?

Thanks in advance for your replies!

regards
Nima
nima.nader123
 
Posts: 1
Joined: Tue Jan 16, 2018 7:08 am

Re: extract flight data in csv format and then read it by ma

Postby jam007 » Tue Jan 16, 2018 11:22 am

One way is to use Nasal to write the properties you want to a file.
See example GPX-logger
For more on properties see here and here
jam007
 
Posts: 579
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04

Re: extract flight data in csv format and then read it by ma

Postby wkitty42 » Tue Jan 16, 2018 11:28 am

unless you really need networking protocol capabilities, you could just modify the craft you're going to fly and have it log the data to a file instead of over engineering things... then simply transfer that file to the matlab machine and use it there... take a look at the c172p's xml files... specifically the end of c172p.xml... there's a commented out section that creates a CSV file of the given properties... you'll do pretty much the same thing and no protocols, networking or nasal needed...

always remember and never forget, KIS... Keep It Simple ;)
"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: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: extract flight data in csv format and then read it by ma

Postby jam007 » Tue Jan 16, 2018 2:37 pm

:idea: All these hidden gems in FG...
Code: Select all
    <output name="JSBout172C.csv" type="CSV" rate="60">
      <property> aero/qbar-psf </property>
      <property> accelerations/udot-ft_sec2 </property>
      <property> accelerations/vdot-ft_sec2 </property>
      <property> accelerations/wdot-ft_sec2 </property>
      <property> accelerations/a-pilot-x-ft_sec2 </property>
      <property> accelerations/a-pilot-y-ft_sec2 </property>
      <property> accelerations/a-pilot-z-ft_sec2 </property>
      <property> accelerations/n-pilot-x-norm    </property>
      <property> accelerations/n-pilot-y-norm    </property>
      <property> accelerations/n-pilot-z-norm    </property>
      <rates> ON </rates>
      <velocities> ON </velocities>
      <forces> ON </forces>
      <moments> ON </moments>
      <position> ON </position>
      <fcs> OFF </fcs>
      <propulsion> OFF </propulsion>
      <aerosurfaces> OFF </aerosurfaces>
      <fcs> OFF </fcs>
      <ground_reactions> OFF </ground_reactions>
    </output>


Where Here is the documentation ?
jam007
 
Posts: 579
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 1 guest