On Wednesday 24 October 2007 18:30, Melchior FRANZ wrote:
> * leee -- Wednesday 24 October 2007:
> > the FDM operates at a fixed rate (I believe the default is 120 Hz)
> > but nearly everything else, afaikt, operates at the frame rate,
> > which varies.
>
> Yes, but most Nasal code does things that influence visuals/sound
> (like instrument stuff, view handling, etc.), so there's a natural
> relationship with the frame rate. Tying Nasal to the frame rate
> therefor makes sense. Otherwise we would probably see interference
> artifacts ... good old jitter.  :-)
>
> Only FDM stuff would like to be tied to the FDM update rate, and
> I think that's a desirable goal. What about a callback function
> then? The FDM subsystem would set /sim/signals/fdm-update, and you
> could attach a listener to that which does all the things that
> should interact with the FDM, such as AP, FCS, etc. The rest of
> Nasal would keep running with the frame rate.
>
> There's just one (minor) problem at the moment. There's no generic
> FDM update() function where one could put a sig.setDoubleValue(dt).
> This would have to be done in all FDMs.
>
> Interested aircraft would then do something like ...
>
>    setlistener("/sim/signals/fdm-update", func(n) {
>        var dt = n.getValue();
>        # ... and whatever needs to be done at fdm rate
>    });
>
> m.

The idea of an FDM callback function sounds as though it would work but 
the A/P controllers and filters, which were the real problem, are 
independent of Nasal and would remain a problem until they could 
guarantee a fixed rate regardless of the frame rate.  This is essential 
for reliable operation because they are time based.

I think I really have to agree with Curt - a FBW subsystem would be 
better written in C/C++ and perhaps Nasal isn't really suited to it, 
although as I said in my reply to him, Nasal seemed ideal for trying 
out untested ideas and developing a framework that could then be coded 
in C/C++ and configured in xml.

LeeE

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to