Board index FlightGear Development New features

Ground services !

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Re: Ground services !

Postby ThomasS » Fri Jun 02, 2017 9:12 am

After playing around with the existing AI system (scenarios and tanker.nas) I built a Nasal based prototype for GroundServices that is based on a graph system, that lets vehicles move along the edges of a graph like trains on rails. It currently only moves ground vehicles along an airports taxiways without providing any services.

I hope I can use this as a basis and extend it for getting real ground services in the future. My intended next steps are:

* make the system more robust
* find/create(?) models for ground services. eg. I couldn't find a fuel truck model until now. And the stairs and caterer models are not animated. This would be nice.
* attach vehicles to an aircraft.
* Integrate to AI traffic. One challenge here is to detect a landed aircraft.

For those interested, this is a current snapshot of my work. https://github.com/thomass171/GroundServices
ThomasS
 
Posts: 91
Joined: Sun Sep 11, 2016 1:21 pm
Location: West of EDDK
Version: 2018.2.1
OS: Linux,MacOS,Windows

Re: Ground services !

Postby MMW » Fri Jun 02, 2017 10:54 am

Thanks! Will try this out later
DrivingGear - Automobile for Flightgear: https://drivinggear.tumblr.com/
MMW
 
Posts: 93
Joined: Sun Apr 16, 2017 5:52 am

Re: Ground services !

Postby pommesschranke » Sun Jul 23, 2017 1:08 pm

I tested it today with FG 2017.2.1 on Linux.
Works nicely at EDDL & EDDH, except for the elevation of the vehicles.
At EDDF it finds/shows only half of the groundnet and stays in standby status.

Well done!
Thank you for your contribution.

Do you know that apt.dat for some airports (on https://gateway.x-plane.com/) contains...
A) a groundnet for aircraft
plus
B) a groundnet for ground service vehicles

?
pommesschranke
 
Posts: 1104
Joined: Sat Apr 27, 2013 7:58 pm
Location: EDLM & LJCE
Callsign: d-laser
IRC name: laserman
Version: git
OS: Linux Lubuntu 18.04

Re: Ground services !

Postby ThomasS » Mon Jul 24, 2017 3:43 am

I recently realized the elevation problem (vehicles appear appx 20m above ground). I had the problem some time ago and considered it to be solved. Well, I'll check it again, also the EDDF groundnet.

About apt.dat: No, didn't know that. Thanks for the hint. So using FGs *.groundnet.xml files will not be sufficient for ground vehicles? I'll check how to access apt.dat from Nasal or to extract the data into some XML file where Nasal can read it.
ThomasS
 
Posts: 91
Joined: Sun Sep 11, 2016 1:21 pm
Location: West of EDDK
Version: 2018.2.1
OS: Linux,MacOS,Windows

Re: Ground services !

Postby ThomasS » Mon Jul 24, 2017 8:00 am

BTW: the elevation problem occurs when ground vehicles are launched before scenery load completed. In this case they move at (possibly wrong) airport elevation. Pressing AI->GroundServices->Reload after scenery is loaded restarts vehicles at correct elevation.
ThomasS
 
Posts: 91
Joined: Sun Sep 11, 2016 1:21 pm
Location: West of EDDK
Version: 2018.2.1
OS: Linux,MacOS,Windows

Re: Ground services !

Postby flycanarias » Wed Jul 26, 2017 3:55 pm

Hey guys, great achievements that are made here.
I recently came across the question how an eventual interaction with aircraft could take place.
Does anyone of you have an idea how to do that?
Can the ground vehicles make use of the aircraft groundnets and so approach the parking positions correctly?
And how will they approach the aircraft, no matter if AI or players aircraft, correctly?
Kind regards,
flycanarias
Canary Islands Custom Scenery
Improvement of the AI Traffic for the Canary Islands Region
RoutePlans for the Eastern Atlantic (Azores, Madeira, Cap Verde, Canaries)
About to open a Binter Canarias VA
flycanarias
 
Posts: 285
Joined: Fri Jun 10, 2016 3:29 pm
Location: EDDF, EDDC, GCFV

Re: Ground services !

Postby ThomasS » Fri Jul 28, 2017 4:52 am

I'm currently working on a catering and fuel vehicle approaching AI aircrafts based on groundnet, the current parking position and a defined door and wing position of the aircraft. My first implementation will only use rough approximations of these positions, because there seem to be only a few aircraft models out there that have door positions defined. And I'm afraid some of these positions are not correct. Anyway, I will build the logic first, improved positions can be added later step by step.

