Writing a GPS-app using PyMaemo

python-logo.gif

Completely neglecting Paul Ferrill’s tutorial, I played a bit with PyMaemo to create an application which allows to record waypoints easily using the N810.

Until last summer, I mapped using a Garmin GPSMap60Cx. When I saw a POI or wanted to record a street’s name, I just pressed its waypoint button and talked to my music player weird stuff like »Waypoint 123, postbox on the right hand side in blah street«. You get used to the bypassers who keep an eye on this obviously mentally disturbed cyclist who tells weird things to his right hand (I guess they don’t notice the recording device in my hand).

During the winter months, I used osm2go excessively for mapping, but mainly by foot. It is, however, not suitable for mapping during cycling tours. As the 2009 cycling season just started, I mounted both the N810 (for navigation purposes) and the Garmin GPSr (for recording waypoints) on my handlebar. A bit too much for my taste, not to mention the music player I additionally carry around. So what I wanted to achieve is to do the waypoint recording completely with the N810, omitting the Garmin device.

I didn’t use Python before and had no time to read about it. So I ended in some googling around and stuffing the resulting PyMaemo snippets in an ugly script. Though I was surprised how easy it was to create and run an app, it was not possible to achieve other goals with a few lines of code. But anyway, I have a basic application which can save a waypoint with a name and a comment to a simple CSV file:

wp_catcher_01.png

Though the application is usable (and will be tested tomorrow), the following things are still missing:

  • Record audio for each waypoint and include the name of the audio file to the waypoint file. I found no code snipped to record audio which worked with PyMaemo. The snippets I found required Python modules which are not available on the N810.
  • Stop the GPS subsystem of the N810 after quitting the application. Though I placed some code into the destructor of the main class, it does not work as expected but quits with an error message. This is due to my ignorance of Python which will be fixed next week.
  • Instead of writing a CSV file which I need to convert to GPX via Gpsbabel, I want to write a GPX file directly. Surprisingly I didn’t find any code which I could use “out of the box”.
  • In case no GPS signal is available, I wanted to disable the waypoint record button. However, I found no method for the gps object to ask wether there’s a fix or even not.
  • I wanted to display some messages via the N810’s DBUS service, but as I never used it before I first need to learn more about the DBUS concepts.

Despite this “enormous” TODO-list, I’m very pleased with today’s results. Tomorrow I will leave the Garmin alone and use the N810 only for mapping. Goal achieved :) .

2 thoughts on “Writing a GPS-app using PyMaemo

  1. ce Post author

    Trust me, the code is that ugly that I don’t want to share and you don’t want to read it… :)

Comments are closed.