Board index FlightGear Development Nasal

Spoken ATC

Nasal is the scripting language of FlightGear.

Re: Spoken ATC

Postby Torsten » Mon Jul 10, 2017 12:59 pm

This is a perfect candidate for a addon like ATC chatter. I don't think there is any documentation for that kind of plugin but probably looking at the ATC chatter implementation should help.
Find the code here: https://sourceforge.net/p/flightgear/fg ... TCChatter/

BTW: this should also allow modifying the keyboard binding.

If someone turns this module into a plugin, I'd be more than happy to commit it to FGAddon.

Torsten
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 648
Joined: Fri Feb 01, 2008 10:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: Spoken ATC

Postby Torsten » Tue Jul 18, 2017 11:36 am

Hi,

triggered by this addon, I have just overhauled the addon "API" to make it a little easier to use.
Along with this, I added the spoken ATC feature as an addon to fgaddon: https://sourceforge.net/p/flightgear/fg ... SpokenATC/

It is now very easy to use (given you have FlightGear compiled from git HEAD or use FlightGear 2017.3.x or later.
you need at least these commits:
FlightGear: https://sourceforge.net/p/flightgear/fl ... 5927ef3ff/
FGData: https://sourceforge.net/p/flightgear/fg ... 42f050dd2/

- Get the addon from https://sourceforge.net/p/flightgear/fg ... SpokenATC/
- start flightgear with --addon=/your/full/path/to/SpokenATC
done.

The README now needs an overhaul, mostly the install section.
@Rudolfo: I was assuming your code was licensed under GPL - could you add an explicit statement so we can add it to the addon?

Docs about how to write addons/plugins will follow.
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 648
Joined: Fri Feb 01, 2008 10:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: Spoken ATC

Postby rleibner » Tue Jul 18, 2017 3:36 pm

I was assuming your code was licensed under GPL

Of course, yes !!
What would be the purpose of sharing it here if it were not so? :)
I must confess that I am absolutely ignorant of the legal stuff.
Please help me by indicating the most appropriate explicit statement and where to include it (in the README, in the spoken_atc.nas , everywhere ?)
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 8:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: Spoken ATC

Postby Torsten » Tue Jul 18, 2017 4:53 pm

Here is a good HOWTO:
https://www.gnu.org/licenses/gpl-howto.en.html
It basically suggests to add the LICENSE file in the root folder and add the license header along with a copyright statement in each file.

Torsten
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 648
Joined: Fri Feb 01, 2008 10:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: Spoken ATC

Postby clm76 » Wed Jul 19, 2017 8:13 am

Hi,

