Board index FlightGear Development Nasal

Spoken ATC

Nasal is the scripting language of FlightGear.

Re: Spoken ATC

Postby wkitty42 » Sun Aug 13, 2017 6:20 pm

hehehe, it was mainly clarification for others reading along ;) ;)

i looked over the article briefly and from what i saw, it is fine...

FWIW: i'm working on converting the cockpit-view mod to the --addon format... i'm testing it as we speak :mrgreen:
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5779
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Spoken ATC

Postby Hooray » Sun Aug 13, 2017 6:44 pm

wkitty42 wrote in Sun Aug 13, 2017 6:20 pm:FWIW: i'm working on converting the cockpit-view mod to the --addon format... i'm testing it as we speak :mrgreen:


as I mentioned previously, I believe it is a good idea to coordinate such changes with Torsten, especially in order to work out useful enhancements to the underlying addon "framework", so that we can identify overlapping functionality and instead of replicating such features per-addon, we could move certain functions to the addon.nas file itself.

For instance, I mentioned previously, that it would probably make sense to introduce <name>, <version> and <authors> tags at the config.xml level, analogous to how -set.xml files have been structured for years - not just for the sake of consistency, but also to prepare addons for potentially being deployed/updated and managed using the still evolving catalog/package manager backends.

Speaking in general, $FG_ROOT/Nasal has pretty much become a "dump space" over the years, pretty much after mfranz's "departure", whereas it used to be primarily about "library" code primariyl - thus, helping cleaning up $FG_ROOT/Nasal to incrementally move optional/non-key functionality out of $FG_ROOT/Nasal would seem like a good idea - especially for people wanting to see less Nasal code running in the main loop - for the time being, many modules are loaded uncondtionally, despite really being optional.

Then again, it would probably make sense to consider introducing something along the lines of $FG_ROOT/Addons or rather $FG_HOME/Addons at some point, to ship/install pre-included addons, that are packaged during the release process, without end-users having to install those manually.

Doing so would be a great way to reduce the number of Nasal modules that are currently loaded without being required, and only load those on an opt-in basis.

Anyway, if people are envisioning their addons to be potentially managed/updated and installed/removed using FlightGear itself, it definitely makes sense to introduce and use meta-information in the form of <version> attributes, not just per addon, but also for the addon API itself. Otherwise, it will be next to impossible to make breaking changes in the future, which would complicate any efforts to extend the framework over time.

So, if -based on your current porting effort, you should have anything to add to the wiki article, please do feel invited to do so.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11377
Joined: Tue Mar 25, 2008 8:40 am

OT: cockpit-view (was: Re: Spoken ATC)

Postby wkitty42 » Sun Aug 13, 2017 7:46 pm

well, it didn't go as i had intended... i had looked to split the nasal from the xml and have all the nasal in the main.nas file with everything else in the config.xml but i couldn't get that to work... probably due to name spaces and the registration function in the original script looking in globals...

so, i went the easy way and left everything in config.xml and gave main.nas an empty main()... it works as it should with everything still in the same places in the property tree as if it were done with the --config method... i've been rooting around in the wiki for information but everything i've found while i was trying to work this out was much too simplistic and i just couldn't convert it to what i was looking at and what i thought i was looking for...

anyway, it works and can be used by others but i'm not happy with it because i should be able to split it apart like i originally intended to do... sorry for the hijack... i'll start another topic about it because it really should be able to be split apart...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5779
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Spoken ATC

Postby Hooray » Sun Aug 13, 2017 8:02 pm

yeah, there are different namespaces involved now - if in doubt, see the caller() and closure() APIs to dump your current namespace tree to the console - you can use debug.dump() to do so once you have a handle to the namespace.
You would probably want to do that for both files: config.xml as well as main.nas
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11377
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby wkitty42 » Sun Aug 13, 2017 8:11 pm

"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5779
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Spoken ATC

Postby Alant » Sun Aug 13, 2017 10:52 pm

Is there any work on GCA (ground controlled approach) in progress, or have missed it?

