GPS - how to get lat lon and time from a bash script file ?

Michele Renda michele.renda at gmail.com
Sun Feb 22 15:10:14 CET 2009


> NB: I am just begining scripting; I know nothing about dbus (only copy 
> paste some working lines), etc. Please be patient :D

This is not bash, but python, and it need lib_pyfso_gobject import. The 
good part is that it use fso-frameworkd

But I think it can help:

from lib_pyfso_gobject import *
import gtk

usage     = OUsaged()
gps        = OGpsd()

usage.request_resource('GPS')

def on_gps_fix(status):
     print "Fix status: " + str(status)

def on_gps_position(fields, tstamp, lat, lon, alt):
     print '-' * 10
     print 'Lat: ' + str(lat)
     print 'Log: ' + str(lon)
     print 'Alt: ' + str(alt)

gps.connect('fix-status-changed',    on_gps_fix)
gps.connect('position-changed',        on_gps_position)

gtk.main()




More information about the community mailing list