Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

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

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

From: Mansoor Ahsan

Date: 24 Nov, 2009 11:24:03

Message: 1 of 6

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.

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

From: Joerg Buchholz

Date: 9 Dec, 2010 03:14:05

Message: 2 of 6

Did you ever figure out how to make your exe talk to flightgear?

Joerg

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

From: Mansoor Ahsan

Date: 9 Dec, 2010 07:00:22

Message: 3 of 6

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

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

From: Andrew

Date: 16 Dec, 2010 07:17:05

Message: 4 of 6

"Mansoor Ahsan" <mansoor_ahsan@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.

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

From: Joerg Buchholz

Date: 19 Dec, 2010 23:30:29

Message: 5 of 6

"Mansoor Ahsan" <mansoor_ahsan@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. :-)

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

From: junaid

Date: 31 May, 2012 03:50:24

Message: 6 of 6

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

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us