On Sun, Mar 9, 2008 at 10:30 AM, José Ignacio Cogolludo Galán <
[EMAIL PROTECTED]> wrote:
> I am trying to do a simulation of the flight of an aircfraft in Simulink
> to visualize in FlightGear. My model flights correctly, but when it is on
> the ground, the model can't stay here. I mean, my aircraft doesn't recognize
> the level of the ground and it can fly under the ground!, so it won't be
> able to land. I suppose is a problem with the above ground level (AGL)
> between my model in Simulink and Flightgear. Nevertheless, I don't know what
> I need to do. Does anybody how to solve this problem?
This is a classic problem when trying to merge or have cooperation between
two different simulators. If the visual databases are not identical or if
the two simulators use different coordinate systems or geods, then ground
levels may not match, runway locations may not match, ILS approaches may not
be correctly aligned with the runway, etc.
FlightGear can be configured to export a binary structure that includes
ground elevation ... net_ctrls.hxx / FGNetCtrls.
This could be leveraged so that you could continually feed the local ground
elevation into your simulink simulation.
Another thing I have thought about (but would need a bit of programming
work) would be to have a mode where the remote side (simulink, etc.) could
report height above ground rather than absolute altitude. Then the
FlightGear side could compute an absolute altitude to be local ground
elevation + offset.
There is a similar problem I have faced when replaying "real" flight data
from RC planes or from full scale planes. With a "cheap" (as in < $100,000)
data collection system, you may not get an extremely accurate absolute
altitude or position estimate, and the absolute altitude estimate can often
differ by 25 meters or more just between take off, a 10 minute flight, and
landing in the same place. GPS altitude is inaccurate, and the solution can
change and jump around frequently, and cheap pressure sensors are noisy and
need heavy filtering, and are hard to calibrate to factor out velocity
effects. So in some cases it would be useful to be able to switch to a new
mode that just reports "on ground" or height relative to the ground.
Something I've had in the back of my head to play with, but haven't had the
time to look into ...
Moreover, I would like to do more things with my model. For example, I would
> like to introduce sound to my model, or be able to turn on/off the propeller
> using Simulink, but I don't know what I need to do. I have been looking for
> information but there isn't anything clear. Where can I learn this things?
It all boils down to finding ways to have your simulink model change the
corresponding "property" values in FlightGear. So a good start would be to
dig in and get your head around our "property system" and how it ties into
animating 3d models, instruments, visual effects, and sounds.
After that, you need to figure out a way to communicate the data from
simulink to flightgear. One idea would be to "abuse" some unused fields in
the FGNetFDM structure. Then write a little "nasal" script that copies the
interesting data from the abused data slot over to the correct property
name. This isn't all that hard to do, but does require that you take some
time to get your head around how things work in FlightGear so that you can
write a couple lines of add on "nasal" script code to do what you need.
Perhaps others would have ideas for doing the same thing in a different way?
Curtis Olson: http://baron.flightgear.org/~curt/
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
Flightgear-devel mailing list