geoclue and gypsy

43
GeoClue and Gypsy geo-information frameworks for mobile Linux desktops

Upload: henri-bergius

Post on 28-May-2015

4.142 views

Category:

Technology


0 download

DESCRIPTION

geo-information frameworks for mobile Linux desktops

TRANSCRIPT

Page 1: GeoClue and Gypsy

GeoClue and Gypsygeo-information frameworks for

mobile Linux desktops

Page 2: GeoClue and Gypsy

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.

Page 3: GeoClue and Gypsy

Open mobile devices

Page 4: GeoClue and Gypsy

Mobile device manufacturers are pushing location awareness

iPhone, Android, N95, ...

Page 5: GeoClue and Gypsy

Location comes in many flavors

Page 6: GeoClue and Gypsy

GPS

Page 7: GeoClue and Gypsy

GSM

Page 8: GeoClue and Gypsy

WiFi

Page 9: GeoClue and Gypsy

IP address

Page 10: GeoClue and Gypsy

Proximity

Page 11: GeoClue and Gypsy

User tracking

Page 12: GeoClue and Gypsy

...and that is not all

Page 13: GeoClue and Gypsy

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

Page 14: GeoClue and Gypsy

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

Page 15: GeoClue and Gypsy

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

Page 16: GeoClue and Gypsy

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

Page 17: GeoClue and Gypsy

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.

Page 18: GeoClue and Gypsy

GeoClue

as simple and easy as time or date.

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

Page 19: GeoClue and Gypsy

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

Page 20: GeoClue and Gypsy

How Gypsy Solves These Problems

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

Page 21: GeoClue and Gypsy

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"

Page 22: GeoClue and Gypsy

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

Page 23: GeoClue and Gypsy

Gypsy Design

Designed for both desktop and embedded systemsLow memory usageLow power requirements

Page 24: GeoClue and Gypsy

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

Page 25: GeoClue and Gypsy

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.

Page 26: GeoClue and Gypsy

Gypsy Architecture

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

Page 27: GeoClue and Gypsy

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")

Page 28: GeoClue and Gypsy

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)

Page 29: GeoClue and Gypsy

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()

Page 30: GeoClue and Gypsy

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)

Page 31: GeoClue and Gypsy

Geoclue providers

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

Page 32: GeoClue and Gypsy

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

Page 33: GeoClue and Gypsy

Client applicationsideas and examples

Page 34: GeoClue and Gypsy

Context for my friends

Instant messaging and microblogging can be used for

sharing location

Page 35: GeoClue and Gypsy
Page 36: GeoClue and Gypsy

Telepathy: Where are my friends?

Page 37: GeoClue and Gypsy

Context for me

Location awareness can help make apps smarter

Page 38: GeoClue and Gypsy

GNOME panel clock

Page 39: GeoClue and Gypsy

Gnome panel clock

Page 40: GeoClue and Gypsy

GeoRSS2POI

Page 41: GeoClue and Gypsy

Location-aware weather

Page 42: GeoClue and Gypsy

OpenStreetMap-based vector navigation

Page 43: GeoClue and Gypsy

İstanbul: OpenStreetMap needs you!

Detail in Helsinki...

...but only a start in İstanbul