Posts categorized “OpenMoko”.

GPS Geekery

At the weekend we drove from Kaiserslautern to Köln and back, and I used the OpenMoko FreeRunner as a GPS tracker on the way. It worked impressingly well, it got a fix in about a minute happily tracked for nearly 6 hours without charging the battery. The TangoGPS logging left me with a text-file with about 10500 entries of gps coordinates, speed, heading and time. TangoGPS is great on the openmoko, but it's not very feature rich when it comes to looking at the logs later. You can load them, and see them on the map, but that's it.
There is a tool called gpsbabel which can convert these logs to other formats for GPS logs, and this let me convert my logs to .kmz files and again view them, now in Google Earth. However, what I really wanted was a bit more analysis, at least giving me average speed, etc. Mainly I was looking for an explanation why the car used more petrol on the way home than going out.
A quick googling brought me nothing, so I brought out R, which I've not really touched since finished the PhD. The syntax of R really hasn't improved since last time, it still feels like it's cobbled together by very talented and intelligent people, but people who never saw a real programming language before. Anyway, R had a bit of trouble plotting the 10,000 data points, at least quickly enough for my taste. To reduce the data I learned a new '''awk''' trick, and '''cut''' that I discovered last week:


cat tangogps.log | awk 'NR % 4 == 1' | cut -d, -f 4,7

This will print only every 4 lines, and only the speed and date. (In retrospect it would perhaps have been much easier to do this in R). Now finally, loading it into R I could find out that my average speed was 22 km/h. I couldn't quite stop there though, so I spent nearly an hour plotting some things:

Speed driving from Kaiserslautern to Köln:

(Note the 45 minutes spent standing still at the end because of damn FCK playing on Friday night)

Driving speed histogram:

And for completeness, the other way:


In the end I learned nothing, I drove slightly faster going there, so I should have used more petrol that way. Perhaps the head wind was stronger going back? A shame Kaiserslautern is south of Köln, otherwise the explanation would of course be that driving 'downhill' uses less petrol…

Now this is perhaps getting a bit too geeky – even for me.

Exhilarating Acceleration

Now that the Nepomuk review is finished I've had some time to play with the OpenMoko FreeRunner. The state of the standard phone-software is abysmal, but the hard-ware is cool AND it runs python :) Since Kaiserslautern was covered in snow this weekend and it was not so tempting to go out I spent a few hours playing with the accelerometers. The actual idea for what to do started with seeing this screenshot:

of the game Zing on OneMoreLevel.com. The game is nothing like I thought it was, I imagined the small things to be very abstract cars and not bugs trying to eat you. Oh well.

Anyway, within a few hours and some stealing Creative Commons content later I had a crappy car game:

controlled by the accelerometer of the FreeRunner, i.e. lie the FreeRunner flat, start the game, now when you tilt the FreeRunner in some direction the car drives that way! Trust me, the scrreenshot really does not do it justice, the feeling you get frome the immediate control and the amazing sound-effects is… well pretty much just like driving in real life!

Download tarball, untar on FreeRunner, make sure you have python-pygame and libpng3 installed and run python car.py. Press AUX to exit. The code is of course not pretty, but does at least show some basics of Accelerometer handling.