11 obtaining the user’s position dr. miguel a. labrador department of computer science &...

24
Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering [email protected] http://www.csee.usf.edu/~labrador

Upload: margery-edwards

Post on 23-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

11

Obtaining the User’s Position

Dr. Miguel A. Labrador

Department of Computer Science & Engineering

[email protected]

http://www.csee.usf.edu/~labrador

Page 2: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

2Copyright© Dr. Miguel A. Labrador

2Copyright© Dr. Miguel A. Labrador

2

Outline

• Positioning systems and techniques• Outdoor

– GPS system– Cellular-based systems

• Indoor• Java ME Location API 2.0

Page 3: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

3Copyright© Dr. Miguel A. Labrador

3Copyright© Dr. Miguel A. Labrador

3

Global Positioning System (GPS)

• Three major components– Space segment– Control segment– User segment

• Space segment consists of the orbiting satellites– 24 satellites in six orbital planes centered on the Earth are needed so

at least six satellites can be detected from almost anywhere• 6 more have been added to provide redundant signals, improve precision,

improve reliability and availability of the system

• Control segment consists of several ground stations used to track and monitor the space segment– Main control station in Colorado Springs, Colorado– Updates the atomic clocks on board of all satellites and the

ephemerides or table with the exact position of the satellites in the sky

Page 4: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

4Copyright© Dr. Miguel A. Labrador

4Copyright© Dr. Miguel A. Labrador

4

Global Positioning System (GPS)

– Ephemerides are later broadcast by the satellites and used by GPS receivers along with the signal’s elapsed time to calculate their own position

• User segment is made up of all GPS receivers

• GPS satellites continuously broadcast a navigation message– 1500 bits broken down in 5 subframes 300 bits long, 10 words 30 bits

long each– Words 1 and 2 always contain the same information

• Telemetry Word (TLM): used by the receiver for synchronization• Hand-Over Word (HOW): also for synchronization; enables the receiver to

identify the subframe– Words 3 to 10 contain the rest of the NM

Page 5: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

5Copyright© Dr. Miguel A. Labrador

5Copyright© Dr. Miguel A. Labrador

5

The Java ME Platform

TLM HOW Almanac Data, Health Status, Almanac Reference Time

1500

Subframe #5

TLM HOW Messages, Ionospheric Data, Coordinated Universal Time (UTC)

1200

Subframe #4

TLM HOW Ephemeris of Transmitting Satellite

900

Subframe #3

TLM HOW Ephemeris of transmitting Satellite

600

Subframe #2

TLM HOW Clock Correction Data, GPS Week Number

300

Subframe #1

TLM = Telemetry Word HOW = Hand-Over Word

0 30 60

Frame = 5 subframes = 1500 bits at 50 bps = 30 seconds total

Page 6: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

6Copyright© Dr. Miguel A. Labrador

6Copyright© Dr. Miguel A. Labrador

6

GPS System

• Almanac contains coarse orbit and status information about every satellite in the constellation

• Each NM contains 1/25th of the almanac– Receiver needs 12.5 minutes to receive the entire almanac from a

particular satellite– Almanac is very important because it helps GPS receivers to locate

satellites at power up• Satellites transmit NM at a very low transmission rate of 50 bps

– Transmit a NM every 30 secs• Main responsible for the time delay to obtain the first GPS fix

– Time To First Fix (TTFF)

• Satellites use CDMA technology to transmit the NM– Same two frequencies of 1.57542 GHz (L1 signal) and 1.2276 GHz

(L2 signal)– Encoding codes are known to all GPS receivers

Page 7: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

7Copyright© Dr. Miguel A. Labrador

7Copyright© Dr. Miguel A. Labrador

7

Lateration

• Process of calculating the user’s position using distances between entities

• Finding the position of the user consists of finding the distance between the GPS receiver and the satellite and solving a systems of equations using Pythagora’s theorem

Page 8: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

8Copyright© Dr. Miguel A. Labrador

8Copyright© Dr. Miguel A. Labrador

8

Lateration• Problem of this method is in the calculation of the distance

between GPS receiver and the satellites• Calculated measuring the time it takes the satellite signal to reach

the receiver and multiplying it by the speed of light• The NM contains the exact time at which the signal was sent• In order to make GPS receivers affordable, clocks are not very

precise– Synchronization problem introduce errors in distance calculations

• 1 microsecond error introduces an error of 300 meters!

• To eliminate this error, it is included in the calculations as an additional unknown variable– Four equations with four unknowns

• A fourth satellite is needed– Satellites are needed to be far from the user and separated from each

other• Dilution of Precision (DOP) used to select most appropriate satellites

