Board index FlightGear Support Interfacing

FlightGear/Simulink Interface

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

FlightGear/Simulink Interface

Postby SuperSniper » Wed Jan 10, 2007 8:51 pm

Does it exit a free-of-charge FlightGear/Simulink Interface for FlightGear version 0.9.10?

Aerosim Blockset (www.u-dynamics.com/aerosim/) provided such an interface (compiled S-function .dll) for the version 0.9.8 of FlightGear.
Academic and non-commercial users (such as government organizations) may download the Aerosim Blockset free of charge.

Aerospace Blockset 2.2 (http://www.mathworks.com/products/aeroblks/) provides now in one of its new blocks a new interface for versions up to 0.9.10. But the use of this interface requires the installation of this expensive blockset.

Is anyone coding or willing to implement an open FlightGear 0.9.10 / Matlab/Simulink Interface? I think it will be very useful for the whole FlightGear users community.

Looking forward to reading your comments.
SuperSniper
 
Posts: 1
Joined: Wed Jan 10, 2007 8:01 pm

Postby Shihan » Wed Feb 28, 2007 10:59 am

Dear SuperSniper!
I worked a lot on this problem and I implemented in C code an interface between Matlab and Simulink. I can't send you my code because it is copyrighted by my company.
I suggest you to download the FG source of the v098 and that one of the version 0.910. Download Areosim code of FGitnerface v0.98.
In FG_SRC_ROOT\src\Network you may find the USP class for the UDP socket protocol (native_ctrls.hxx and native_fdm.hxx). Look at the difference in these files between the FG v0.98 and FG0.910 and add new C code in the FGinterface in AeroSim for FGv0.98 to write by yourself the new interface for FGv0.910.
Bye, Mauro
Shihan
 
Posts: 2
Joined: Tue Feb 27, 2007 6:46 pm
Location: ITALY

Postby tcbetka » Sat Mar 10, 2007 3:47 pm

Interesting...

How do you use Matlab with FlightGear? Very intriguing indeed.

TB
MD, CFII, A&P
(Aero Eng Student)
tcbetka
 
Posts: 17
Joined: Wed Feb 07, 2007 4:15 am
Location: Green Bay, WI

What about FlightGear data back to Simulink?

Postby jstevenson » Mon Mar 12, 2007 4:12 pm

tcbetka wrote:Interesting...

How do you use Matlab with FlightGear? Very intriguing indeed.

TB


There is a free blockset (for non=commercial users) available from Unmanned Dynamic Inc called AeroSIM, for the creation of very accurate 6DOF aircraft simulations. Included in the latest AeroSIM version is an interface for sending visualization information to either MS FlightSim (not too good - uses SLEW mode) or to FlightGear v0.9.8 or before.

FlightGear can be run with NO flight model - actually it's set to fdm=external meaning it will then expect the aircraft dynamics to be calculated somewhere else and FG then just becomes a fancy display/picture show.

As far as I know the Simulink (AeroSIM) to FG interface is only one-way. However, I would love to know if there's a way to get some of the internal FG variables out and back to simulink - for example the Ground elevation which in FG tracks the terrain data, or the positions of othe AI objects like ships or other planes (which could be used for automatic target tracking for example in Simulink!)
==========================
Jonathan D. Stevenson, M. Eng. (Aero)
Project Raven
Memorial University
St. John's, NL
Canada A1B 3X5
Tel: 709-737-3771
Fax: 709-737-6193
E-mail: stevenson@engr.mun.ca
jstevenson
 
Posts: 6
Joined: Mon Mar 12, 2007 3:21 pm
Location: St.John's NL Canada

FLightgear to MATLAB Interface?

Postby jstevenson » Mon Mar 12, 2007 4:30 pm

Shihan wrote:Dear SuperSniper!
I worked a lot on this problem and I implemented in C code an interface between Matlab and Simulink. I can't send you my code because it is copyrighted by my company.
I suggest you to download the FG source of the v098 and that one of the version 0.910. Download Areosim code of FGitnerface v0.98.
In FG_SRC_ROOT\src\Network you may find the USP class for the UDP socket protocol (native_ctrls.hxx and native_fdm.hxx). Look at the difference in these files between the FG v0.98 and FG0.910 and add new C code in the FGinterface in AeroSim for FGv0.98 to write by yourself the new interface for FGv0.910.
Bye, Mauro


Hello Mauro,

Did you implement an interface that send internal FG variable information BACK to Simulink? I want to use the internal FG variable for the Ground elevation as the Ground Elevation in my AeroSIM simulation. This would ensure that my landing simulation visuals are sync'd with the actual terrain elevation (or at least how it's defined in FG - 40m elev data grid!).

Right now, the AeroSIM to FG interface is only one-way. I need something going the other way too!

Any pointers or suggestions on how best to proceed?

-Jon
==========================
Jonathan D. Stevenson, M. Eng. (Aero)
Project Raven
Memorial University
St. John's, NL
Canada A1B 3X5
Tel: 709-737-3771
Fax: 709-737-6193
E-mail: stevenson@engr.mun.ca
jstevenson
 
Posts: 6
Joined: Mon Mar 12, 2007 3:21 pm
Location: St.John's NL Canada

Re: FLightgear to MATLAB Interface?

Postby RollnThndr » Mon Aug 20, 2007 7:40 pm

jstevenson wrote:
Hello Mauro,

Did you implement an interface that send internal FG variable information BACK to Simulink? I want to use the internal FG variable for the Ground elevation as the Ground Elevation in my AeroSIM simulation. This would ensure that my landing simulation visuals are sync'd with the actual terrain elevation (or at least how it's defined in FG - 40m elev data grid!).

Right now, the AeroSIM to FG interface is only one-way. I need something going the other way too!

Any pointers or suggestions on how best to proceed?

-Jon


Hi Jon,

Did you ever figure out a way to get FG data into Simulink? I've been looking for a solution to this as well. At the moment, I think my only choice is going to be to manually write something for Simulink that will receive the FG data.
RollnThndr
 
Posts: 6
Joined: Thu Jul 26, 2007 3:05 pm

Postby RollnThndr » Mon Aug 20, 2007 7:42 pm

Shihan wrote: add new C code in the FGinterface in AeroSim for FGv0.98 to write by yourself the new interface for FGv0.910.
Bye, Mauro


Hi Shihan,

Where can a guy find some good examples for writing C code for these blocksets. I think this is what I'm going to have to do as well.

Thanks for any info.
RollnThndr
 
Posts: 6
Joined: Thu Jul 26, 2007 3:05 pm


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 2 guests