Discussion:
Spoken ATC
(too old to reply)
Rodolfo Leibner
2017-06-25 21:12:13 UTC
Permalink
Hi everyone,

I am attaching the beta version 0.2 of the atc.nas script.
You can see the short history of this project here
<https://forum.flightgear.org/viewtopic.php?f=30&t=32408&p=313182#p313182>.

This code is not intended to compete with FGComm, Festival or other similar
facilities. On the contrary, their use is indicated when they are not
available (eg, few hardware resources, no Internet connection, etc.)

1.- How to use it
Once installed, tune Comm1 to the desired frequency and press the ">" key
to transmit your request.
You will hear the ATC's answer according the standard VFR phraseology,
depending on your current position:

* If you are on ground => The script interprets it's a taxi request (if
you are far from the runway) or a take-off request (if you are on the
correct Runway or at his holding point).
* If you are flying => The script interprets it's an approach request
(if you tunned an Approach freq.), or a landing request (if you tunned a
Tower one).

Note that only TWR freqs can deliver landing or take-off clearances, and
only GND or TWR stations can deliver taxiing ones.
Only at initial contact, the ATC message includes his station name & type,
and the current QNH.
APP stations will give a vector to the rwy in use (if you are far from
there) or order to contact TWR (if you are inside CTR).
TWR stations will give instructions to join pattern or make direct
final (depending
on your position).

2.- How to install it
Put the attached file into the $FGFS_ROOT/Nasal/ directory, as *atc.nas*
and bind a key or button. I use "<" key.


I hope to have the help of beta-testers, which can bring a fresh look.
All opinions and comments are welcome. Both, regarding the script behavoir
and his nasal structure.

Regards,
Rodolfo Leibner
Torsten Dreyer
2017-06-26 09:39:16 UTC
Permalink
Hi Rodolfo,

that's a nice feature. It has been on my todo-list for way to long and
always dropped off due to other tasks to complete.

I havn't tested your script but please allow some feedback from just
reading the code:

We already have a basic "speaker system" for the spoken ATIS that converts
numbers to spoken words and converts letters to "alpha, bravo", etc.
It would probably make sense to adapt the existing system to support the
spoken ATC, too.
Instead of having hard-coded, I'd prefer to have some kind of state-machine
to determine the state of the ATC/aircraft interaction based on a/c course
and position, comm/nav setup, environment etc. The exact spoken words
should be dedicated to a separate layer.
This is mostly important because the phraseology is somewhat individual in
different parts of the world. Also, creating the rules for an artificial
ATC is not trivial and that logic should be separated from the wording
code. We need a system that can start with some simple rules and can easily
be extended, hopefully without changing code.

