This blog post is an addition to the UAV Playground project blog. It shows you how to program a very simple UAV Playground application that provides Google Earth with some KML data it receives as NMEA data from FlightGear.
[The poor formatting of the code sections is unintended]

Download
UAVplayground-KMLPorvider.zip

Source code (ProvideKML.java)
import java.applet.Applet;import jaron.flightgear.FlightGearNMEAReceiver;
import jaron.google.GoogleEarthKMLProvider; 
public class ProvideKML extends Applet {
FlightGearNMEAReceiver receiver;
GoogleEarthKMLProvider provider;
public void init() {
receiver = new FlightGearNMEAReceiver();
provider = new GoogleEarthKMLProvider();
receiver.addTrackpointListener(provider);
}
}
Google Earth KML file (Start-GoogleEarth-Tracking.kml)
<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.1">  <NetworkLink>
    <name>UAV Playground Network Link</name>
<Link>
<href>http://127.0.0.1:8080/</href>
<refreshMode>onInterval</refreshMode>
<refreshInterval>2</refreshInterval>
</Link>
</NetworkLink>
</kml>
FlightGear startup file (Start-FlightGear-NMEA.bat)
"%PROGRAMFILES%\FlightGear\bin\Win32\fgfs" ^  "--fg-root=%PROGRAMFILES%\FlightGear\data" ^ 
 "--nmea=socket,out,0.5,127.0.0.1,5557,tcp"
Start the application
- Start the Java application as an Applet
- Start FlightGear with the above batch file
- Start Google Earth by double-clicking on the above KML file or just open the file in Google Earth

To navigate to the track In Google Earth double-click on Places -> Temporary Places -> UAV Playground Network Link -> Tracks -> GPS Tracks.

Views: 190

Tags: flightgear, googleearth, gps, java, kml, nmea, simulator, uav

Giles Barton-Owen Comment by Giles Barton-Owen on February 25, 2009 at 10:46am
Has anyone thought about using google earths NMEA live converter thing... Its free with Google Earth 5.0

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Groups

© 2012   Created by Chris Anderson.

Badges  |  Report an Issue  |  Terms of Service