Hi Andy,

I didn't see anyone else respond so I thought I'd give you some pointers.

The Matlab plugin seems to be part of Simulink's Aerospace blockset. I'm 
by no means an expert on Matlab, but I would think that it should come 
with the Matlab installer as an optional component to install... I could 
be wrong though.

Anyway, in case you can't get that working and are looking for 
alternative solutions, here's some C++ code that extracts data from 
Flightgear and would allow you to modify it to control the aircraft:

http://code.google.com/p/binarymillenium/source/browse/trunk/flightgear/?r=125#flightgear%2Ffgauto

The net_fdm.hxx and net_ctrls.hxx files are from Flightgear and define 
two data structures that can be sent and received by fgfs. In your 
program you can receive the FGNetCtrls structure, change the parameters 
you want to control, and send it back.

The following fgfs parameters will create the control sockets:
--native-ctrls=socket,in,10,127.0.0.1,5600,udp
--native-ctrls=socket,out,10,127.0.0.1,5700,udp

You will likely also need FDM data:
--native-fdm=socket,out,10,127.0.0.1,5500,udp

Also there is a Wiki page about creating a new custom protocol for 
interfacing to Flightgear that might be helpful:

http://wiki.flightgear.org/Howto:Create_a_generic_protocol

Hope this helps.

Cheers,
Vik

On 07/10/2012 04:16 AM, Andrew Tudor wrote:
> Hi,
>
> I have a thread here:
> http://www.flightgear.org/forums/viewtopic.php?f=42&t=16853 where I
> was directed to contact this email with questions. First, let me
> explain my goal with FlightGear. I would like run FG and take
> real-time data from it. I do not want to provide my own model, I would
> like to use one already established (the P51D was suggested to me).
> The data I would like to get is position (x,y,z), orientation
> (pitch,yaw,roll) and control surface information (elevator, ailerons,
> throttle, rudder). Modifying the control surface data is also
> important. With that data inside Simulink I will feed that to LabView
> using the Simulation Interface Toolkit (SIT) provided by NI which will
> then be interfaced with our hardware. I have had a few questions and
> it might be better to ask here rather than the forums.
>
> - From what I understand control surfaces can be modified using this
> block: 
> http://www.mathworks.com/help/toolbox/aeroblks/packnet_fdmpacketforflightgear.html
> ?
> - How can I get position and orientation information? I can instead
> use the velocity of the aircraft with respect to the wind if that is
> available? In general I want a way to define a level flight path.
> - I have been trying to find these two blocks in Simulink:
>
> http://www.mathworks.com/help/toolbox/aeroblks/receivenet_ctrlpacketfromflightgear.html
> http://www.mathworks.com/help/toolbox/aeroblks/unpacknet_ctrlpacketfromflightgear.html
>
> but I can't find them. I have the other 4 blocks but not these. I
> initially was using 2.6.0 but noticed that the web page was referring
> to 2.0 so I switched versions with no success. I have been looking in:
> Simulink Library Browser>  Aerospace Blockset>  Animation>  Flight
> Simulator Interfaces.
>
> -Do you think it is possible in FG to get the variables I need? I am
> not worried about interfacing the programs once I can access the
> variable in Simulink (or for that matter LabView) that I need. This
> whole interfacing and project set up is new to me so any help you can
> give would be great. Please forward this to anyone you think can be of
> help.
>
> Thanks!
> Andy
>
>
> Andrew W. Tudor
> University of California, Los Angeles
> Graduate Student in Mechanical and Aerospace Engineering
> University of Illinois, Urbana-Champaign
> B.S. Aerospace Engineering
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to