GCA is surprisingly accurate and easy to use, both as a pilot and a controller.

In the 1970´s we tried it on the simulator that I ran at BAC Weybridge. My impression was that it was easier than watching ILS /GLS deviations, At decision height (200ft) when the runway light display projector was turned on, I as pilot) or the pilot that I was directing (as ATC operator) were always perfectly lined up.

GCA, with the RAF vocabulary that we used, is very good for teaching students how to follow the glidepath.

Alan

Alan
Alant
 
Posts: 916
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: Spoken ATC

Postby Hooray » Mon Aug 14, 2017 4:25 pm

It would not be difficult to implement, I have previously posted code snippets related to this.
Even though I am not sure if it fits into the scope of this particular "addon" - however, it's up to rleibner to decide obviously ;-)

the helpers in geo.nas should be more than sufficient to help us come up with a GCA module and a simple "controller" class that controls an aircraft by monitoring its glide path/vector and issuing instructions accordingly.

As a matter of fact, it would also not be that far-fetched to hook up the same control logic to a tanker.nas based AI-piloted aircraft

I would definitely be interested in helping with this for the reasons that Alant mentioned - however, if this is done as part of the spoken ATC addon, I would be interested in working out the infrastructure changes to make it possible to implement this at the XML level, analogous to tutorials/missions, just with a focus on ATC

http://wiki.flightgear.org/Tutorials
http://wiki.flightgear.org/Missions

Back when Marius_A was working on his "missions" framework, I actually tinkered with an XML-based mechanism that would allow people to register Nasal callbacks as XML tags, so that the whole system becomes self-contained - the basic idea can still be seen here: http://wiki.flightgear.org/FlightGear_M ... _Framework
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11377
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby rleibner » Tue Aug 15, 2017 1:32 pm

Alant wrote in Sun Aug 13, 2017 10:52 pm:Is there any work on GCA (ground controlled approach) in progress, or have missed it?
GCA is surprisingly accurate and easy to use, both as a pilot and a controller.

Hooray wrote in Mon Aug 14, 2017 4:25 pm:It would not be difficult to implement, I have previously posted code snippets related to this.
Even though I am not sure if it fits into the scope of this particular "addon" - however, it's up to rleibner to decide obviously ;-)

I think it's a very interesting challenge that deserves to be explored. Hooray, would you point me to such code snippets?
If Alan agrees, I would welcome his participation as a co-author to integrate CGA into SpokenATC.
As it is said in terms of soccer, "Alan, the ball is in your field now" :D
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 246
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: 2180.4.0
OS: Ubuntu 18.04

Re: Spoken ATC

Postby Alant » Wed Aug 16, 2017 8:21 am

Yes, I can supply limited help. I have a reasonably good idea of how the
system works in real life. The code in fgdata/nasal glide_slope_tunnel.nas
and geo.nas is a good start for getting G/S and LOC errors. Local wind
conditions are in the property tree. These are needed to select preferred
runway direction and to estimate track from heading.

Be aware that I am retired for 10 years and my programming skills are no
longer worth anything.

https://www.faa.gov/documentLibrary/media/Order/ATC.pdf%20gives%20the%20standard
USA instructions for PAF.

For course commands, instead of para 5-12-4 we used "SLIGHTLY/WELL LEFT/RIGHT OF
COURSE, TURN LEFT COURSE 210". ATC obviously kept a record of the last
course instruction.

I believe that it is usual for ATC to issue a message saying something along
the lines of "do not confirm/reply to my instructions during the approach"

My memory needs a lot of jogging to get this info to re-surface. Strangely,
it is all coming back, after nearly 50 years. Amazing!

Alan
Alant
 
Posts: 916
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: Spoken ATC

Postby rleibner » Wed Aug 16, 2017 1:10 pm

Bemvindo a bordo, Alan, :)

I don't know if you have tested SpokenATC as it is just now (v:2.1).
Among the features already implemented are wind and runway heading evaluation for ATC to inform the pilot on approach and landing.
(See voice.nas, lines 48 - 67). Then the <logic> branch evaluates the situation and points to the <phrases>.
That might be a good start for you to start getting familiar with the code.

