es.ucm.look.locationProvider
Class LocationProvider

java.lang.Object
  extended by es.ucm.look.locationProvider.LocationProvider
All Implemented Interfaces:
java.lang.Runnable

public class LocationProvider
extends java.lang.Object
implements java.lang.Runnable

Adapter of the INS to the Look! framework


Constructor Summary
LocationProvider(Context context)
          Contructor.
 
Method Summary
static Context getContext()
          Add new motion sample to the queue
static float[] getDisplacement()
          Returns relative displacement.
static float[] getMapPosition()
          Returns position in map coordinates.
static float[] getPosition()
          Returns raw position
static boolean isMoving()
          Returns whether the device is moving or not.
 void onAccuracyChanged(Sensor arg0, int arg1)
           
 void onSensorChanged(SensorEvent event)
           
 void resetINS()
           
 void run()
          Recalculates distance moved
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationProvider

public LocationProvider(Context context)
Contructor. Initializes the INS and registers listeners.

Parameters:
context - Application context.
Method Detail

getContext

public static Context getContext()
Add new motion sample to the queue

Returns:
current context.

getDisplacement

public static float[] getDisplacement()
Returns relative displacement.

Returns:
relative displacement

getMapPosition

public static float[] getMapPosition()
Returns position in map coordinates.

Returns:
Position in map coordinates

getPosition

public static float[] getPosition()
Returns raw position

Returns:
Position in world coordinates

isMoving

public static boolean isMoving()
Returns whether the device is moving or not.

Returns:
whether the device is moving or not

onAccuracyChanged

public void onAccuracyChanged(Sensor arg0,
                              int arg1)

onSensorChanged

public void onSensorChanged(SensorEvent event)

resetINS

public void resetINS()

run

public void run()
Recalculates distance moved

Specified by:
run in interface java.lang.Runnable