Android SensorManager.getOrientation() returns pitch between -PI/2 and PI/2
I am designing an app that needs to check the device's orientation (Azimuth, Pitch and Roll). I use the following code to achieve this: @Override public void onSensorChanged(SensorEvent event) { if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) gravityMatrix = event.values.clone();// Fill gravityMatrix with accelerometer values else if(event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) geomagneticMatrix = event.values.clone();// Fill geomagneticMatrix with magnetic-field sensor values if(gravityMatrix != null && geomagneticMatrix != null){ RMatrix = new float[16]; IMatrix = new float