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.
Comments
Hi, the program works perfectly. I am trying to use it as base to take some more data out. I have tried to do it adding more lines in the start up file:
"--nmea=file,out,1,C:\Navegacion\nmea.txt"
This is just a test but it didn't work and don't understand why, I have none experience as programmer or with this kind of files neither. How can I do it?
I would like to change the specifications of the flight too, airport, plane, etc., programing them in the start up file, is it possible?
I apreciate any help, thanks, :)