UAV Playground 1.2 - An approach to Unmanned Aerial Vehicles

The UAV Playground is a collection of software components I've written in Java. They extend the Processing Development Environment (PDE) with some functionality that can help you to simulate and test different aspects of UAVs. You can as well use the UAV Playground library outside of the PDE in any Java application.
UAV Playground and all the Software it is based on are freely available. The distribution and the source code can be found on the Open Source project page at code.google.com/p/uavplayground.
The whole project is a work in progress and will be extended as I work on the exploration of UAVs. I'd appreciate if you leave me a comment or even better contribute to the project.

Features
- object oriented
- modular
- extendable
- free

How to use it
- install the Processing Development Environemt (PDE)
- download the UAV Playground distribution and follow the installation instructions
- [install the FlightGear Flight Simulator (optional)]
- have a look at the sketches (examples) and browse the api documentation that is included in the jar file


A very basic example
- connects to the flight simulator
- displays the current altitude and airspeed


The UAVsim example
- controls the flight simulator via virtual joysticks or...
- controls the flight simulator via a PID processor (basic autopilot)
- displays various data


Additional examples
UAV Playground - NMEA to KML

UAV Playground 1.1
- New GPS NMEA data import via a network connection to FlightGear
- New GPS tracking in Google Earth via a HTTP connection to the UAV Playground


UAV Playground 1.2 [Update] (download)
- Completely rewritten autopilot now supports waypoint navigation

Views: 3476

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

Comment by DJB on February 23, 2009 at 10:50am
Hi Jaron. Thanks for your feedback and for releasing the code. I will look into the issue of why Flightgear and UAVsim.jar do not communicate on my laptop. I also had the intention to add a cascaded or a parallel PID on the rudder.

I have another curiosity....this time related to your skillset. In what are you graduated, and what is your job? Electrical engineering or in Information Technology? Maybe I am generalizing....but its quite difficult to find hobbyists around, that do utilize PDE that interworks with stuff coded in Java to test out their ideas.

BTW I am Gastarbieter....the one that had left you the comments on youtube.
Comment by Alex on February 23, 2009 at 12:19pm
Any suggestions on implementing similar stuff through Matlab/Simulink ?

I want to interface Flightgear & Google-earth though Matlab/simulink with exact similar concept which 'Jaron' has done.
Comment by DJB on February 23, 2009 at 4:44pm
Hi Alex. There is already a blockset in Simulink if you want.

http://www.mathworks.com/access/helpdesk/help/toolbox/aeroblks/index.html?/access/helpdesk/help/toolbox/aeroblks/f3-19546.html&http://www.google.co.uk/search?hl=en&q=flightgear+simulink&meta=

I was also considering taking such an approach...due to many math functions that are already implemented.
Comment by jaron on February 23, 2009 at 4:53pm
DJB, I could be wrong but my own experience is that FilghGear is very demanding to your hardware. Memory and maybe the graphics card seem to be a critical factor. I received corrupted data from FlightGear under certain conditions.

Some configurations I've tested
- Intel Pentium M740 1.8GHz, Intel GMA900, 1GB RAM -> unable to communicate with FlightGear
- Intel Core 2 Duo T5450 1.67GHz, GeForce 8400M GS, 2GB RAM -> ok
- Intel Core 2 Quad Q9550, NVIDIA 9800GT (512MB), 4GB RAM -> good

No communication between UAVsim and FlightGear
You could reduce the update frequency for FlightGear (in the batch file) and increase the delays in the FlightGearSender and FlightGearReceiver classes. Try out the simple examples in the PDE and check if you encounter the same problem as with the UAVsim.

Implement your own algorithms
It's easy to implement your own algorithms if you understand the event handling mechanism I used for the UAV Playground. Have a closer look at the jaron.components.Signal class. First it might look a bit confusing but if you understand the concept behind it you'll like it.

My skills
I'm a freelancing Senior Software Engineer mainly employed in the news and digital media industry.
Not so long ago I rediscovered my passion for everything that flies (mainly helicopters) and with the UAV Playground I use my professional skills to discover something new and exciting.
Comment by jaron on February 23, 2009 at 5:12pm
Alex, all the communication between the UAV Playground components, FlightGear and Google Earth is based on network connections. If you browse the source code it'll maybe give you an idea of what you'd had to implement if can't find it out of the box.
Comment by Alex on February 23, 2009 at 8:02pm
Thanks jaron, I think I can make it work. May bug you later with few questions if I get stuck somewhere ;)

@DJB: That mathswork's toolbox is NOT useful at all. All they have is 1way interface to Flightgear, it can't get you data back from flightgear in any form. And guess what, they are selling this toolbox for $300 !!!
Comment by Alex on February 24, 2009 at 8:14am
Hi Jaron, I looked into your code & couldn't separate just 'Flightgear & google earth' communication part from it.

I have autopilot code in Matlab which is communicating very well through udp, now I just want to pull out gps info from FG to GE to get similar plots in GE as you have in your simulation. Any suggestion on this part?
Comment by jaron on February 24, 2009 at 9:13am
NMEA from FlightGear (FG)
The class FlightGearNMEAReceiver contains the logic that provides a socket connection for FG. Once FG is started with the --nmea argument (see Start-FlightGear-UAVsim.bat) it connects to the NMEA receiver. The receiver gets the NMEA data from FG and stores it in an object of type Trackpoint (an abstraction for the NMEA GPS data). After that the NMEA receiver informs all its listener about the new GPS data it has received.

Gluing the things together
An object of type GoogleEarthKMLProvider can be added as a listener to a FlightGear NMEA receiver object. By doing so it receives all the track points from the receiver and stores them in a list called track path (see Trackpath).

KML for Google Earth
By opening the file Start-GoogleEarth-Tracking.kml in Google Earth (GE), GE starts polling the KML provider periodically via a HTTP connection and gets served with the requested track path in the KML format.

There are many different ways you can provide GPS data for GE and the method depends, among other things, on how much control you would like to have over the generated data.
Comment by Alex on February 24, 2009 at 9:42pm
Thanks jaron for detail explanation, I went through all your posts but still couldn't success in interfacing FG to GE :(
I am getting errors while compiling 'FlightGearNMEAReceiver' alone without using 'Processing'. Any ideas on avoiding Processing & still be able to fetch waypoint/tracks from FG to GE?

It seems that --nmea argument & GoogleEarth-Tracking.kml is working fine but I can't see anything in GE !
Any suggestions on simplifying this whole thing? I wanted to have a separate program to read nmea strings & pass it to .kml into GE. I am also using Matlab(for Autopilot code) which is using udp, whether that can be a problem? Can't we use udp & tcp together?
Comment by jaron on February 25, 2009 at 2:08am
Alex, have a look at this very simple example that shows you how to use the NMEA to KML functionality without the Processing Development Environment: UAV Playground - NMEA to KML

You can directly import NMEA to Google Earth from a GPS device or you can provide Google Earth with a KML file that it reads periodically. Have a look at the KML 2.1 Tutorial.

You should be fine with any kind of network connection as long as they don't use the same port.

Comment

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

Join DIY Drones

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service