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]DownloadUAVplayground-KMLPorvider.zipSource 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 EarthTo navigate to the track In Google Earth double-click on Places -> Temporary Places -> UAV Playground Network Link -> Tracks -> GPS Tracks.