Some observations regarding your parts of your code:
- In APPvoice, you say "you are inside CTR, contact tower" when the
aircraft is closer than 10NM to the airport or lower than 30ft AGL. This
does not make any sense to me.
Most ATC sentences need some fine tuning, e.g.
- turn left/right heading NNN (not turn to NNN - avoid "turn to two two two)
- landing clearance is "wind - runway - cleared to land"
- and every transmission starts with the A/C callsign, eventuallaly
abbreviated.

Please don't let the above discourage you from improving your script.
Getting some artifical ATC would be a nice feature for FlightGear.

Regards
Post by Rodolfo Leibner
Hi everyone,
I am attaching the beta version 0.2 of the atc.nas script.
You can see the short history of this project here
<https://forum.flightgear.org/viewtopic.php?f=30&t=32408&p=313182#p313182>
.
This code is not intended to compete with FGComm, Festival or other
similar facilities. On the contrary, their use is indicated when they are
not available (eg, few hardware resources, no Internet connection, etc.)
1.- How to use it
Once installed, tune Comm1 to the desired frequency and press the ">" key
to transmit your request.
You will hear the ATC's answer according the standard VFR phraseology,
* If you are on ground => The script interprets it's a taxi request
(if you are far from the runway) or a take-off request (if you are on the
correct Runway or at his holding point).
* If you are flying => The script interprets it's an approach request
(if you tunned an Approach freq.), or a landing request (if you tunned
a Tower one).
Note that only TWR freqs can deliver landing or take-off clearances, and
only GND or TWR stations can deliver taxiing ones.
Only at initial contact, the ATC message includes his station name & type,
and the current QNH.
APP stations will give a vector to the rwy in use (if you are far from
there) or order to contact TWR (if you are inside CTR).
TWR stations will give instructions to join pattern or make direct final (depending
on your position).
2.- How to install it
Put the attached file into the $FGFS_ROOT/Nasal/ directory, as *atc.nas*
and bind a key or button. I use "<" key.
I hope to have the help of beta-testers, which can bring a fresh look.
All opinions and comments are welcome. Both, regarding the script behavoir
and his nasal structure.
Regards,
Rodolfo Leibner
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Flightgear-devel mailing list
https://lists.sourceforge.net/lists/listinfo/flightgear-devel
--
Torsten Dreyer
Rodolfo Leibner
2017-06-26 14:33:20 UTC
Permalink
Hi Torsten,

Thanks for the feedback. Not only I'm not discouraged, but it is very
valuable for me.
" every transmission starts with the A/C callsign
They already do, see line 120.
" landing clearance is "wind - runway - cleared to land"
I note and fix. Makes sense, it is more similar to the Spanish version I
know.
" turn left/right heading NNN (not turn to NNN
I note and fix.
"... inside CTR,... when the aircraft is closer than 10NM to the airport
or lower than 30ft AGL.
You are right. I'll fix that.

( About the phraseology, I relied on this pdf
<https://www.ivao.aero/training/documentation/books/PP_ADC_VFR_Phraseology.pdf>
but I agree with you. )

" determine the state of the ATC/aircraft interaction based on a/c course
and position, comm/nav setup, environment etc
I see, more "*intelligence*" ... I'll think about it.

On the other hand, there are some challenges that I do not know how to
solve:
Instead of saying "contact tower", APP and GND should say "contact tower at
<TWR-freq>"
How can I get such frequency? In general, how do I know whether the apt has
or not a GND station? Or an ATIS, APP, etc?

Anyway, I will continue working on it and hope that someday we'll have a
better integrated system as you say.

Regards,
Rodolfo
Hi Rodolfo,
that's a nice feature. It has been on my todo-list for way to long and
always dropped off due to other tasks to complete.
I havn't tested your script but please allow some feedback from just
We already have a basic "speaker system" for the spoken ATIS that converts
numbers to spoken words and converts letters to "alpha, bravo", etc.
It would probably make sense to adapt the existing system to support the
spoken ATC, too.
Instead of having hard-coded, I'd prefer to have some kind of
state-machine to determine the state of the ATC/aircraft interaction based
on a/c course and position, comm/nav setup, environment etc. The exact
spoken words should be dedicated to a separate layer.
This is mostly important because the phraseology is somewhat individual in
different parts of the world. Also, creating the rules for an artificial
ATC is not trivial and that logic should be separated from the wording
code. We need a system that can start with some simple rules and can easily
be extended, hopefully without changing code.
- In APPvoice, you say "you are inside CTR, contact tower" when the
aircraft is closer than 10NM to the airport or lower than 30ft AGL. This
does not make any sense to me.
Most ATC sentences need some fine tuning, e.g.
- turn left/right heading NNN (not turn to NNN - avoid "turn to two two two)
- landing clearance is "wind - runway - cleared to land"
- and every transmission starts with the A/C callsign, eventuallaly
abbreviated.
Please don't let the above discourage you from improving your script.
Getting some artifical ATC would be a nice feature for FlightGear.
Regards
Post by Rodolfo Leibner
Hi everyone,
I am attaching the beta version 0.2 of the atc.nas script.
You can see the short history of this project here
<https://forum.flightgear.org/viewtopic.php?f=30&t=32408&p=313182#p313182>
.
This code is not intended to compete with FGComm, Festival or other
similar facilities. On the contrary, their use is indicated when they are
not available (eg, few hardware resources, no Internet connection, etc.)
1.- How to use it
Once installed, tune Comm1 to the desired frequency and press the ">" key
to transmit your request.
You will hear the ATC's answer according the standard VFR phraseology,
* If you are on ground => The script interprets it's a taxi request
(if you are far from the runway) or a take-off request (if you are on the
correct Runway or at his holding point).
* If you are flying => The script interprets it's an approach request
(if you tunned an Approach freq.), or a landing request (if you
tunned a Tower one).
Note that only TWR freqs can deliver landing or take-off clearances, and
only GND or TWR stations can deliver taxiing ones.
Only at initial contact, the ATC message includes his station name &
type, and the current QNH.
APP stations will give a vector to the rwy in use (if you are far from
there) or order to contact TWR (if you are inside CTR).
TWR stations will give instructions to join pattern or make direct final (depending
on your position).
2.- How to install it
Put the attached file into the $FGFS_ROOT/Nasal/ directory, as *atc.nas*
and bind a key or button. I use "<" key.
I hope to have the help of beta-testers, which can bring a fresh look.
All opinions and comments are welcome. Both, regarding the script
behavoir and his nasal structure.
Regards,
Rodolfo Leibner
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot______
_________________________________________
Flightgear-devel mailing list
https://lists.sourceforge.net/lists/listinfo/flightgear-devel
--
Torsten Dreyer
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Flightgear-devel mailing list
https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Florent Rougon
2017-06-26 17:05:27 UTC
Permalink
Hi,
Post by Rodolfo Leibner
Instead of saying "contact tower", APP and GND should say "contact tower at
<TWR-freq>"
How can I get such frequency? In general, how do I know whether the apt has
or not a GND station? Or an ATIS, APP, etc?
I don't guarantee this will answer all these questions, but at least
some of them. Look at $FG_ROOT/gui/dialogs/airports.xml (the “Select
airport” dialog):

var info = airportinfo(airport_id);

[...]

# Display the comms frequencies for this airport
var fcount = 0;

if (size(info.comms()) > 0) {
# Airport has one or more frequencies assigned to it.
var freqs = {};
: foreach (var c; comms) {
var f = sprintf("%.3f", c.frequency);
if (freqs[c.ident] == nil) {
freqs[c.ident] = f;
} else {
freqs[c.ident] = freqs[c.ident] ~ " " ~ f;
}
}

foreach (var c; sort(keys(freqs), string.icmp)) {
setprop("sim/gui/dialogs/airports/selected-airport/comms/freq[" ~ fcount ~ "]/label", c);
setprop("sim/gui/dialogs/airports/selected-airport/comms/freq[" ~ fcount ~ "]/value", freqs[c]);
fcount += 1;
}
}

Help regarding this airportinfo() Nasal function in
flightgear/src/Scripting/NasalPositioned_cppbind.cxx:

//------------------------------------------------------------------------------
// Returns Nasal ghost for particular or nearest airport of a <type>, or nil
// on error.
//
// airportinfo(<id>); e.g. "KSFO"
// airportinfo(<type>); type := ("airport"|"seaport"|"heliport")
// airportinfo() same as airportinfo("airport")
// airportinfo(<lat>, <lon> [, <type>]);
static naRef f_airportinfo(nasal::CallContext ctx)
{

[...]

}

[...]

naRef initNasalPositioned_cppbind(naRef globalsRef, naContext c)
{
NasalPositioned::init("Positioned")
.member("id", &FGPositioned::ident)
.member("ident", &FGPositioned::ident) // TODO to we really need id and ident?
.member("name", &FGPositioned::name)
.member("type", &FGPositioned::typeString)
.member("lat", &FGPositioned::latitude)
.member("lon", &FGPositioned::longitude)
.member("elevation", &FGPositioned::elevationM);
NasalRunway::init("Runway")
.bases<NasalPositioned>();
NasalParking::init("Parking")
.bases<NasalPositioned>();
NasalCommStation::init("CommStation")
.bases<NasalPositioned>()
.member("frequency", &flightgear::CommStation::freqMHz);
NasalNavRecord::init("Navaid")
.bases<NasalPositioned>()
.member("frequency", &FGNavRecord::get_freq)
.member("range_nm", &FGNavRecord::get_range)
.member("course", &f_navaid_course);

NasalFix::init("Fix")
.bases<NasalPositioned>();

NasalAirport::init("FGAirport")
.bases<NasalPositioned>()
.member("has_metar", &FGAirport::getMetar)
.member("runways", &FGAirport::getRunwayMap)
.member("helipads", &FGAirport::getHelipadMap)
.member("taxiways", &FGAirport::getTaxiways)
.member("pavements", &FGAirport::getPavements)
.method("runway", &f_airport_runway)
.method("helipad", &f_airport_runway)
.method("tower", &FGAirport::getTowerLocation)
.method("comms", &f_airport_comms)
.method("sids", &f_airport_sids)
.method("stars", &f_airport_stars)
.method("getApproachList", f_airport_approaches)
.method("parking", &f_airport_parking)
.method("getSid", &FGAirport::findSIDWithIdent)
.method("getStar", &FGAirport::findSTARWithIdent)
.method("getIAP", &FGAirport::findApproachWithIdent)
.method("tostring", &FGAirport::toString);

[...]

(you'll find other useful Nasal functions just a bit further in the same
file)

HTH
--
Florent
Rodolfo Leibner
2017-06-26 17:54:58 UTC
Permalink
Merci, Florent. I will study that.

And I take the opportunity to attach the version 0.25 according the
suggestions made by Torsten.

Regards
Post by Florent Rougon
I don't guarantee this will answer all these questions, but at least
some of them. Look at $FG_ROOT/gui/dialogs/airports.xml (the “Select
var info = airportinfo(airport_id);
[...]
Rodolfo Leibner
2017-07-02 01:03:09 UTC
Permalink
Hi,
Please find attached the 1.0 version.
Two nasal scripts and a Readme file with instructions.
(I tried to send them into a zip, but it seems that the system does not
allow it)

Thanks to Torsten for the feedback and for encouraging me to add more
"intelligence". It was worth it.
Thanks to Florent for illuminating me on the data that *airportinfo()*
returns and are not documented in the wiki
<http://wiki.flightgear.org/Nasal_library>.

I know that much can still be done.
For example, to use* get_cart_ground_intersection() *to improve DEP and APP
instructions, etc.

But this is a work that has no end, and first I want to have your
suggestions about priorities and bug reports to continue walking on firm.
I count on it.

Regards,
Rodolfo
Post by Rodolfo Leibner
Hi everyone,
I am attaching the beta version 0.2 of the atc.nas script.
Loading...