geoclue and gypsy
DESCRIPTION
geo-information frameworks for mobile Linux desktopsTRANSCRIPT
![Page 1: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/1.jpg)
GeoClue and Gypsygeo-information frameworks for
mobile Linux desktops
![Page 2: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/2.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/3.jpg)
Open mobile devices
![Page 4: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/4.jpg)
Mobile device manufacturers are pushing location awareness
iPhone, Android, N95, ...
![Page 5: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/5.jpg)
Location comes in many flavors
![Page 6: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/6.jpg)
GPS
![Page 7: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/7.jpg)
GSM
![Page 8: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/8.jpg)
WiFi
![Page 9: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/9.jpg)
IP address
![Page 10: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/10.jpg)
Proximity
![Page 11: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/11.jpg)
User tracking
![Page 12: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/12.jpg)
...and that is not all
![Page 13: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/13.jpg)
+40° 59' 11.03"+29° 1' 35.62"
![Page 14: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/14.jpg)
Kadife Sokak, 20Kadıköy, İstanbul
![Page 15: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/15.jpg)
Kadife Sokak, 20Kadıköy, İstanbul
![Page 16: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/16.jpg)
Zincir Bar, Kadife Sokak 20 Kadıköy, İstanbul
![Page 17: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/17.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/18.jpg)
GeoClue
as simple and easy as time or date.
...regardless of whether you deal with coordinates or civic location
![Page 19: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/19.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/20.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/21.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/22.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/23.jpg)
Gypsy Design
Designed for both desktop and embedded systemsLow memory usageLow power requirements
![Page 24: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/24.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/25.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/26.jpg)
Gypsy Architecture
Uses D-Bus as IPCAsynchronous without threading, ties into GLib mainloopEasy to use GObject based API
![Page 27: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/27.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/28.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/29.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/30.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/31.jpg)
Geoclue providers
Implement one or more interfaceseasy to code (a webservice provider is ~200 LOC)have slightly different abilities
![Page 32: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/32.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/33.jpg)
Client applicationsideas and examples
![Page 34: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/34.jpg)
Context for my friends
Instant messaging and microblogging can be used for
sharing location
![Page 35: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/35.jpg)
![Page 36: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/36.jpg)
Telepathy: Where are my friends?
![Page 37: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/37.jpg)
Context for me
Location awareness can help make apps smarter
![Page 38: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/38.jpg)
GNOME panel clock
![Page 39: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/39.jpg)
Gnome panel clock
![Page 40: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/40.jpg)
GeoRSS2POI
![Page 41: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/41.jpg)
Location-aware weather
![Page 42: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/42.jpg)
OpenStreetMap-based vector navigation
![Page 43: GeoClue and Gypsy](https://reader033.vdocuments.site/reader033/viewer/2022052303/55669f51d8b42acd288b48ec/html5/thumbnails/43.jpg)
İstanbul: OpenStreetMap needs you!
Detail in Helsinki...
...but only a start in İstanbul