GeoClue and Gypsy

Post on 28-May-2015

4,137 views 0 download

Tags:

description

geo-information frameworks for mobile Linux desktops

transcript

GeoClue and Gypsygeo-information frameworks for

mobile Linux desktops

Location matters

Your desktop or mobile knows who you are, what time it is, who you

know and what you're doing.

But it doesn't know where it is.

Open mobile devices

Mobile device manufacturers are pushing location awareness

iPhone, Android, N95, ...

Location comes in many flavors

GPS

GSM

WiFi

IP address

Proximity

User tracking

...and that is not all

+40° 59' 11.03"+29° 1' 35.62"

Kadife Sokak, 20Kadıköy, İstanbul

Kadife Sokak, 20Kadıköy, İstanbul

Zincir Bar, Kadife Sokak 20 Kadıköy, İstanbul

GeoClue

A D-BUS service that applications can use to become geo-aware.

Makes reading and writing geographical information as simple

and easy as time or date.

GeoClue

as simple and easy as time or date.

...regardless of whether you deal with coordinates or civic location

Problems Dealing With GPS Devices?

1. Multiple ways of accessing GPS devices: Bluetooth, serial2. Multiple GPS protocols: NMEA, proprietary binary protocols3. Only one program can access the GPS device at a time

How Gypsy Solves These Problems

1. Abstracts access to devices.2. Parses the GPS data into a sensible format3. Acts as a multiplexor

GPSD Exists Already, Why Not Use It?

Only solves the multiplexor problemIt doesn't attempt to solve abstraction problemAPI Model1. Sychronous with polling2. Asychronous with threads3. Do It Yourself: Parse either the NMEA or GPSD data

format

GPSD format:query: "p\n"reply: "GPSD,P=36.000000 123.000000\r\n"

GPSD Exists (pt 2)

Resource management1. Memory allocation policy2. Processor usage

IPC system1. TCP/IP based2. String based

Daemon overloaded with all sorts of fun things1. NTP time daemon2. Internet GPS

Gypsy Design

Designed for both desktop and embedded systemsLow memory usageLow power requirements

Gypsy Design (pt 2)

Keeping Power Low

GPS devices transmit about 5 sentences per second minimumSatellite information is constantly changingNeed to wake up as few processes as little as possibleFine grained dataClients need to be able to register interest in certain changes

Gypsy Limitations

Only parses NMEA at the moment1. GPSD knows 13 proprietary protocols2. Gypsy is limited by not having access to devices3. Someone is working on adding support for the Garmin

protocolOnly parses a small set of NMEA sentences1. NMEA is used in many different situations: GPS, sonars,

echo sounders2. Not all NMEA sentences are relevant to GPS3. Gypsy supports the ones most essential to GPS devices4. Adding extra sentence support is trivial.

Gypsy Architecture

Uses D-Bus as IPCAsynchronous without threading, ties into GLib mainloopEasy to use GObject based API

Where Am I?

Create a control object

CGypsyControl *control;char *path;

control = gypsy_control_get_default ();path = gypsy_control_create (control, "aa:bb:cc:dd:ee:ff", &error);

Pythonbus = dbus.SystemBus()control = bus.get_object(GYPSY_DBUS_SERVICE, GYPSY_DBUS_PATH)path = control.Create("aa:bb:cc:dd:ee:ff")

Where Am I?

Create an object to track position

CGypsyPosition *position;

position = gypsy_position_new (path);g_signal_connect (position, "position-changed", G_CALLBACK (position_changed), NULL);

Pythongps = bus.get_object(GYPSY_DBUS_SERVICE, path)position = dbus.Interface(gps, dbus_interface=GYPSY_POSITION_DBUS_INTERFACE)position.connect_to_signal("PositionChanged", position_changed)

Where Am I?

Finally create a device object and start the GPS

CGypsyDevice *device;

device = gypsy_device_new (path);gypsy_device_start (device, &error);

Pythondevice = dbus.Interface(gps, dbus_interface=GYPSY_DEVICE_DBUS_INTERFACE)device.Start()

GeoClue Architecture

Geoclue is API definitions (but also implementations)Interfaces for "current location" -- like Gypsy

PositionAddressVelocity

Interfaces for conversionGeocode (address to position)ReverseGeocode (position to address)

Geoclue providers

Implement one or more interfaceseasy to code (a webservice provider is ~200 LOC)have slightly different abilities

Geoclue Master

Geoclue providers are useful but could be easier in real world scenarios...

Master uses the best provider based onclient requirements (accuracy, etc)provider availability

Client applicationsideas and examples

Context for my friends

Instant messaging and microblogging can be used for

sharing location

Telepathy: Where are my friends?

Context for me

Location awareness can help make apps smarter

GNOME panel clock

Gnome panel clock

GeoRSS2POI

Location-aware weather

OpenStreetMap-based vector navigation

İstanbul: OpenStreetMap needs you!

Detail in Helsinki...

...but only a start in İstanbul