Re: Using flightgear with SIMULINK

"Curtis L. Olson" <[email protected]> Sun, 22 May 2005 13:30:37 -0500
Newsgroups gmane.games.flightgear.flightmodel
Message-ID <[email protected]>
bass pumped wrote:

>Hi all,
>
>Elaborating on my initial question... I think it can actually be split
>into two...
>
>The first one is about the networking options on Flightgear.  I have
>already been able to use Flightgear on two boxes, one with JBsim and
>the other with a null FDM and taking input from the first box.  The
>problem is that any variations on that have failed.  Trying to do the
>same thing with the native-ctrls for example leads to the aircraft in
>the second to be stuck half in the sea at dusk.
>

It sounds like you are passing native-ctrls over, but still using a null 
fdm on the remote side.  If nothing is updating the location/orientaiton 
on the remote side, you will be stuck at lat=0, lon=0 which is in the 
middle of the ocean.

>The point is that I
>need a bidirectional data stream from the first box which runs
>Flightgear.  The pilot would use that box; it would send out current
>conditions which would then be processed by Simulink.  On the return
>side, Simulink would act as a damper, smoothening out the pilot's
>inputs and making sure the aircraft stays within a certain flight
>envelope.  My question is on setting up Flightgeat to accept data in
>this manner.
>  
>

I don't think FlightGear can act as you are hoping without some fiddling 
around.  You want FlightGear to read pilot input, send it out to matlab, 
have matlab process it, and then send pilot inputs back to FG.  If you 
do this, you will have contention between the raw pilot inputs and the 
processed pilot inputs.  You would either (a) need to map the raw pilot 
inputs to a separate area of the property tree, then send those over to 
matlab, and then return the processed pilot inputs to be stored in the 
standard property tree that the FG FDM is using for pilot input.  Or (b) 
you could write some separate module to take pilot input (completely 
outside flightgear) and then pass it to matlab, crunch it, and pass the 
processed values back to FG.

>The second one is about sequence in which data is sent out from the
>Flightgear box to the other.  I looked at the FDM hxx and cxx file,
>and correct me if I am wrong, the data has to be 64 bit data and in
>order starting from the latitude and longitude of the aircraft and so
>on and so forth......   The reason I need to know this is so that I
>maybe able to modify my MATLAB code to read this right.  I have output
>the above into a file and tried to read it in VC++ but all I see is
>hex code in a sequence.
>
>  
>

You need to look at the definition of the specific structure that is 
being sent ... probably FGNetFDM and FGNetCtrls ... in 
src/Native/net_fdm.hxx and src/Native/net_ctrls.hxx respectively.  You 
can include these structures in other code, slurp in the packet over the 
net and reference the values directly.

Regards,

Curt.

-- 
Curtis Olson        http://www.flightgear.org/~curt
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:        2f585eeea02e2c79d7b1d8c4963bae2d


_______________________________________________
Flightgear-flightmodel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-flightmodel
2f585eeea02e2c79d7b1d8c4963bae2d