Board index FlightGear Support Interfacing

Accessing Geographic Data  Topic is solved

Connecting two computers, using generic protocol, connecting with Matlab?

Accessing Geographic Data

Postby Zago » Mon Apr 22, 2019 11:10 pm

Hi, I'm currently running an autonomy experiment with FlightGear. I would like to simulate a radar sensor that outputs a topographic map of the terrain under an aircraft. Is there a way to extract this information from FlightGear directly or will I need to create my own program to read the scenery files?
Zago
 
Posts: 6
Joined: Wed Oct 31, 2018 6:54 pm

Re: Accessing Geographic Data  

Postby Alant » Mon Apr 22, 2019 11:25 pm

Flightgear does not have a built-in air-to-ground radar system that gives a radar map of the terrain.
All a user can do is to scan the earth using techniques such as these : http://wiki.flightgear.org/Howto:Terrain_sampling_in_Nasal, or http://wiki.flightgear.org/Terrain_Detection
Alant
 
Posts: 914
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: Accessing Geographic Data

Postby Zago » Tue Apr 23, 2019 12:55 am

This seems sufficient for what I want to do. Out of further curiosity, I notice this article mentions it that geodinfo() "queries the built-in terrain cache". Is there further documentation on this cache?
Zago
 
Posts: 6
Joined: Wed Oct 31, 2018 6:54 pm

Re: Accessing Geographic Data

Postby Hooray » Sat May 04, 2019 12:38 pm

it's probably best to look at f_geodinfo() in $FG_SRC/Scripting, which in turn refers to the terrain cache in question, which should reside somewhere in SimGear

For the use-case in mind, it would be best to adapt the Canvas system to come up with a dedicated Canvas view element, we've got plenty of pointers here on the forum and the wiki, search terms would be "canvas synthetic terrain", obviously this would require some C++ glue code and patching sg/fg respectively
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: 11354
Joined: Tue Mar 25, 2008 8:40 am

Re: Accessing Geographic Data

Postby PINTO » Sun May 05, 2019 4:02 am

I am already doing something like this
Image

The display resolution is poor due to canvas limitations.

EDIT: to be more helpful, this is using the get_cart_ground_intersection method and querying distances in front of the aircraft. Canvas slows down FG greatly when there are more than ~2000 paths. I explained my testing here: https://sourceforge.net/p/flightgear/ma ... /36485052/. There's also links to higher res images further down in the mailing list thread.

EDIT2: forgot I did a video as well:
Actively developing the MiG-21bis (github repo) (forum thread) (dev discord) (fg wiki)

http://opredflag.com is an active flightgear dogfighting community (using a system that isn’t bombable)
User avatar
PINTO
 
Posts: 945
Joined: Wed Oct 21, 2015 6:28 pm
Callsign: pinto
Version: 2016.3.0
OS: Win10

Re: Accessing Geographic Data

Postby Hooray » Sun May 05, 2019 8:45 am

Using path elements is a particularly bad idea, I've exchanged roughly half a dozen PMs with someone from FGUK, I believe it was Necolatis, pointing out how an efficient groundradar scheme can be implemented on top of Nasal and Canvas by using nested raster images, one serving as the "palette" for terrain/elevation colors, and the other one showing/hiding sub-images as needed.

So even without dedicated C++ support, it would be possible to implement this, e.g. as part of the MapStructure framework, and by coming up with a corresponding new layer.

However, Stuart mentioned elsewhere that he might also need such functionality sooner or later, as part of his FG1000 effort, so you might just as well reach out to him, given that he's a core developer, he might be able to add the missing C++ bits - which is basically a sub-class of sc::Image that directly invokes the terrain sampler in C++ space, while applying a custom palette/effect or shader as needed
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: 11354
Joined: Tue Mar 25, 2008 8:40 am

Re: Accessing Geographic Data

Postby Johan G » Tue May 07, 2019 4:03 pm

Hmm, so at some point maybe something like this will be possible acquiring a SAR map with the F-35 AN/APG-81 AES radar,[1] Radar mapping with the F-111E AN/APQ-144 radar.[2]

Full video links:
[1] Engadget - Lockheed Martin F-35 Lightning II Stealth Fighter Cockpit Demonstrator Hands-On (11 min YouTube clip) Note that even for one of the more advanced fighter radars of today it still take several seconds.
[2] FlyingHoncho23 - F-111 low level (6 min YouTube clip).
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)
Johan G
Moderator
 
Posts: 5534
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: Accessing Geographic Data

Postby PINTO » Tue May 07, 2019 8:30 pm

Those would be *very* expensive operations with our current nasal library. SAR uses the radar reflectivity of whatever objects it hits, as well as the angle it hits at, to create the image. While possible with our current code, it would not be something done without a large performance hit, and even then it would be at a low resolution.

There was discussion on the mailing list of allowing canvas to directly edit the pixels of an image but I'm not sure if James ever got around to finishing it. This is what was going to be used instead of paths in my example. In addition, my method was going to be used to create a sea-scan radar, whenever I get around to writing it.
Actively developing the MiG-21bis (github repo) (forum thread) (dev discord) (fg wiki)

http://opredflag.com is an active flightgear dogfighting community (using a system that isn’t bombable)
User avatar
PINTO
 
Posts: 945
Joined: Wed Oct 21, 2015 6:28 pm
Callsign: pinto
Version: 2016.3.0
OS: Win10


Return to Interfacing

Who is online

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