BTW: Two problems with integrating with AI aircrafts are:
1) The model/aircraft type cannot be retrieved from the property tree. So I will use a large text file table for mapping the callsign to the aircraft type.
2) The aircraft departure time cannot be retrieved from the property tree. So a service vehicle might still be busy while the aircraft is leaving its position.
ThomasS
 
Posts: 91
Joined: Sun Sep 11, 2016 1:21 pm
Location: West of EDDK
Version: 2018.2.1
OS: Linux,MacOS,Windows

Re: Ground services !

Postby daweed » Fri Jul 28, 2017 11:13 am

Hello,

Please, what as it the status here. I am developping LFLL and in this way would like to try to integrate Ground Services from the airpot scenery rather than from aircraft.
Does this project already working ?
What should i look to LFLL groundnet to validate that all needed are in place.

Regards
Linux Mint 18.3
AMD FX 4300 Quad-Core Black Edition|20 Go RAMGeForce GTX 750 Ti
FG Interface
Lyon Saint Exupery Scenery
daweed
 
Posts: 282
Joined: Thu Dec 11, 2014 10:45 am
Location: LFKP LFLL
Callsign: daweed
OS: Windows 10 Familly

Re: Ground services !

Postby ThomasS » Fri Jul 28, 2017 12:03 pm

My solution is based on the airports groundnet.xml. So for now you just have to make sure that your airports groundnet.xml is reasonable, meaning parking positions are at correct location and all connected to taxiways. Look at https://github.com/thomass171/GroundServices for the first release.
ThomasS
 
Posts: 91
Joined: Sun Sep 11, 2016 1:21 pm
Location: West of EDDK
Version: 2018.2.1
OS: Linux,MacOS,Windows

Re: Ground services !

Postby Hooray » Sat Aug 12, 2017 7:52 am

I would suggest to consider using Torsten's new addon framework to turn the whole thing into an addon over time, even if the addon framework should still be missing some things to make this work, it would be good to know to report back to Torsten if it's even feasible to turn this module into an addon.

Speaking in general, there is quite a bit of relevant pointers collected in Red Leader's wiki article here: http://wiki.flightgear.org/Scripted_AI_Objects
This also documents other approaches (tanker.nas, fox2.nas, bombable etc)

Sooner or later, you may also find it helpful to use a Canvas GUI dialog to show a map with ground networks and your vehicles moving along those tracks, e.g. for troubleshooting purposes - that would be pretty straightforward to do using the Canvas dialog. As a matter of fact, Stuart once implemented already code that draws OpenVG/Shiva paths to render taxiways:

Image

The whole map is drawn procedurally, so anything that you can access via XML, properties and/or Nasal could also be used to render such maps.


Besides, this may be of interest to people working on the jetway module, so you may want to reach out to them, maybe even to join efforts ?
http://wiki.flightgear.org/Howto:Animated_jetways
http://wiki.flightgear.org/AI_Jetway_Objects

PS: Is the script prepared to handle animating/updating traffic at multiple airports concurrently, or can it only do one currently ?
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: 11298
Joined: Tue Mar 25, 2008 8:40 am

Re: Ground services !

Postby ThomasS » Sat Aug 12, 2017 9:17 am

Thanks Hooray. These are valuable hints. I will start checking the addon framework and the Canvas GUI. And to answer your question: the script is limited to work on the current airport only, that is the airport, your aircraft currently is located (within a range of 3nm). And I don't have plans for extending it to multiple airports concurrently. My further extensions are focused to improve services, especially catering and fuel vehicles approaching AI aircrafts.
ThomasS
 
Posts: 91
Joined: Sun Sep 11, 2016 1:21 pm
Location: West of EDDK
Version: 2018.2.1
OS: Linux,MacOS,Windows

Re: Ground services !

Postby Hooray » Sat Aug 12, 2017 10:22 am

Regarding the addon framework, you could look at the FGAddon repository and the examples there - Torsten helped port the Spoken ATC module to become an addon.


Concerning the Canvas GUI, I just mentioned that, because I noticed that you had a visualization helper in your code, if you want to tinker with using the Canvas system, you will probably mainly need to look at these:

