Virtual CoPilot: Difference between revisions
mNo edit summary |
|||
Line 360: | Line 360: | ||
|author=<nowiki>Hooray</nowiki> | |author=<nowiki>Hooray</nowiki> | ||
|date=<nowiki>Wed Sep 22</nowiki> | |date=<nowiki>Wed Sep 22</nowiki> | ||
}} | |||
}} | |||
== Porting FGFSCoPilot to Nasal == | |||
{{FGCquote | |||
| I applaud you for actually considering the port now! I'd suggest to use a Nasal sub module, so that you can easily structure your code and use separate Nasal source files for the main features: [[Nasal_scripting_language#Nasal_sub_modules]] | |||
|{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=153769#p153769 | |||
|title=<nowiki>Re: Porting FGFSCopilot over to XML/Nasal</nowiki> | |||
|author=<nowiki>Hooray</nowiki> | |||
|date=<nowiki>Wed Mar 21</nowiki> | |||
}} | |||
}} | |||
{{FGCquote | |||
| I've already started work on the Nasal portion. That was before I even read your post. I'd say I got about an eighth done right now. I've been having a lack of focus today.... Otherwise, I probably would have had the whole thing done in the few hours I spent on it. It's got several functions - mainly for all the different phases of flight. I think I'll just finish what I have for now, and test it. At least I know what's suppose to go where in the dialog. | |||
|{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=153775#p153775 | |||
|title=<nowiki>Re: Porting FGFSCopilot over to XML/Nasal</nowiki> | |||
|author=<nowiki>redneck</nowiki> | |||
|date=<nowiki>Wed Mar 21</nowiki> | |||
}} | |||
}} | |||
{{FGCquote | |||
|The whole idea of "sub modules" is just to allow code to be loaded "on demand", so that users can decide if they want to load certain code (think local weather) or not - in part, this is also meant to allow users to allow users to improve frame rate, i.e. by reducing the pressure on the Nasal garbage collector. This is because all *.nas files in $FG_ROOT/Nasal will be loaded by default, including many timers and listeners. The added advantage of sub modules is that your code can be split up into several different files, which will be loaded in the same namespace automatically. | |||
|{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=153803#p153803 | |||
|title=<nowiki>Re: Porting FGFSCopilot over to XML/Nasal</nowiki> | |||
|author=<nowiki>Hooray</nowiki> | |||
|date=<nowiki>Thu Mar 22</nowiki> | |||
}} | |||
}} | |||
{{FGCquote | |||
|The broader functionality of the V.copilot is interesting and one seeks to contribute towards an FGFS generic design. Optimistically (or me just being naive), any teknikal and syntax problem is relatively easy to resolve; when the underlying design issues are addressed. One can always substitute alternative tekniq and code if the current one proves to be too trouble-some. | |||
|{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=154083#p154083 | |||
|title=<nowiki>Re: Porting FGFSCopilot over to XML/Nasal</nowiki> | |||
|author=<nowiki>awexome</nowiki> | |||
|date=<nowiki>Mon Mar 26</nowiki> | |||
}} | |||
}} | |||
{{FGCquote | |||
|However, there is need for a design focus, and a few related questions may help (me, for one :) : | |||
* For this V.copilot, Is there a particular purpose for having some of the various info on the gui (e.g., aircraft type, fuel, cruise alt. and airport info)? Such info could be reliably accessed from the prop. tree and route-manager; and in doing so, one minimises data entry errors and data duplication. | |||
* How would the various nav. selections be useful for the V.copilot operation? Any relation to course-tracking, landing and radio nav. setup? | |||
* What particular functions (e.g., FREDA checks, etc.) are being performed by this V.copilot implementation? | |||
* Are the autopilot locks (see,in your 'nasal' code) applicable to other AC types? (I will be posting a generic FGFS autopilot helper module that is relevant, and may be useful, in this context. | |||
On a related issue, I have made the V.copilot setup (base design from the 787-8 menu) accessible via the CDU | |||
|{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=154083#p154083 | |||
|title=<nowiki>Re: Porting FGFSCopilot over to XML/Nasal</nowiki> | |||
|author=<nowiki>awexome</nowiki> | |||
|date=<nowiki>Mon Mar 26</nowiki> | |||
}} | }} | ||
}} | }} |
Revision as of 17:42, 12 September 2014
This article is a stub. You can help the wiki by expanding it. |
Work in progress This article or section will be worked on in the upcoming hours or days. See history for the latest developments. |
Problem
Note
|
I am absolutely convinced that these autopilot/copilot tools are a great idea for FG, but I also believe anybody not coding this directly IN FlightGear by using Nasal, is making it more complicated than necessary. So, I will try to support anybody who is actually looking into porting this over to "native FlightGear space" by reimplemting such efforts in Nasal space instead - adding a bunch of extension functions to enrich the API is easy and well documented actually. Anybody knowing C++ (or Java for that matter), should be able to understand what's involved: Howto:Extending_Nasal
|
Background
state machines would be helpful here, IMO, unless you just need something basic. Offtopic, but I've thought a little bit about this and I think a custom syntax (read: DSL) would be helpful... [/egoist] (oh wait, I still need to get it off the ground) But I do not like the idea of using XML at all as I think you (Hooray) might've suggested before, my limit of XML tolerance is FDMs and PropertyList, not scripts, as those tags get comber some. Maybe having something in a Nasal object would be possible as well, something like a pseudo-linked list with loops would not be hard. — Philosopher (Sat Jan 19). Re: Copilot announcements: Nasal don't works!.
(powered by Instant-Cquotes) |
Zakalawe has recently started adding state machine support to SimGear: https://gitorious.org/fg/simgear/commit ... cf79cd0f57 It will probably take a while until this becomes available to Nasal scripts, but Tom has added a module called "cppbind" to SimGear to more easily expose C++ stuff to Nasal scripts (and vice versa). |
Basically, PropertyList XML files already support stateful expressions using the SGCondition syntax. While that's pretty verbose, it's still pretty straightforward. I think the tutorial system uses them, too (? - havent' checked) |
Objective
Runway Overrun Protection System
Some kind of separate Nasal submodule would seem to make - for details, see: Creating_new_Nasal_scripts#Nasal_sub_modules
|
It uses math, geo, and apt, so I guess it should live in Nasal/runway/runway_announcer.nas then.
|
FREDA Announcements
If you want to make changes to it, you can directly fork the script here: http://codepad.org/sSM4Guru
|
Porting FGFSCoPilot to Nasal
I applaud you for actually considering the port now! I'd suggest to use a Nasal sub module, so that you can easily structure your code and use separate Nasal source files for the main features: Nasal_scripting_language#Nasal_sub_modules
|