Board index FlightGear Development Nasal

Spoken ATC

Nasal is the scripting language of FlightGear.

Re: Spoken ATC

Postby Hooray » Fri Dec 07, 2018 3:21 pm

the AI traffic system, and especially its route manager/autopilot are unfortunately implemented as "black boxes", so while implementing the scripting side is really easy, what is needed for that to be possible is that the C++ exposes the relevant information either via some kind of dedicated Nasal API or via corresponding properties in the tree, so that the script can access that information.

Likewise, the transponder is easy, but making it play nicely with the rest of the hard-coded code does again require an interfacing mechanism, so that it doesn't pick a number that is already in use, but also so that the C++ code is aware of transponder numbers used by scripted ai traffic
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: 11287
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby rleibner » Fri Dec 07, 2018 5:25 pm

From Nasal it is possible to see the AI traffic in the vicinity of the airport (in fact, it is yet done for Spoken_GCA).
Following their trajectory I think it is possible to guess their intentions and populate "/sim/sound/voices/atc" with messages. Both, AI plane requesting clearances and ATC giving instructions.
By now, only an idea.
In order to not mess the intelligibility of the radio, I would like to differentiate the voices. (male/female, pitch, some background noise, etc).
And I'm not sure how to do it.

Regarding the transponder, I have not experience ITRW other than domestic VFR.
Would it be okay to assign 1200 to any light aircraft?
And a random squawk to others?
May be someone can enlighten me.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 239
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 » Fri Dec 07, 2018 6:26 pm

If you'd like the hard-coded AI system to expose additional information via the property tree, the right place to file a corresponding feature request would be the devel list and/or the issue tracker at: https://sourceforge.net/p/flightgear/codetickets/
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: 11287
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby RobAndrew » Sun Dec 09, 2018 4:47 pm

Okay, thanks very much for the replies. It's also occurred to me that this system doesn't like any airports frequencies being the same when it comes to twr/ app/dep. If they are and it requests you to contact the other frequency, it will mention "contact XXX at "." " I'm not a user of nasal and haven't ever touched it. Is there a way for this to be solved?

Thanks in advanced
RobAndrew
 
Posts: 83
Joined: Thu Jul 12, 2018 4:59 pm
Version: 2017.3.1
OS: Mac OSX 10.11.6

Re: Spoken ATC

Postby massima » Sun Dec 23, 2018 8:09 pm

Great work @Rodolfo!!!! :wink:
Finally with your project there is an interactive ATC, i've waited for long times.
The install procedure posted at the first post doesn't work, i successfully used the guide posted by Torsen here.
So it needs an update same for the wiki.
Thanks
User avatar
massima
 
Posts: 211
Joined: Sat Jan 03, 2015 6:48 pm
Location: Italy
Callsign: M-AXX
Version: 2018.3.1
OS: debian testing

Re: Spoken ATC

Postby rleibner » Thu Dec 27, 2018 9:34 pm

