Board index FlightGear Development Add-ons

Development of a Landing Challenge Add-on

FlightGear has support for add-ons, to further extend the simulator's core functionality.

Development of a Landing Challenge Add-on

Postby danielHL » Sun May 30, 2021 9:18 pm

As discussed on the Wednesday GA Multiplayer discussion thread I have started the development of a Landing Challenge Add-on for FlightGear. I'd love to present some ideas here and invite you to collaborate.

What's it supposed to do?
Several things, in fact. In its basic form, the add-on will present some compiled landing information on touchdown, possibly in a nice graphical pop-up. This will be the "Just fly and rate my landing" mode (not yet implemented).

Then there is the General Aviation Precision Flying Competition Mode where a designated target runway is selected and touchdown chalk markings are placed on the runway. Each landing there will be rated according to the FAI Sporting Code. The ratings can also be announced via Chat in a multiplayer competition (some features of this mode are already working).

Later, there can also be an ILS training mode where LOC/GS data and track are displayed (not yet implemented).

What's to do?
A lot of things! This is my first nasal project and I'm working rather slowly but learning. The following areas need special care:
  • Dialog magic. Who knew that radio button are just round checkboxes in FG? ;-) Also maybe make parts of the GUI disappear in certain Modes?
  • Canvas/SVG artwork for a nice pop-up and information display
  • Blender work and textures for the competition chalk marks on the runway.

Acknowledgments
I took the very first form of the add-on from here, but besides the listeners and message code there is not much remaining. I've cited the original author in the header. In changing the name from landing-rate to landing-challenge I inadvertently picked the exact name of the corresponding MS FS2020 feature :-/ .

Show me the code...
It can be found here

How does it work?
Install as a regular add-on. At the moment, airport and runway selection is hardwired to EDHE RWY 09 (Uetersen near Hamburg), but that will soon be configurable. Go to The add-on configuration dialog, and close it via Ok to set up the challenge. Notice the chalk markings and cones on the runway. Take off, fly a pattern, and touchdown on RWY 09, the landing data will be printed in the lower left and on the console.
danielHL / D-FMPW
danielHL
 
Posts: 280
Joined: Fri May 02, 2014 7:23 pm
Callsign: D-FMPW
Version: next
OS: Linux

Re: Development of a Landing Challenge Add-on

Postby danielHL » Sun May 30, 2021 9:34 pm

Some first screenshots:
Image
Image
danielHL / D-FMPW
danielHL
 
Posts: 280
Joined: Fri May 02, 2014 7:23 pm
Callsign: D-FMPW
Version: next
OS: Linux

Re: Development of a Landing Challenge Add-on

Postby TheEagle » Mon May 31, 2021 6:11 pm

danielHL wrote in Sun May 30, 2021 9:18 pm:Dialog magic. Who knew that radio button are just round checkboxes in FG ?

That's not magic. Everyone having worked with a GUI toolkit before should know that ! :wink:
danielHL wrote in Sun May 30, 2021 9:18 pm:Canvas/SVG artwork for a nice pop-up and information display

If you can really display SVG in the FG screen, that will be my part ! I just love SVG !
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3401
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Development of a Landing Challenge Add-on

Postby Hooray » Mon May 31, 2021 6:32 pm

f you can really display SVG in the FG screen, that will be my part ! I just love SVG !


You can display SVG files in FlightGear (well, using a subset of SVG): https://wiki.flightgear.org/SVG
https://wiki.flightgear.org/Canvas_SVG_parser

Image

For approach visualization, you might want to take a look at rleibner's previous work in that area:

https://wiki.flightgear.org/PAR_instrument
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Development of a Landing Challenge Add-on

Postby danielHL » Mon May 31, 2021 6:35 pm

Yeah well, everywhere else you are able to group radio buttons together and only one of the group can be selected. Not so much in FG - everywhere I looked there was a nasal script inside the dialog with listeners on the radiobutton state that de-selects the previous selection ^^ I will have a look. It's just an annoyance...

That would be great if you can come up with some design to display the results. Maybe you team up with JSB, he has some sort of framework to connect svg / canvas with properties so that the correct values are displayed at the corresponding places. You can look at the types of data that are available at the moment in the landing message. Some Icons and maybe a simple graphical representation of these values would be great!

We should decide how large this pop-up will be and when it will be displayed. At touchdown? probably not or only if it's very small an unobtrusive. Some seconds after touchdown or at a certain velocity? or maybe a small notification icon that will display more info when clicked?
danielHL / D-FMPW
danielHL
 
Posts: 280
Joined: Fri May 02, 2014 7:23 pm
Callsign: D-FMPW
Version: next
OS: Linux

Re: Development of a Landing Challenge Add-on

Postby TheEagle » Mon May 31, 2021 6:43 pm

danielHL wrote in Mon May 31, 2021 6:35 pm:We should decide how large this pop-up will be and when it will be displayed. At touchdown? probably not or only if it's very small an unobtrusive. Some seconds after touchdown or at a certain velocity? or maybe a small notification icon that will display more info when clicked?

At touchdown is surely not a good idea (IDK how it's in FG :?: , but for example on my Desktop, when a window pops up it get's the keyboard focus). I think it should pop up when speed is 0 knots (parked). Maybe at first just a small window with a small message (e.g. "Very good landing :D " or "OMG, you really landed before the runway ?? :shock:") and a "Show landing details" button below, which will pop up a bigger dialog with the details.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3401
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Development of a Landing Challenge Add-on