Page 9: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

9Copyright© Dr. Miguel A. Labrador

9Copyright© Dr. Miguel A. Labrador

9

The GSM Cellular Network

• Cellular networks play a crucial role in LBIS – Transport network– Estimation of the user’s position

Page 10: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

10Copyright© Dr. Miguel A. Labrador

10Copyright© Dr. Miguel A. Labrador

10

The GPRS Architecture

Page 11: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

11Copyright© Dr. Miguel A. Labrador

11Copyright© Dr. Miguel A. Labrador

11

Cellular Positioning Technologies

• Cell Identification or Cell ID– Simplest localization method– HLR contains enough information to locate a user in the GSM network– Cell ID returns position of the BTS serving the user– Accuracy depends on cell size– Although fast and useful for some applications, not very accurate for

many other• Enhanced Cell ID

– BTS measures RTT and estimates distance • Reduces the radio of the circle only

• Enhanced Observed Time Difference (E-OTD)– BTSs periodically send beacon signals that MS use to measure

distance to anchors and apply lateration• Terminal-based positioning mechanism

Page 12: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

12Copyright© Dr. Miguel A. Labrador

12Copyright© Dr. Miguel A. Labrador

12

Cellular Positioning Technologies

• Uplink-Time Difference of Arrival (U-TDoA)– Similar to E-OTD but more complicated

• Calculations are performed by the BTSs based on signals transmitted by the MS

– MS is not transmitting all the time– Only one BTS is serving the MS– Location Measurement Units (LMU) are included in the network to

compile measurements and perform calculations

• Assisted GPS (A-GPS)– Easier and cheaper to implement in a GSM network– GPS-enabled phone and cellular network collaborate

• Improved accuracy• Better indoor coverage• Shorter TTFF• Less power consumption

Page 13: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

13Copyright© Dr. Miguel A. Labrador

13Copyright© Dr. Miguel A. Labrador

13

Cellular Positioning Technologies

• Assisted GPS (A-GPS) – Relies on assistant servers located in several parts of the GSM

network– Servers either provide information that the MS needs to perform the

calculations, or perform the calculations using information provided by the MS

– Server provides MS with information it cannot obtain • Almanac, more accurate clock information, accurate coordinates of the

server or BTS– Almanac allows the MS to lock to the GPS satellites faster

– Server can receive partial information from MS and use its computational power and good satellite signals to compute position on behalf of the MS

Page 14: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

14Copyright© Dr. Miguel A. Labrador

14Copyright© Dr. Miguel A. Labrador

14

Indoor Positioning Systems

• Outdoor positioning systems are difficult to use indoors– Indoor positioning systems have been developed to fill this need– The smooth integration of them is still and active area of research

• Wireless Local Area Networks (WLANs)– WLAN access points transmit beacon signals like BTSs in cellular

networks• Proximity sensing adopts the position of the closest AP• Lateration techniques can also be used

• Fingerprinting– Based on off-line measurements of the signal strength in specific

reference points within the space of interest• Stored in a database and utilized by the system to find the MS’s location

• Ultrasound-based systems– Use RF and ultrasound signals to estimate distances– Need US hardware and restricted to very few meters

Page 15: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

15Copyright© Dr. Miguel A. Labrador

15Copyright© Dr. Miguel A. Labrador

15

Skyhook’s Hybrid Positioning System (XPS)

• XPS is a software-based positioning systems that combines Wi-Fi AP locations, GPS data, and cellular tower locations to provide 10-20 meter accuracy positions in indoor and outdoor environments

• Mobile Location Client (MLC) and XPS Location Server (XLS)• MLC can perform all calculations

– Mobile-based location provider model• MLC can also off load the calculations on the XLS

– MLC send GPS, Wi-Fi AP, and Cell ID data to XLS– XLS has access to a huge DB with AP and cell tower locations and

powerful algorithms to make the calculations– Location-provider model– iPhone and iPod use Skyhook’s system

• http://www.skyhookwireless.com

Page 16: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

16Copyright© Dr. Miguel A. Labrador

16Copyright© Dr. Miguel A. Labrador

16

The Location API 2.0

• JSR 293 recently approved (October 2008)• Improves certain features and include new ones with respect to

JSR 179 (Location API version 1.0)• Two major packages

– javax.microedition.location• Improvements to classes needed to request and obtain a location

– Location, LocationListerner, LocationProvider, ProximityListener, GeographicArea

– javax.microedition.location.services• New classes and interfaces related to LBS, such as geocoding, map,

and navigation

Page 17: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

17Copyright© Dr. Miguel A. Labrador

