I'm basically interested in the same output as I can get with the
deprecated OrientationSensor. I'm calling
SensorManager.getRotationMatrix() and use this matrix for
SensorManager.getOrientation(). Then, I convert this values from rad
to deg, and still having trouble, because the range of the values
dind't match OrientationSensor. So I make comptutations myself, like
for Azimuth:
orientation[0] >= 0 ? orientation[0]: orientation[0] + 360;
or Pitch:
if (orientation[1] <= -90)
{
orientation[1] += (-2*(90+orientation[1]));
} else if(orientation[1] >= 90){
orientation[1] += (2*(90 - orientation[1]));
}
I can find that kind of computation NOWHERE inside the docs.
I just felt, that I'm done before I saw weird behavior for - what is
called ROLL - inside the Docs. It is the negative of the Orientation-
Roll EXCEPT on a negative Pitch: There the range goes up from -90 - 90
to -180 to 180 without any reason or logical methodology I can figure
out.
HOW the heck I can get the SAME Values from
SensorManager.getOrientation() and the deprecated
ORIENTATION_SENSOR?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en