You could probably borrow code from $FG_ROOT/Nasal/canvas/map/taxiways.draw, which is based on code originally created by Stuart.

Apart from that, there is a complete "mapping" framework, called "MapStructure", created by Philosopher which could be used to create a layer for your groundnets, it's a little more sophisticated, but also fairly powerful:

http://wiki.flightgear.org/Canvas_Snipp ... o_a_Canvas
Image

The MapStructure framework is based on MVC concepts, and is fully style-able, too:

http://wiki.flightgear.org/Canvas_Snipp ... o_a_Canvas
Image

There is an annotated example illustrating how to create a new mapping layer to show tutorial targets (waypoints), which would be easy to adapt:

http://wiki.flightgear.org/Canvas_MapSt ... _Layer_TUT
Image


There is a list of existing MapStructure layers to be found at: http://wiki.flightgear.org/Canvas_MapStructure_Layers
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: 11298
Joined: Tue Mar 25, 2008 8:40 am

Re: Ground services !

Postby ThomasS » Thu Aug 31, 2017 10:41 am

I started an approach for displaying vehicles on a canvas map now, but I'm facing a "missing link" problem. Maybe you can give me some advice.

I extracted the map element from gui/dialogs/airports.xml for only having a canvas with some layers (to https://github.com/thomass171/GroundSer ... cesmap.xml), which was quite straightforward. The map is displayed with some layers which can be toggled. Fine.

Now I like to add some text or icon like in the example in http://wiki.flightgear.org/Canvas_Maps:

Code: Select all
var icon_park = me.grp_apt.createChild("text");
icon_park.setDrawMode(9);
icon_park.setText(park.name);
icon_park.setFont("LiberationFonts/LiberationMono-Bold.ttf");
icon_park.setGeoPosition(park.lat, park.lon);
icon_park.setSize(15, 1.3);


Also seems quite straightforward. But how do I get a reference to the camvas map group (grp_apt in the example) for adding a group and an element programmatically? It seems to be local to Nasal/canvas/generic-canvas-map.xml.

Is there some function for getting the group, or a callback? Or is my approach completely wrong?
Or is it necessary to create a dedicated layer for vehicles for using the canvas map in this way?
ThomasS
 
Posts: 91
Joined: Sun Sep 11, 2016 1:21 pm
Location: West of EDDK
Version: 2018.2.1
OS: Linux,MacOS,Windows

Re: Ground services !

Postby Hooray » Thu Aug 31, 2017 4:45 pm

the short answer is that your approach is not completely wrong, but it using an outdated "API" - my suggestion would be not to look at airports.xml and the stuff you found there, but to look at the MapStructure instead - that should make things much easier.

If you'd like to pursue with the other option, I could also provide the corresponding answers, but I'd basically suggest to leave it alone, it's using code that I once wrote to help generalize Gijs' ND code and its layers to come up with a MVC framework, and it's basically become obsolete due to Philosopher's re-implementation, called MapStructure.

Besides, the MapStructure framework is well documented (see the wiki), and it is also much more future-proof.

Both approaches assume familiarity with OOP and MVC concepts - so if you'd rather use "just" the Canvas APIs, you could also just use the Canvas Map element and position some symbols and Canvas path segments properly - that will not be as generic/flexible, but easier to do than using the airports.xml approach.

Anyway, kudos for looking at that code and understanding how it all hangs together, it's not exactly "straightforward" ;-)

To see for yourself just how much simpler MapStructure is in comparison open $FG_ROOT/gui/dialogs/map-canvas.xml

Or look at this (I encourage you to actually run the code in the Nasal console):

http://wiki.flightgear.org/Canvas_Snipp ... o_a_Canvas
Image

In other words, no PUI needed and no ugly embedded XML/Nasal workarounds

http://wiki.flightgear.org/Canvas_MapStructure
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: 11298
Joined: Tue Mar 25, 2008 8:40 am

Re: Ground services !

Postby ThomasS » Thu Aug 31, 2017 4:56 pm

OK, thank you for your advice. I'll check $FG_ROOT/gui/dialogs/map-canvas.xml and try to incorporate it.
ThomasS
 
Posts: 91
Joined: Sun Sep 11, 2016 1:21 pm
Location: West of EDDK
Version: 2018.2.1
OS: Linux,MacOS,Windows

PreviousNext

Return to New features

Who is online

Users browsing this forum: Applebot [Bot] and 1 guest