A few comments about the file « voice.nas » :
- I think it should be better to use the property « /velocities/vertical-speed-fps » which exists on all planes instead of « /instrumentation/vertical-speed-indicator/indicated-speed-fpm » which doesn’t exist on all planes.
Code: Select all
var DEPvoice = func(info, best) {
  if(prev== "takeoff clearance" and getprop("/instrumentation/vertical-speed-indicator/indicated-speed-fpm")>150) {

replaced by :
Code: Select all
var DEPvoice = func(info, best) {
  if(prev== "takeoff clearance" and getprop( /velocities/vertical-speed-fps »)>15) {

- Problem with this code :
Code: Select all
# 7) Choose pertinent instruction
………..
} else if(relpos=="onCTR"){
     if(station_type=="tower") {
         msg = TWRvoice(info, best);
     } else if(station_type=="approach-departure") {
       if(prev=="takeoff clearance" or prev=="report leaving") {
        msg = DEPvoice(info, best);
      } else {
        msg = REDvoice("TWR");
      }
     } else if(right(station_type,9)=="departure") {
      msg = DEPvoice(info, best);
      } else if(left(station_type,8)=="approach") {
     msg = REDvoice("TWR");
   }    

If departure frequency doesn’t exist, the message for leaving the CTR is :
Image

With this, it’s correct (for departure) :
Code: Select all
} else if(relpos=="onCTR"){
     if(prev=="takeoff clearance" or prev=="report leaving") {
        msg = DEPvoice(info, best);
     } else {
        msg = REDvoice("TWR");
     }

That’s it for today. :D
clm76
 
Posts: 204
Joined: Tue Oct 30, 2012 9:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2020.4.0
OS: Linux Mint 20.2

Re: Spoken ATC

Postby rleibner » Wed Jul 19, 2017 3:04 pm

clm76 wrote in Wed Jul 19, 2017 8:13 am: I think it should be better to use the property « /velocities/vertical-speed-fps » which exists on all planes instead of « /instrumentation/vertical-speed-indicator/indicated-speed-fpm » which doesn’t exist on all planes.

I agree. In general, I am not quite sure which properties exist on all planes and which do not. Didn't found documentation about that.

If departure frequency doesn’t exist, the message for leaving the CTR ...

I'm not sure there is a problem there. Consider you are practicing touch-and-gos ...

Version 1.22 is available here.

Thanks :)
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 8:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: Spoken ATC

Postby clm76 » Wed Jul 19, 2017 5:02 pm

Sorry but another problem : :?

Cruising and trying to call LFPG tower (Paris Charles de Gaulle) with the frequency 120.650 (actual frequency but not recognized by FG), it happens a nasal error instead of « Check comm. freq » :
140 relpos : hold
140 relpos : onCTR
140 relpos : cruising
Nasal runtime error: No such member: TWR
at /home/chris/fg/My_Aircraft/CitationX/Nasal/spoken_atc/phraseology.nas, line 37
called from: /home/chris/fg/My_Aircraft/CitationX/Nasal/spoken_atc/voice.nas, line 159
called from: /input/keyboard/key[60]/binding, line 2

Note : 140 relpos is created by me for debugging
clm76
 
Posts: 204
Joined: Tue Oct 30, 2012 9:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2020.4.0
OS: Linux Mint 20.2

Re: Spoken ATC

Postby Torsten » Wed Jul 19, 2017 6:43 pm

rleibner wrote in Wed Jul 19, 2017 3:04 pm:Version 1.22 is available here.

Hi Rudolfo,

would you mind working with and patching the code in the FGAddon?
It would make my life easier if there was just one location for the code.
We have some instructions how to use SVN in our wiki. It covers mostly aircraft development but the workflow is pretty much the same for addons.

Thanks, Torsten
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 648
Joined: Fri Feb 01, 2008 10:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: Spoken ATC

Postby rleibner » Thu Jul 20, 2017 5:15 pm

Torsten wrote in Wed Jul 19, 2017 6:43 pm:would you mind working with and patching the code in the FGAddon?
It would make my life easier if there was just one location for the code.

Sorry, Torsten, you are right. I must learn to work with git (and certainly I will).

clm76 wrote in Wed Jul 19, 2017 5:02 pm:Cruising and trying to call LFPG tower (Paris Charles de Gaulle) with the frequency 120.650 (actual frequency but not recognized by FG), it happens a nasal error instead of « Check comm. freq »

Wow, that was hard to find but finally this is what happened:
You tunned EHSE (Bosschenhoofd, Netherlands) just near your range border.
Worst, airportinfo("EHSE").comms returns a hash which unique key is "Seppe Radio" (instead of "Seppe TWR") !!

We can fix it inserting:
Code: Select all
     if(size(comms)==1) { freqs["TWR"] = freqs[keys(freqs)[0]];}

into the getfreqs() function (just before the return).
But I dont like that, We will have other similar problems eg. at LFPC where we have a "Creil sol" instead of "Creil GND"

I think we should "normalize" in some way the keys returned by airportinfo().comms. Donno how.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 8:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: Spoken ATC

Postby clm76 » Fri Jul 21, 2017 7:19 am

Thanks Rudolpho,

Another problem :
Flying to LFPG and calling LFPG Approach (133.375 or 131.200 or ... ), the airport name which appears on the popup is LFPB (Paris Le Bourget) and in the property tree, we can see :
airport-id = LFPB
...
station-name = DE GAULLE APP
station-type = approach-departure

Image

With tower frequencies instead of approaches frequencies, it's correct.
clm76
 
Posts: 204
Joined: Tue Oct 30, 2012 9:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2020.4.0
OS: Linux Mint 20.2

Re: Spoken ATC

Postby rleibner » Fri Jul 21, 2017 3:33 pm

clm76 wrote in Fri Jul 21, 2017 7:19 am:Flying to LFPG and calling LFPG Approach (133.375 or 131.200 or ... ), the airport name which appears on the popup is LFPB (Paris Le Bourget)

That's right. Note that (according to FGFS data) you have tuned a LFPB frequency.
Image
Image
Besides, the services of Approach and Departure offered by Le Bourget and Creil are those of De Gaule (because they share the same airspace)
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 8:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: Spoken ATC

Postby clm76 » Fri Jul 21, 2017 4:44 pm

That's right. Note that (according to FGFS data) you have tuned a LFPB frequency.

Hmmm... no, sorry. 133.375 and others are LFPG approach frequencies.
LFPB approach is managed by LFPG and so, the message in the popup isn't correct because it says to contact tower at 118.92 which is LFPB tower, instead of LFPG tower (123.600 or 125.325, 120.900, 119.250, 118.650).
clm76
 
Posts: 204
Joined: Tue Oct 30, 2012 9:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2020.4.0
OS: Linux Mint 20.2

Re: Spoken ATC

Postby rleibner » Fri Jul 21, 2017 5:21 pm

I dont know in the real world, but according FGFS 2017 2.0 I can check:
ImageImage
As you see 133.37 is used by both airports. May be that when calling the station you are closer to LFPB ?
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 8:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

Re: Spoken ATC

Postby clm76 » Fri Jul 21, 2017 7:05 pm

Yes, it's what I said :
It's LFPG Charles de Gaulle which manages LFPB, so why is it LFPB on the popup and not LFPG which is the manager (and also because my flight plan had LFPG for destination) ?
clm76
 
Posts: 204
Joined: Tue Oct 30, 2012 9:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2020.4.0
OS: Linux Mint 20.2

Re: Spoken ATC

Postby rleibner » Fri Jul 21, 2017 7:45 pm

I understand your point now. Let me study that.
Debugging is always cumbersome and annoying, though necessary.Thanks for reporting this kind of stuff.
À bientôt
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 269
Joined: Fri May 19, 2017 8:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: next
OS: Ubuntu 18.04.4

PreviousNext

Return to Nasal

Who is online

Users browsing this forum: No registered users and 2 guests