Board index FlightGear Development Nasal

Spoken ATC

Nasal is the scripting language of FlightGear.

Re: Spoken ATC

Postby rleibner » Sun Aug 20, 2017 3:38 pm

I have not yet read the contributions of Hooray. I am consulting the FAA ATC.pdf and imagining in my head the logic to implement the decision making.
One question: on page 277, TBL 5.7.1 reads " Distance from interception point to approach gate."
What criteria should be used to set the default position of such gate?
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 230
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 » Sun Aug 20, 2017 4:01 pm

FWIWI, I haven't actually coded up any heuristics at all: I merely ended up implementing the previously mentioned helper class to monitor/track an aircraft using a timer object, and call a single buildInstruction() routine that internally deals with two geo.Coord() objects, one representing the destination (i.e. runway) and the other the permanently updated position of the aircraft that is being tracked.

I also looked up screen shots of actual ATC software to see what kind of parameters can commonly be configured for a GCA, which is why I put together a Canvas based UI dialog to more easily configure the GCA in FlightGear, including the corresponding offsets.

I implemented the whole thing in a fashion so that it can also be told to monitor AI/MP nodes, but also to be able to emit instructions using arbitrary output properties - which is to say that the script is capable of monitoring an AI/MP aircraft, and issuing instructions using the MP "chat" properties (just as well as the festival/flite TTS properties, or Spoken ATC itself).

In other words, once the heuristics are added, you could literally be running the GCA script on a multiplayer client to have it issue instructions to another MP client across the continent.

For the time being, I won't be making any changes, but it's reached a state where it should be fairly straightforward to add custom heuristics, or even let it track/control AI nodes like tanker.nas:

http://wiki.flightgear.org/Howto:Implem ... GCA_system
Image
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: 11191
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby rleibner » Tue Aug 22, 2017 3:28 pm

I've begun to test a first (and incomplete) heuristic prototype.
I am directing the C-172 according to the controller directions, and monitoring the resulting trajectory with the Map canvas.
I still have many bugs to fix and many decisions to make about heuristic.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 230
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 rleibner » Wed Aug 30, 2017 8:53 pm

Alant wrote in 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.