Please send me some info (and/or links) about how the CGA system works in real life.
It is preferable that communications between us should be done via PM, so as not to overload this forum.
Feel free to askme for details and try alternatives by editing phraseology.xml

I'm glad to have your contributions. :D

Regards,
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 246
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: 2180.4.0
OS: Ubuntu 18.04

Re: Spoken ATC

Postby Hooray » Thu Aug 17, 2017 8:17 pm

Actually, Alant is right: the logic used by glideslope.nas is definitely a good start - for starters, what is needed is a loop that is monitoring an aircraft, and then, it will be polling that aircraft's position and compute the vertical/horizontal offset to the destination airport/runway using a configurable glideslope (gradient, i.e. altitude change over ground per time interval) - once we have a vertical/horizontal "delta", we can convert those to instructions that are issued to the pilot, while monitoring the aircraft to see if the requested changes (in altitude/heading) are implemented or not, and adjust the gradient/vector accordingly.

PS: I am not sure if it's such a good idea to conduct these talks in private via PM, I am sure there are others interested in this - as a matter of fact, if we look at this in terms of building blocks, we could easily create 2-3 mini tutorials implementing a handful of building blocks required to actually add this functionality to any Nasal script.

By the way, I'd definitely suggest to design this in a fashion that an arbitrary aircraft can be observed (i.e. including AI aircraft), because that would make for an awesome testing environment: tanker.nas should only need very minor modifications to turn the scripting into a GCA-enabled version that could be used for prototyping purposes - let's imagine, we'll add a simple dialog (along the lines of the tanker GUI) to FlightGear where we can simply request a new AI aircraft to spawn on the final approach to a configurable airport/runway, while the whole thing is talked down using a scripted GCA controller - it will be much easier to debug/troubleshoot the whole thing that way.

(yeah, I am aware that AI aircraft are not subject to environmental influences)
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11377
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby Hooray » Fri Aug 18, 2017 7:48 pm

rleibner wrote in Wed Aug 16, 2017 1:10 pm:Please send me some info (and/or links) about how the CGA system works in real life.


Thought this may be of interest to others following this thread:



Image

https://secretsofcoldwarradar.omeka.net ... proach-and
https://aroundthepattern.com/training/g ... aches-gca/
https://en.wikipedia.org/wiki/Ground-co ... d_approach
http://www.rquirk.com/cdnradar/cor/chapter21.pdf
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11377
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby Hooray » Sat Aug 19, 2017 4:10 pm

http://wiki.flightgear.org/Howto:Implem ... GCA_system
Image

okay, I've added a little helper class to the wiki to help prototype a simple GCA-like system in Nasal, and I am hoping to fill in the missing helpers over the next couple of days/weeks (unless of course anybody should beat me to it).

What is missing is actually trivial to add using the pointers that Alant mentioned previously (e.g. glideslope_tunnel.nas, geo.nas and a few navdb APIs).

Also note that I specifically designed the whole thing so that it could be trivially extended to also issue instructions to AI aircraft, i.e. nodes under /ai/[x]/position

I haven't really had time to actually test this, so there will probably be a few rough edges, typos etc ...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11377
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby Alant » Sat Aug 19, 2017 11:25 pm

Many thanks.

The system is simple, and is a good training aid for airmanship on the approach.

Alan
Alant
 
Posts: 916
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: Spoken ATC

Postby Hooray » Sun Aug 20, 2017 4:38 am

It should also be pretty straightforward to optionally visualize the ongoing GCA by approximating a subset of what is commonly shown on the ATC side using the Canvas system (eventually):

http://www.radartutorial.eu/19.kartei/0 ... 21.en.html
Image

This sort of display would certainly be useful for debugging/development purposes, too.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11377
Joined: Tue Mar 25, 2008 8:40 am

PreviousNext

Return to Nasal

Who is online

Users browsing this forum: No registered users and 1 guest