Following the suggestion made by RobAndrew, I'm debugging a new version that includes AI-Traffic/ATC voices.
There is a lot of work to do yet, but it is in progress...
Especially because I aim to use an xml State-Machine, but ... (see the https://forum.flightgear.org/viewtopic.php?f=18&t=35182)

The general idea is not only to hear the AI-Traffic comms, but also to refine the instruction that ATC gives to you, depending on the Traffic (if rwy is bussy, etc...).
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 239
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 clm76 » Fri Jan 04, 2019 7:20 am

Hi Rodolfo and all,
I wish you a happy new year 2019.

I recommend some changes :
1 - in README.first : line 12 - replace ">" key by "<" key (">" key is for The PAR system).

2 - To take account of meteo without Metar, like "realistic weather" :
line 62 in voice.nas, replacement of :
Code: Select all
var q_ = getprop("/environment/metar/pressure-sea-level-inhg");

by :
Code: Select all
var q_ =  getprop("/environment/pressure-sea-level-inhg");

line 81 replacement of :
Code: Select all
var a = abs(info.runways[rw].heading - getprop("/environment/metar/base-wind-dir-deg"));

by :
Code: Select all
var a = abs(info.runways[rw].heading - getprop("/environment/wind-from-heading-deg"));

line 104-105 replacement of :
Code: Select all
setprop("/satc/wind-dir-fmt", spell(sprintf("%d",getprop("/environment/metar/base-wind-dir-deg")),3));
setprop("/satc/wind-speed-fmt", sprintf("%d",getprop("/environment/metar/base-wind-speed-kt")));

by :
Code: Select all
setprop("/satc/wind-dir-fmt", spell(sprintf("%d",getprop("/environment/wind-from-heading-deg")),3));
setprop("/satc/wind-speed-fmt", sprintf("%d",getprop("/environment/wind-speed-kt")));
clm76
 
Posts: 143
Joined: Tue Oct 30, 2012 8:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2018.3.0
OS: Linux Mint 18.3

Re: Spoken ATC

Postby rleibner » Fri Jan 04, 2019 4:50 pm

clm76 wrote in Fri Jan 04, 2019 7:20 am:... I recommend some changes :
1 - in README.first : line 12 - replace ">" key by "<" key (">" key is for The PAR system).
2 - To take account of meteo without Metar, like "realistic weather"


Thanks for your suggestions. I'll take them and will be included in the next version (soon).
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 239
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 dervau » Sat Feb 02, 2019 1:22 pm

Hi,

first of all: this addon is a great one!

I have two suggestions:

1.
The code
Code: Select all
var a = abs(info.runways[rw].heading - getprop("/environment/wind-from-heading-deg"));

would determine runway 21 as best runway for landing if you have wind from 350 and airport has runways 03 and 21. But runway 03 would be the correct runway. So I suggest to change the code to use cos function (where a diff of 180 degrees is -1 and 0 / 360 is +1) in this way:
Code: Select all
var ang = -1.0;
...
var a = math.cos(info.runways[rw].heading - getprop("/environment/wind-from-heading-deg"));
...
if(a>ang) {
...


2.
It would be great to prefer ILS runways for larger aircrafts that always fly IFR. This would do it (regarding the suggested changes in 1.):
Code: Select all
# 4) choose best rwy
var best = "";
var ang = -1.0;
var dest_rwy = nil;
var rm = 0;
if (getprop("/autopilot/route-manager/active")) {
  dest_rwy = getprop("/autopilot/route-manager/destination/runway");
  rm = 1; 
}

var ilsRwyFound = 0;
foreach(var rw; keys(rws)){
  if (rw == getprop("sim/atc/runway") or (dest_rwy != nil and dest_rwy == rw)) {
   best = rw;
   break;
  } else {
    if (ilsRwyFound == 0 or info.runways[rw].ils != nil) {
      var a = math.cos(info.runways[rw].heading - getprop("/environment/wind-from-heading-deg"));
      if (ilsRwyFound == 0 and info.runways[rw].ils != nil) {
        ang = a;
        best = rw;
        ilsRwyFound = 1;
      } else {
          if(a>ang) {
             ang = a;
             best = rw;
          }
      }
    }
  }
}


Do you know how to figure out if the current aircraft is a large one? Then it would be possible to decide wether to prefer ILS or not dependent upon the aircraft size.
dervau
 
Posts: 1
Joined: Sat Feb 02, 2019 11:52 am

Re: Spoken ATC

Postby Hooray » Sat Feb 02, 2019 8:03 pm

it's not as straightforward actually - unless you have access to certain info, e.g. the FDM (XML markup) or by referring to a flight plan (approach speeds) or by parsing the checklist stuff found in the property tree
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: 11287
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby abassign » Thu Feb 07, 2019 11:52 pm

It's a very nice and simple program that allows you to have a working radio even with single flights. I'm experimenting on the G91R1B to run the VHF / UHF radio but there's a problem:

I try to change a value to: /sim/sound/voices/voice[0]/volume but nothing happens!
I can only change the general volume with: /sim/sound/volume but it makes no sense as it changes the volume of all the sounds.

If instead I try to change the volume parameter in "/instrumentation/comm" nothing happens the same ... It is clear that the speech synthesis system does not take advantage of these parameters ...

Image



Does anyone know how to do ? For me, in terms of fidelity of reproduction, it is important to be able to simulate the volume and the power on of the radio with the fade effect. I would also like to be able to insert a white noise because I have never heard the radio of a valve-type aircraft with a clear and crystalline sound. I looked at the Spoken ATC code but I did not see anything managing the volume.
Does anyone know how to solve the problem?

Thank you

Image
abassign
 
Posts: 756
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: Spoken ATC

Postby abassign » Fri Feb 15, 2019 8:40 am

On Discord someone gave me the advice to work on the properties "Instrumentation / comm" ... but the vocal synthesis remains unchanged. At this point my impression is that there is a problem related to the flow produced by the speech synthesis program that does not go directly to an application managed by FGFS for the mix but to the sound management system of the PC operating system.

Image


Image

I would like to know if anyone has worked on such a sound management system, and if he has the possibility to change the current management method. Or if there is simply a parameter somewhere that needs to be activated ...

What do you think ?
abassign
 
Posts: 756
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: Spoken ATC

Postby WoodSTokk » Fri Feb 15, 2019 10:33 am

I dont know, but on the Citation II its working. You will see another property '/instrumentation/comm[0]/volume-def', but this is only to activate the switches on the autiopanel.
I have a filter in 'Models/Instruments/instrument-filters.xml' that do the job with the switch and volume and write the result in '/instrumentation/comm[0]/volume' and that changes the volume of ATIS.
But i know that the radios are buggy. Turn of NAV1 and NAV2 will stop working also if it is on and tuned correctly.

Edit:
Ops, sorry, you mean SpokenATC. I have never tested this addon, but as far as I know, the addon goes over a extra channel. It also can have a different sound device.
I assume you will not have influence on the addon.
WoodSTokk
 
Posts: 125
Joined: Tue Oct 17, 2017 2:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: OE-WST
IRC name: WoodSTokk
Version: 2018.3.1
OS: Debian Buster/Sid

Re: Spoken ATC

Postby abassign » Fri Feb 15, 2019 3:09 pm

WoodSTokk wrote in Fri Feb 15, 2019 10:33 am:...SpokenATC. I have never tested this addon, but as far as I know, the addon goes over a extra channel. It also can have a different sound device.
I assume you will not have influence on the addon.


I also have the same impression, I would like to understand if it is possible to organize the speech synthesis so that it can be treated as the audio stream COMn Do you think you could raise a correction request or is it trivially an unknown parameter to set?
abassign
 
Posts: 756
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: Spoken ATC

Postby WoodSTokk » Fri Feb 15, 2019 3:59 pm

As i have writen before, i dont know the addon.
Has the addon his own tree inside the property tree?
If yes, it can be possible to control the addon from there a little bit.
WoodSTokk
 
Posts: 125
Joined: Tue Oct 17, 2017 2:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: OE-WST
IRC name: WoodSTokk
Version: 2018.3.1
OS: Debian Buster/Sid

Previous

Return to Nasal

Who is online

Users browsing this forum: No registered users and 1 guest