As said before, I'm testing my first prototype .... and realized that have a very poor idea about the path that the Controller can assign. :oops:
So Alant, your help is welcome!
Let me explain graphically:
For each case (#1 and #2) I've draw 2 possible paths (green and blue).
Image
(The app gate is arbitrarily placed at 5 nm from the rwy)
Please enlighten me which is the proper one. If none of them, you can draw a new path (and/or explain the Controller criteria).

On the other hand,
Hooray wrote in Sun Aug 20, 2017 4:38 am:t 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

I'm opening a "PAR screen" canvas to track the trajectory. But when the canvas window opens, it keeps the focus (so the P key does not pause the sim). How can I avoid that?
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 230
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 30, 2017 9:58 pm

I think that a radar approach has two phases.

The first is the ground controller directing the aircraft to intercept and turn on to the "localiser" at a fixed altitude. The path should be similar to those used in approach charts.
VOR/DME or even ADF equipped aircraft should be able to do this first phase themselves and go directly to the GCA phase when they are in the correct position.

The second is the GCA which starts when the aircraft is on the "localiser", but has not yet reached the "glideslope". The pilot should be given instructions as to how many miles he is from the airfield and the start of descent so as to set up the correct approach speed and flaps. Some of the instruction sets that I have seen (but not all) at the start of the GCA tell the pilot to confirm gear is down, and then not to reply to or confirm instructions during the GCA phase. He is however required to confirm runway in sight or notify go-around as appropriate.

It only the GCA phase that I was suggesting should be implemented. This was originally an approach aid for use when either the aircraft or the airfield did not have ILS capability. I see it as a valuable aid to a simulator pilot when trying to get to grips with visual or ILS approaches.

The path shown on the diagram that you show in your post must be the same as the arrival chart that the aircraft is using. If you can issue ATC commands as appropriate during that phase of flight it would be similarly useful.

Are there any IFR pilots out there who can add to or correct this?

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

Re: Spoken ATC

Postby Hooray » Thu Aug 31, 2017 9:26 pm

Just briefly, regarding the errors mentioned on the devel list:

https://sourceforge.net/p/flightgear/ma ... /36020489/
Nasal runtime error: nil used in numeric context
> at /mm2/flightgear-data/fgaddon/Addons/SpokenATC/voice.nas, line 168


Be sure to take a look at the defaulting technique/workaround recomended at: http://wiki.flightgear.org/Nasal_Condit ... Defaulting
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: 11191
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby rleibner » Thu Aug 31, 2017 9:45 pm

Hooray wrote in Thu Aug 31, 2017 9:26 pm:Be sure to take a look at the defaulting technique/workaround

Nice !
I was thinking how to enable helicopters and other wheel-less ... You gave me the answer.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 230
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 31, 2017 9:53 pm

Sorry, I missed your Canvas related question: Yeah, that's a known "feature" - it would be best to simply use a different method, e.g. adding a "pause" button or registering an event handler to pass the event on by setting the pause property that way.

Personally, I would just add a button to your UI: http://wiki.flightgear.org/Canvas_Snipp ... Layouts.29

The pause property is something along the lines of /sim/freeze/master
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: 11191
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby rleibner » Thu Aug 31, 2017 10:43 pm

Pausing the fly is not the problem (I mentioned only as example), but while focus is on the canvas all the keyboard is disabled for flying.
Personally, I make a mouse click on the main window to restore the focus there ... but I know it's an ugly method.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 230
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 » Sun Sep 03, 2017 9:58 am

I don't remember the details, but I think there /is/ some way to disable event handling per Canvas - for instance, tooltips (which are Canvas based) don't handle any events (I think) - so that's where I'd suggest to look.

Apart from that, the restriction itself is there and has been there since day 1 - we were considering to improve things a little originally, but then everybody on the devel list and their dog went crazy about phasing out PUI in favor of using Qt5 for the aircraft center (launcher) and the built-in UI, so that we stopped working out a better scheme, considering any work in that area unnecessary.

Since then, it seems that things have stalled a little in the whole Qt5/GUI department - mainly because the whole effort of porting the built-in PUI based UI to Qt5 seems to have been massively undererstimated by the people involved in the Qt5 effort, but also due to architectural/threading issues that bugman mentioned repeatedly could become a problem somewhere down the road.

The thing to keep in mind here is that the original core developer consensus required all Qt5 work to remain entirely optional and constrained to a single module only, which means that we'd still need some kind of "fallback" for the non-Qt5 use-case, and that tons of work would go into converting existing functionaltiy using an optional dependency, i.e. ultimately an optional feature.

The nitty-gritty details of the whole PUI vs. Qt5 vs. Canvas UI can be found here: http://wiki.flightgear.org/Howto:Proces ... ing_Canvas
This includes an experimental prototype of a pui2canvas parser that translates a subset of PUI/XML to the corresponding Canvas equivalents to approximate a subset of the PUI/XML ui. All of this was originally prototyped during a single weekend using roughly 300 LOC (Nasal only, no C++ changes needed), and meanwhile it's roughly twice that I assume.

Image

This was never intended to "compete" or "conflict" with the Qt5 UI, it was merely intended to be a simple fallback that would allow us to get rid of PUI without causing tons of work - especially looking at some of the more complex PUI/XML dialogs that use tons of embedded Nasal code (think tutorials, joystick ui, checklists etc) - realistically, none of these can just be "ported" to a different UI framework like Qt5, unless a parser-based approach is used, that would also support Nasal scripting.

Thus, someone offering to rewrite the built-in UI using a different toolkit like Qt5 (which, again, is required to remain entirely optional) and witout using a parser supporting Nasal, would automatically volunteer to handle just that: re-implementing tons of PUI dialogs that contain useful features that we accumulated over the course of almost 2 decades

Realistically, that ain't happening any time soon for obvious reasons.
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: 11191
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby rleibner » Thu Sep 07, 2017 9:07 pm

I have opened a new topic about Spoken GCA. (see it ).
By now it's an 'stand-alone' submodule but the goal is to integrate it into the Spoken ATC. (after having debbuged it sufficiently).
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 230
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 benih » Fri Sep 08, 2017 1:01 pm

Hello, i have issues running the SpokenATC addon on fgfs 2016.4.4
The ATC chat text does show, however no sound output is given.

When installing i had some minor problems that may relate to the problem; my fghome is /var/cache/fgfs and that lead to errors when loading the module. The fix was to make a nasal directory there and unzip the code also there.


my call trace:
Code: Select all
beni@segin:~$ fgfs --aircraft=c182s --airport=EDDM --com1=180.70 --callsign=D-EBHX --disable-fullscreen 
platform default fg_root = Path "/usr/share/games/flightgear"
Reading global preferences
Finished Reading global preferences
Reading user settings from Path "/var/cache/fgfs/autosave_2016_4.xml"
init package root at:Path "/var/cache/fgfs/Aircraft"
aircraft = c182s
Loading aircraft -set file from:Path "/usr/share/games/flightgear/Aircraft/c182s/c182s-set.xml"
Found language resource for: de_DE
Reading localized strings for 'en' from Path "/usr/share/games/flightgear/Translations/en/sys.xml"
Reading localized strings for 'de' from Path "/usr/share/games/flightgear/Translations/de/sys.xml"
Reading localized strings for 'en' from Path "/usr/share/games/flightgear/Translations/en/atc.xml"
Reading localized strings for 'de' from Path "/usr/share/games/flightgear/Translations/en/atc.xml"
        option:enable-fullscreen =
        option:visibility = 200000
        option:aircraft = c182s
        option:airport = EDDM
        option:com1 = 180.70
        option:callsign = D-EBHX
        option:disable-fullscreen =
Using default download dir: Path "/var/cache/fgfs"
read-allowed path not found:Path "/var/cache/fgfs/AI"
read-allowed path not found:Path "/var/cache/fgfs/Liveries"
Using TerraSync dir: Path "/var/cache/fgfs/TerraSync"
initializing cloud layers
Configuration State
======= ==============
aircraft-dir = "/usr/share/games/flightgear/Aircraft/c182s"
fghome-dir = "Path "/var/cache/fgfs""
download-dir = "/var/cache/fgfs"
terrasync-dir = "/var/cache/fgfs/TerraSync"
aircraft-search-paths =

scenery-search-paths =
        /var/cache/fgfs/TerraSync
        /var/cache/fgfs/TerraSync/Terrain
        /var/cache/fgfs/TerraSync/Objects

        /usr/share/games/flightgear/Scenery
        /usr/share/games/flightgear/Scenery/Terrain
        /usr/share/games/flightgear/Scenery/Objects

Splash screen progress init
NVIDIA Corporation
GeForce GTX 650 Ti/PCIe/SSE2
4.5.0 NVIDIA 375.66
4.50 NVIDIA
Splash screen progress loading-aircraft-list
Splash screen progress loading-nav-dat
NavCache at:Path "/var/cache/fgfs/navdata_2016_4.cache"
NavCache: no main cache rebuild required
Splash screen progress init-scenery
General Initialization
======= ==============
FG_ROOT = "Path "/usr/share/games/flightgear""

Attempting to set starting position for EDDM:16
Failed to find runway/helipad 16 at airport EDDM. Using default runway.
Attempting to set starting position from airport code EDDM heading 270
Reading timezone info from: Path "/usr/share/games/flightgear/Timezone/zone.tab"
Splash screen progress creating-subsystems
Creating Subsystems
========== ==========
Reading materials from /usr/share/games/flightgear/Materials/regions/materials.xml
Reading systems from Path "/usr/share/games/flightgear/Aircraft/Generic/generic-systems.xml"
Initializing HUD Instrument
Reading sound sound from Path "/usr/share/games/flightgear/Aircraft/c182s/c182s-sound.xml"
Creating subsystems took:1792
Splash screen progress binding-subsystems
FGPropertyManager::GetNode() No node found for /controls/switches/fuel_tank_selector
FGPropertyManager::GetNode() No node found for /controls/switches/fuel_tank_selector
FGPropertyManager::GetNode() No node found for /controls/switches/fuel_tank_selector
FGPropertyManager::GetNode() No node found for /controls/switches/fuel_tank_selector
Cannot connect to server socket err = Datei oder Verzeichnis nicht gefunden
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
Spoken-ATC properties loaded.
voice.nas v.2.2 loaded.
atc_tools loaded.
Loading local weather routines...
Animated jetways ... initialized
atc_tools loaded.
Spoken-ATC properties loaded.
voice.nas v.2.2 loaded.
Spoken-ATC properties loaded.
voice.nas v.2.2 loaded.
atc_tools loaded.
Electrical system initialized
Model load Nimitz /ai/models/carrier
Model load Nimitz /ai/models/carrier[1]
Gate doesn't seem to have routes associated with it.
Gate doesn't seem to have routes associated with it.
Gate doesn't seem to have routes associated with it.
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am

Re: Spoken ATC

Postby Thorsten » Fri Sep 08, 2017 4:48 pm

The ATC chat text does show, however no sound output is given.


Then you're in the wrong thread, because the script is working, just text to speech isn't for you - the first recommendation would be to install the latest version of FG then.
Thorsten
 
Posts: 9994
Joined: Mon Nov 02, 2009 8:33 am

Re: Spoken ATC

Postby rleibner » Fri Sep 08, 2017 4:51 pm

benih wrote in Fri Sep 08, 2017 1:01 pm:The ATC chat text does show, however no sound output is given.

Weird :roll: ...
Try this:
open the Nasal Console (on Debug menu) and paste & execute
Code: Select all
setprop("/sim/sound/voices/atc", "ATC can speak. ");
settimer(func(){setprop("/sim/sound/voices/pilot", "Pilot also can speak. ");}, 1);
settimer(func(){setprop("/sim/sound/voices/copilot", "and copilot too. ");}, 3);

and tell me what you hear.

On the other hand, reading your trace seems that Spoken-ATC properties , voice.nas and atc_tools are loaded twice !
If you installed Spoken ATC as Submodule (i.e. under /var/cache/fgfs/Nasal/) then do not use the --addon option to launch FG.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 230
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 benih » Fri Sep 08, 2017 10:10 pm

Text to speech does work, i can hear ATIS for example.

When i delete the instance in FGROOT (i.e. only the instance in /var/cache/fgfs/Nasal remains), i get this error:
Code: Select all
Nasal error: no <file> or <script> defined in /nasal/SpokenATC
Spoken-ATC properties loaded.
voice.nas v.2.2 loaded.
atc_tools loaded


The screen message is still shown.
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am

PreviousNext

Return to Nasal

Who is online

Users browsing this forum: No registered users and 7 guests