Postby Hooray » Mon May 31, 2021 7:12 pm

PUI widgets are rather limited - however, the existing Canvas GUI engine is fairly easy to use and extend as needed if you know some Nasal and basic MVC concepts (most artwork was taken from ubuntu at the time):

Image

https://wiki.flightgear.org/Canvas_widget_matrix
https://wiki.flightgear.org/Howto:Creat ... GUI_Widget
https://wiki.flightgear.org/Canvas_widgets

Regarding visualization, the sky is the limit thanks to Canvas.Path and Canvas.Image - but even if you need tables or plots, that's fairly easy to do, even using 3rd party libs:

https://wiki.flightgear.org/Howto:Exten ... ort_MathGL
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Development of a Landing Challenge Add-on

Postby danielHL » Mon May 31, 2021 7:15 pm

Yeah thanks for the info. I'm not really a fan of canvas UI in it's current state and would opt for consistent look, at least for the configuration GUI, i.e. PUI. The info pop-up is another matter.
danielHL / D-FMPW
danielHL
 
Posts: 280
Joined: Fri May 02, 2014 7:23 pm
Callsign: D-FMPW
Version: next
OS: Linux

Re: Development of a Landing Challenge Add-on

Postby Ysop » Mon May 31, 2021 7:24 pm

Nice one, Daniel! This looks really promissing!

Just some thinking, if it would be possible to extent at to FAA/EASA standards....stabilized approach, PAPI-deviation, etc. Good landings are not necessarily soft landings.I see, you have plenty of ideas already, so take your time.

Looking forward to test it on a Wednesday session!
User avatar
Ysop
 
Posts: 1348
Joined: Thu Oct 25, 2018 10:06 pm
Version: 2020.3.18
OS: ubuntu 22.04

Re: Development of a Landing Challenge Add-on

Postby Hooray » Mon May 31, 2021 7:46 pm

danielHL wrote in Mon May 31, 2021 7:15 pm:Yeah thanks for the info. I'm not really a fan of canvas UI in it's current state and would opt for consistent look, at least for the configuration GUI, i.e. PUI. The info pop-up is another matter.


Keep in mind that, as long as you have some artwork (procedurally created or via SVG/Inkscape) you can create all sorts of custom widgets easily: The shuttle isn't using any of the standard Canvas GUI widgets:

Space Shuttle
Thorsten wrote:To be sure the dialogs will be available under all conditions (Qt and nonQt builds) in the future, I have started to move them to pure canvas technology.

That has the advantage that we're now a lot more flexible - we don't need to care for things like widgets and layouts. The first example of this is the new propellant dialog (actually the launch version - it'll look different afterwards and show OMS and RCS propellant instead).

Image




Besides, you can have your cake and eat it, by using PUI and embedding an arbitrary number of canvas widgets inside the dialog:

https://wiki.flightgear.org/Howto:Addin ... GUI_dialog
Image

You can also add complex contents to such embedded widgets:

Image

Once you have owner-drawn artwork, you can also easily register your own event handlers:

https://wiki.flightgear.org/Canvas_event_handling
https://wiki.flightgear.org/Canvas_Draw
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Development of a Landing Challenge Add-on

Postby TheEagle » Mon May 31, 2021 8:13 pm

Thanks for all the information, Hooray ! That's surely gonna help !
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3401
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Development of a Landing Challenge Add-on

Postby danielHL » Tue Jun 01, 2021 10:50 pm

Progress report:

The landing data is now exposed to the property tree and we have an initial popup coming up on touchdown.

Image
danielHL / D-FMPW
danielHL
 
Posts: 280
Joined: Fri May 02, 2014 7:23 pm
Callsign: D-FMPW
Version: next
OS: Linux

Re: Development of a Landing Challenge Add-on

Postby merspieler » Wed Jun 02, 2021 8:23 am

How relyable is your offcenter and slip angle?

I've made a similar addon, (also based on the landing rate one) and at some airports I've got widely incorrect values for those two... iirc YMML was one of these airports.
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2228
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: Development of a Landing Challenge Add-on

Postby danielHL » Wed Jun 02, 2021 8:54 am

Slip angle is actually wrong at the moment. This should be the angle between rwy centerline and plane heading, for now this is just "position/side-slip-angle" which I believe is to the relative wind and not what I want.

Offcenter is calculated from touchdown position and the rwy coordinates. At the moment I can't see this giving "widely incorrect values". What did you calculate and what were the errors?
danielHL / D-FMPW
danielHL
 
Posts: 280
Joined: Fri May 02, 2014 7:23 pm
Callsign: D-FMPW
Version: next
OS: Linux

Re: Development of a Landing Challenge Add-on

Postby Johan G » Wed Jun 02, 2021 12:46 pm

danielHL wrote in Wed Jun 02, 2021 8:54 am:Slip angle is actually wrong at the moment. This should be the angle between rwy centerline and plane heading, for now this is just "position/side-slip-angle" which I believe is to the relative wind and not what I want.

I am not good at Nasal, but it looks like the nasal function airportinfo() and /sim/airport/closest-airport-id possibly could be used to get the runway heading, that then could be used together with either /orientation/heading-deg or /orientation/heading-magnetic-deg to get the offset from the runway heading (if that is what you are looking for).
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6625
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Next

Return to Add-ons

Who is online

Users browsing this forum: No registered users and 0 guests