pigeond pigeond

pigeon's blog - the pigeon concerto in D minor

FlightGear + Google Earth fun
2006/12/12 04:56:39
flightgear linux software

Last week I briefly played with Google Earth (GE) and KML, exploring the potential of using it to do something useful with FlightGear (FG).

The quickest hack I did was the GE version FGMap, which shows a moving map of all the online pilots on the FG MP servers. It is basically a very simple change with the FGMap CGI that translate MP server info into XML, only this time it outputs KML. Very simple and straight forward, nothing fancy at all. Check it out by opening this file in GE (if no one is on the server, you’ll see nothing! Check FGMap too).

FGMap Google Earth
[Updated] GE MP map using 3D models work-in-progress:

FGMap Google Earth
This weekend I started looking into GE’s 3D model support. Currently it supports two kinds of 3D model definition. KML embedded model using MultiGeometry, or a Collada .dae format. After some investigation I figured I have to use Collada to do what I want – having a 3D model of an aircraft and updating its position/orientation in GE. MultiGeometry (current version at least) is a fixed coordinates format, while with a Collada model you can place it in GE and then move it around, and also altering its heading/pitch/roll.

Quickly I found this Collada exportor plugin for Blender. As a test I loaded the C172P aircraft AC3D model from FG into Blender, followed by a few trail-and-error and I figured out what I need to export for GE: 1) Convert all faces to triangles, 2) Export Triangles, Disable Physics, Use UV Image and optionally Use Relative Paths.

According to the KML tutorial I have to pack up the .dae file together with the textures, along with a textures.txt for textures path mapping. However I discovered you could actually alter the path referenced in the .dae file to a local jpeg file, or even an HTTP URL.

So now I’ve got GE to show a 3D model of an aircraft from FG. Next is to get FG to talk to GE. There are many ways (network, serial port, etc) in FG you can export real time flight data. To make things easier for now, I’ve set it up to export simply latitude, longitude, altitude, pitch, roll, heading to a file (or actually a fifo), then I wrote a little program to read and output a KML file for GE to read. Then on the GE side, I have to create a KML with a NetworkLink to refresh the actual FG KML.

Now, problems. It seems even if I set the refresh time to be 0 seconds, and I can see GE refreshing the link continuously, on screen it still only updates the position/orientation about once per second. It could well be a GE internal limitation (or feature). The bottom line is, we need a sane way to feed data into GE.

Another thing is I can never get GE to “follow” the aircraft properly. It’s either not panning faster enough, or it will go kinda crazy and jitter a lot. Guess I’m not a GE/KML yet. I need to test it more and tidy up my codes/scripts/things a bit and I’ll put them up.

Nevertheless, it’s kind of fun to “fly FG inside GE”.

Screenshots of FlightGear running side by side with Google Earth, whereby FG sending data to GE and showing the 3D aircraft. Possibly more screenshots here

KSFO

Hong Kong with Computamaps Hong Kong 3D models




one comment to “FlightGear + Google Earth fun”


Sigi
2007/08/03 14:04:21

Hi,
this sounds very good! Is it possible to get the application/script which translate the output from FlightGear to KML. Would be nice if we can talk about this project.

The FlightGear Fan Portal is planning a squadron. It would be realy interessting what’s possible with GE regarding view the flight afterwards or things like that.

I’m looking for to hear from you
cheers
Siegfried

reply





Leave your comments for
“FlightGear + Google Earth fun”

(required)
(required, not shown to public)
comments:







blog top 24 tags
api bonding debian engrish fglive fgmap flightgear google ISP laptop lca2007 lca2008 linux live map mpserver navaids network qotd quote of the day taiwan vim windows wine
random photo
My Saitek Cyborg Evo
you may be interested in


Search
 
Web pigeond.net









this site is
created with vim



nearly all pages in this site are validated as
Valid HTML 4.01!

css validated by
Valid CSS!


pigeond.net copyright 2001 - 2014
designed, created, and coded by pigeon at pigeond dot net
all rights reserved