com.dopanic.panicsensorkit
Class PSKDeviceAttitude

java.lang.Object
  extended by com.dopanic.panicsensorkit.PSKDeviceAttitude
All Implemented Interfaces:
PSKSensorManagerListener

public class PSKDeviceAttitude
extends java.lang.Object
implements PSKSensorManagerListener


Field Summary
static int kPSKErrorRestricted
           
static float kPSKHumanEyeHeight
           
 
Method Summary
 double getAttitudeHeading()
           
 PSKVector3 getAttitudeSignedGravity()
           
 double getAttitudeTilting()
           
 PSKDeviceOrientation getCurrentDeviceOrientation()
           
 PSKDeviceOrientation getCurrentInterfaceOrientation()
          Get the current PSKDeviceOrientation of the device
 int getCurrentNativeOrientation()
          Returns the current device orientation independent from Phone / Tab
 int getCurrentSurfaceRotation()
          Get the current Surface.ROTATION of the device.
 int getDefaultDisplayOrientation()
          Checks the device default display orientation
 PSKVector3 getEcefCoordinates()
           
 float getGravityPitchDegrees()
           
 float getGravityRollDegrees()
           
 Matrix4f getHeadingMatrix()
           
 Location getLocation()
           
 float getLocationBearing()
           
 float[] getNormalizedGravity()
           
 float getOrientationRoll()
           
 PSKDeviceOrientation getPreviousDeviceOrientation()
           
 PSKDeviceOrientation getPreviousInterfaceOrientation()
          Get the previous PSKDeviceOrientation
 int getPreviousSurfaceRotation()
          Get the previousSurfaceRotation
 float[] getRotationVectorAttitudeMatrix()
           
 float[] getRotationVectorOrientation()
           
 float[] getRotationVectorRaw()
           
 boolean isAttitudeHasGravityOnX()
           
 boolean isAttitudeHasGravityOnY()
           
 boolean isAttitudeHasGravityOnZ()
           
 void onGpsStatusChanged(int i)
           
 void onGravityAccuracyChanged(int accuracy)
           
 void onGravityChanged(float[] values, long timestamp)
           
 void onLocationChanged(Location location)
           
 void onOrientationChanged(int rollFromSensor)
           
 void onProviderDisabled(java.lang.String s)
           
 void onProviderEnabled(java.lang.String s)
           
 void onRotationVectorAccuracyChanged(int accuracy)
           
 void onRotationVectorChanged(float[] values, long timestamp)
           
 void onStatusChanged(java.lang.String s, int i, Bundle bundle)
           
static java.lang.String orientationToString(int orientation)
           
static java.lang.String rotationToString(PSKDeviceOrientation orientation)
           
static PSKDeviceAttitude sharedDeviceAttitude()
          Singleton Instance of the PSKDeviceAttitude
static java.lang.String surfaceRotationToString(int orientation)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kPSKErrorRestricted

public static final int kPSKErrorRestricted
See Also:
Constant Field Values

kPSKHumanEyeHeight

public static final float kPSKHumanEyeHeight
See Also:
Constant Field Values
Method Detail

sharedDeviceAttitude

public static PSKDeviceAttitude sharedDeviceAttitude()
Singleton Instance of the PSKDeviceAttitude

Returns:
The Singleton Instance of the PSKDeviceAttitude of this Device

onRotationVectorChanged

public void onRotationVectorChanged(float[] values,
                                    long timestamp)
Specified by:
onRotationVectorChanged in interface PSKSensorManagerListener

onRotationVectorAccuracyChanged

public void onRotationVectorAccuracyChanged(int accuracy)
Specified by:
onRotationVectorAccuracyChanged in interface PSKSensorManagerListener

onGravityChanged

public void onGravityChanged(float[] values,
                             long timestamp)
Specified by:
onGravityChanged in interface PSKSensorManagerListener

onGravityAccuracyChanged

public void onGravityAccuracyChanged(int accuracy)
Specified by:
onGravityAccuracyChanged in interface PSKSensorManagerListener

onOrientationChanged

public void onOrientationChanged(int rollFromSensor)
Specified by:
onOrientationChanged in interface PSKSensorManagerListener

onLocationChanged

public void onLocationChanged(Location location)

onStatusChanged

public void onStatusChanged(java.lang.String s,
                            int i,
                            Bundle bundle)

onProviderEnabled

public void onProviderEnabled(java.lang.String s)

onProviderDisabled

public void onProviderDisabled(java.lang.String s)

onGpsStatusChanged

public void onGpsStatusChanged(int i)

getRotationVectorAttitudeMatrix

public float[] getRotationVectorAttitudeMatrix()

getEcefCoordinates

public PSKVector3 getEcefCoordinates()

getNormalizedGravity

public float[] getNormalizedGravity()

getRotationVectorRaw

public float[] getRotationVectorRaw()