17Copyright© Dr. Miguel A. Labrador

17

The Location API 1.0

• Most important objects included are the LocationProvider, Criteria, and Location objects– LocationProvider is the provider of location data

• All interactions with the underlying positioning technology are handled through this object

• Since there may be several positioning technologies, several LocationProviders may exist

– Criteria contains the requirements of the application• Accuracy, speed, and course of the MS is needed

– Location is the object that contains the location data

Page 18: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

18Copyright© Dr. Miguel A. Labrador

18Copyright© Dr. Miguel A. Labrador

18

The Location API 1.0

• Location object includes – QualifiedCoordinates class that contains estimated latitude, longitude,

altitude of the current position– Estimated horizontal and vertical accuracies

• Nice to know how good the estimation is– Speed and course of the MS– Time at which the position was calculated– Positioning method utilized

• Two methods– getLocation method to obtain the location one time– LocationListener method to obtain the location at predefined intervals

Page 19: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

19Copyright© Dr. Miguel A. Labrador

19Copyright© Dr. Miguel A. Labrador

19

getLocation Method

try {// Create a Criteria object to define desired selection criteriaCriteria cr = new Criteria();cr.setHorizontalAccuracy(20);//Requests an estimated accuracy of 20 meterscr.setSpeedAndCourseRequired(true);//Requests speed and course of MS//Requests a LocationProvider that meets these CriteriaLocationProvider lp = LocationProvider.getInstance(cr);// Get the location, 60 seconds timeoutLocation loc = lp.getLocation(60);Coordinates coord = loc.getQualifiedCoordinates();if (coord != null) {// Include code that uses coordinates here// ...}}catch (LocationException e) {// Could not retrieve location }catch (InterruptedException e) {// Location retrieval interrupted}

Page 20: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

20Copyright© Dr. Miguel A. Labrador

20Copyright© Dr. Miguel A. Labrador

20

Location Listener Class

public class LocListener implements LocationListener {

LocListener locListener = new LocListener();int interval = 4;// Interval between location updates is 4 sint timeout = 2;// Timeout after location request is 2 s// Maximum age allowed for a duplicate location value to be returned is 2 sint maxAge = 2;lp.setLocationListener(locListener, interval, timeout, maxAge);. . .public void locationUpdated(LocationProvider provider, Location location) {// This code will be triggered with updated // location data at the defined interval}. . .}

Page 21: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

21Copyright© Dr. Miguel A. Labrador

21Copyright© Dr. Miguel A. Labrador

21

The Location API 2.0

• Modifies the following features– Criteria and LocationProvider– ProximityListener– Landmark and LandmarkStore

• Includes the following new features– Landmark Exchange Formats– Geocoding– Map User Interfaces– Navigation

Page 22: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

22Copyright© Dr. Miguel A. Labrador

22Copyright© Dr. Miguel A. Labrador

22

Criteria and LocationProvider

• Eliminates ambiguity when Criteria includes conflicting requirements– Different devices may choose different positioning systems

• Criteria object now includes priorities, from 1 to N (lowest number, highest priority)

• An array of prioritized location method constants defined in the Location object can be used to specify the desired fallback order of positioning technologies to be used by the LocationProvider– A tracking application may wish to use GPS, and if GPS is not

available use cell signal-based positioning, and if cell signal-based positioning is not available use Cell ID, and so forth

Page 23: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

23Copyright© Dr. Miguel A. Labrador

23Copyright© Dr. Miguel A. Labrador

23

Criteria and LocationProvider

int[] preferredLocationMethods = new int[3];

//First preference of positioning technologypreferredLocationMethods[0] = MTE_SATELLITE;

//Second preferencepreferredLocationMethods[1] = MTE_TIMEDIFFERENCE;

//Third preferencepreferredLocationMethods[2] = MTE_CELLID;

//Get the LocationProvider for preferred location technologiesLocationProvider lp = LocationProvider.getInstance(preferredLocationMethods, parameters);

Page 24: 11 Obtaining the User’s Position Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu labrador

24Copyright© Dr. Miguel A. Labrador

24Copyright© Dr. Miguel A. Labrador

24

ProximityListener

• Proximity detection has been greatly enhanced in version 2.0• An interval and timeout value can be defined by the application

when the ProximityEnterAndExitListener, which has replaced the ProximityListener of version 1.0, is registered– Now, a new locationUpdated() method is called at a particular

interval, so that the application can tell how frequently the device is checking proximity to the registered location

• The specification now supports the detection of departure from a specific area

• The new specification allows the registration of different types of geographic areas, including circular, rectangle, and polygon geographic areas