Google Earth can be controlled by AppleScript (on Macs, Windows probably has similar options). I took a couple of projects I've been working on, and came up with a cool little real-time google earth tracker.

Equipment:

Prop protoboard
GPS
5 degree of freedom board from Sparkfun
XBee 900 100 mW modules

On the computer I have a cocoa app monitoring the XBee over a serial line, and parsing the strings coming over it. Through AppleScript, the cocoa app moves the Google Earth's camera around, to follow the remote tracker. Also, the application has an embedded web view with Google Maps. For fun, I even had the tilt of the camera be adjusted by the tilt of the remote IMU, which was kind of annoying so I turned it off. Also, the azimuth of the camera matches the GPS's course over ground. So the effect is that google is following the remote tracker. The annoying thing is that GE doesn't allow for dropping crosshairs via apple script, so it can be difficult to tell where exactly the camera is looking at. Maybe on the windows side there is more control, I don't know. Even at 900 MHz and 100 mW, the XBee doesn't really work more than a block away here in NYC. I think I'll take it into Manhattan were GE is full of 3D buildings and see if I can monitor a remote fly-through (on foot) between the buildings. I'll keep the computer-side antenna outside to see if that gets me better distance.

Anyways, I just did this for fun, so the code isn't post-able yet, and maybe never will be, but if anyone wants to to do something similar, I'll email the source to you.

I have a question for you guys. According to the manual, this XBee should have a latency of only a few ms. But I'm getting a latency well over one second, any ideas?

Views: 47


Moderator
Comment by Chris Anderson on February 15, 2009 at 9:40am
That latency is nuts--have you done the range test with the Xbee X-CTU utlity? (remember to wire a loopback on the remote side). That will tell you how many packets you're losing.
Comment by Jay Kickliter on February 15, 2009 at 11:10am
Thanks for pointing out that software. It seems pretty skippy using it, and I'm not dropping any packets. But it doesn't seem to say what the latency is.
Comment by Reto on February 15, 2009 at 1:37pm
@Jay: check the ArduPilot simulation posts for more GE integration.
Comment by lionel on February 16, 2009 at 3:18am
Really impressed :-)
I checked Google Earth's (4.3) dictionary on Tiger 10.4.11, my guess is that you are using the GetViewInfo and SetViewInfo methods. Am I right?
I your solution 100% Leopard based as the screenshots seem to indicate?
Comment by Jay Kickliter on February 16, 2009 at 6:20am
Thanks Lionel. I'm using Leopard, but the software I wrote should be Tiger compatible. You're right, SetViewInfo is all Google exposed. I'm still curious how the Windows folks get more control. I'll read some more and hopefully be able to port it to an Apple solution
Comment by SLUGS Team on February 16, 2009 at 12:18pm
Hey Jay,
This looks really cool. Congrats. This seems quite interesting, I currently have a full ground station software working for the SLUGS autopilot but it only runs on windows, I would be delighted to take a look at your code "as is" to learn about the serial port in OSX and how you are using Google Earth via applescript. In windows I do everything through KML files which works well but I would like to see if I can come up with a Mac version of my ground station. Thanks!
Comment by Jay Kickliter on February 16, 2009 at 12:53pm
No prob. I must be blind, I can't find a way to to send a private message here. Email be at jay.kickliter at gmail and I'll send the source. From what I've seen KML is the way to go, since using AppleScript is too limited. But at least this source would give you a heads up on doing serial comms in OS X.
Comment by lionel on February 16, 2009 at 2:22pm
Serial port programming on the Mac:


This page is also a good starting point with pointers to the I/O kit.
http://developer.apple.com/documentation/DeviceDrivers/Conceptual/WorkingWSerial/WWSerial_Intro/chapter_1_section_1.html

Hope this helps
Comment by Jay Kickliter on February 16, 2009 at 4:09pm
Lionel, I'm using an open source class called AMSerialPort. It greatly simplifies serial programming in Objective-c. It polls the port calls a delegate method if there's anything there.
Comment by Jay Kickliter on February 16, 2009 at 4:14pm
I'm just curious, are there many Apple user's here? And are any of you Cocoa programmers? If so, we might want to think about sharing any ground station software we come up with.

Chris, thanks for that pointer. I think I have a preliminary KML based tracker working in OS X. I'm a bit new (as in 1 hour ago) to file programming in Cocoa, so I'm not sure the best way to reference the files so the code isn't too hard-coded.

Comment

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

Join DIY Drones

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The third round was a reliablilty/aerial photography round for both planes and copters, which is now closed. Stay tuned for the next round, beginning soon.

A list of all T3 contests is here

 

© 2012   Created by Chris Anderson.

Badges  |  Report an Issue  |  Terms of Service