Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

passing data between a simulink based exe file and Flight Gear using UDP/TCP

408 views
Skip to first unread message

Mansoor Ahsan

unread,
Nov 24, 2009, 6:24:03 AM11/24/09
to
Hi,
I have successfully interfaced a simulink model with Flight Gear Flight Simulator using sub-blocks from 'Flight Simulator interfaces' in the Aerospace Blockset from Simulink Library Browser. The flight gear works with the Advanced options:
Flight Model-- FDM:external
Input/Output--Protocol:native-fdm
Medium:socket
Port:5500
UDP

Now the problem is that i built an exe file using 'rtwbuild' or 'slbuild' functions, but running this exe file doesnt pass any data to Flight Gear. The aircraft model in Flight Gear remains static.

any ideas???? but please keep it simple.... i m close to end this work and can't afford major changes.

Thanks.

Joerg Buchholz

unread,
Dec 8, 2010, 10:14:05 PM12/8/10
to
Did you ever figure out how to make your exe talk to flightgear?

Joerg

Mansoor Ahsan

unread,
Dec 9, 2010, 2:00:22 AM12/9/10
to
Nope. I dropped it. Have you got it going?

Andrew

unread,
Dec 16, 2010, 2:17:05 AM12/16/10
to
"Mansoor Ahsan" <mansoo...@hotmail.com> wrote in message <idpuq6$q3l$1...@fred.mathworks.com>...

> Nope. I dropped it. Have you got it going?

The Flightgear v1.9.1b interface works correctly for me (Matlab R2009b) in Normal and Accelerator Modes. There is a caveat that the flightgear embedded interface block does not support deployable code (e.g. I assume deployable means an executable form of the model).

However, the interface also works in xPC target by replacing the UDP send block within the Flighgear interface block, with the xPC UDP Send block. Perhaps there is an equivalent/similar solution for your target platform.

Joerg Buchholz

unread,
Dec 19, 2010, 6:30:29 PM12/19/10
to
"Mansoor Ahsan" <mansoo...@hotmail.com> wrote in message <idpuq6$q3l$1...@fred.mathworks.com>...
> Nope. I dropped it. Have you got it going?

In my model I used the Pack net_fdm block of the Aerospace Blockset and the UDP Send block of the Signal Processing Blockset (both of which produce deployable code) and the standard grt target to generate a standalone exe that talks to Flightgear. Upon execution the exe asked for a few dlls that I found in the Matlab directories and copied into the exe's directory to make it run without Matlab/Simulink in the background. Then I wrote a nice little Visual Basic program that reads the joystick every millisecond and sends the current value via UDP to the UDP Receive block of the signal processing blockset in my model. Deployable "real-time" is assured by the corresponding block of Guy Rouleau:
http://www.mathworks.com/matlabcentral/fileexchange/21908-simulink%C2%AE-real-time-execution

Gives me a real-time standalone simulator based on my Simulink model. :-)

junaid

unread,
May 30, 2012, 11:50:24 PM5/30/12
to
hey all i am doing a similar project.. what i am doing is i am modeling an aircraft in simulink using aerospace blockset.. the stability parameters are calculated through datcom and then imported into matlab. for simulation purposes i have to use flightgear. also i have to give input through joystick and in real time i have to give command to joystick which gives it to the matlab model and then from there flight gear should demonstrate how aircraft responds.. now can u guide me how to do that? step by step please


0 new messages