getHeadingMatrix

public Matrix4f getHeadingMatrix()

getDefaultDisplayOrientation

public int getDefaultDisplayOrientation()
Checks the device default display orientation

Returns:
ORIENTATION_LANDSCAPE if defaultDisplayOrientation is Landscape. ORIENTATION_PORTRAIT if defaultDisplayOrientation is Portrait.

getCurrentNativeOrientation

public int getCurrentNativeOrientation()
Returns the current device orientation independent from Phone / Tab

Returns:
1 for portrait, 2 for landscape (constants: Configuration.PORTRAIT and Configuration.LANDSCAPE)

getCurrentSurfaceRotation

public int getCurrentSurfaceRotation()
Get the current Surface.ROTATION of the device.

Returns:
0 = (Surface.Rotation_0) = DefaultDisplayOrientation 1 = (Surface.Rotation_90) = Device rotated 90° counter-clockwise = LandscapeRight on Phones = Portrait with Button Right on Tabs 2 = (Surface.Rotation_180) = Device rotated 180° counter-clockwise = UpsideDown on Phones = Landscape with Button Top on Tabs 3 = (Surface.Rotation_270) = Device rotated 270° counter-clockwise = LandscapeLeft on Phones = Portrait with Button Left on Tabs

getPreviousSurfaceRotation

public int getPreviousSurfaceRotation()
Get the previousSurfaceRotation

Returns:
0 = DefaultDisplayOrientation 1 = Device rotated 90° counter-clockwise = LandscapeRight on Phones = Portrait with Button Right on Tabs 2 = Device rotated 180° counter-clockwise = UpsideDown on Phones = Landscape with Button Top on Tabs 3 = Device rotated 270° counter-clockwise = LandscapeLeft on Phones = Portrait with Button Left on Tabs

getCurrentInterfaceOrientation

public PSKDeviceOrientation getCurrentInterfaceOrientation()
Get the current PSKDeviceOrientation of the device

Returns:
On Phones: (PSKDeviceOrientationPortrait) = DefaultDisplayOrientation (PSKDeviceOrientationLandscapeRight) = Device rotated 90° counter-clockwise (PSKDeviceOrientationUpsideDown) = Device rotated 180° counter-clockwise (PSKDeviceOrientationLandscapeLeft) = Device rotated 270° counter-clockwise On Tabs: (PSKDeviceOrientationLandscape) = DefaultDisplayOrientation (PSKDeviceOrientationPortraitRight) = Device rotated 90° counter-clockwise (PSKDeviceOrientationUpsideDown) = Device rotated 180° counter-clockwise (PSKDeviceOrientationLandscape) = Device rotated 270° counter-clockwise

getPreviousInterfaceOrientation

public PSKDeviceOrientation getPreviousInterfaceOrientation()
Get the previous PSKDeviceOrientation

Returns:
On Phones: (PSKDeviceOrientationPortrait) = DefaultDisplayOrientation (PSKDeviceOrientationLandscapeRight) = Device rotated 90° counter-clockwise (PSKDeviceOrientationUpsideDown) = Device rotated 180° counter-clockwise (PSKDeviceOrientationLandscapeLeft) = Device rotated 270° counter-clockwise On Tabs: (PSKDeviceOrientationLandscape) = DefaultDisplayOrientation (PSKDeviceOrientationPortraitRight) = Device rotated 90° counter-clockwise (PSKDeviceOrientationUpsideDown) = Device rotated 180° counter-clockwise (PSKDeviceOrientationLandscape) = Device rotated 270° counter-clockwise

getCurrentDeviceOrientation

public PSKDeviceOrientation getCurrentDeviceOrientation()

getPreviousDeviceOrientation

public PSKDeviceOrientation getPreviousDeviceOrientation()

getOrientationRoll

public float getOrientationRoll()

getLocation

public Location getLocation()

getRotationVectorOrientation

public float[] getRotationVectorOrientation()

getLocationBearing

public float getLocationBearing()

getGravityPitchDegrees

public float getGravityPitchDegrees()

getGravityRollDegrees

public float getGravityRollDegrees()

getAttitudeHeading

public double getAttitudeHeading()

getAttitudeTilting

public double getAttitudeTilting()

orientationToString

public static java.lang.String orientationToString(int orientation)

surfaceRotationToString

public static java.lang.String surfaceRotationToString(int orientation)

rotationToString

public static java.lang.String rotationToString(PSKDeviceOrientation orientation)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAttitudeSignedGravity

public PSKVector3 getAttitudeSignedGravity()

isAttitudeHasGravityOnX

public boolean isAttitudeHasGravityOnX()

isAttitudeHasGravityOnY

public boolean isAttitudeHasGravityOnY()

isAttitudeHasGravityOnZ

public boolean isAttitudeHasGravityOnZ()



Copyright © 2014 doPanic GmbH. All rights reserved.