After a lot of searching and wasted hours, I have been trying to get a stable set of roll, pitch and yaw values from an Android device using the Sensor manager. I have tried a couple of options, SensorManager.getRotationMatrix(... and also SensorManager.getOrientation(...
When I tried to get the roll, pitch and yaw values with getOrientation, the movement was smooth and desirable, however, when I got past the horizon, the rotational direction flipped making it impossible to look up.
I then tried with getRotationMatrix(..., I have mostly implemented this but the motion judders horribly even though I have interpolated the values.
I suspect that the issue with my first test was that the values that come back from getOrientation are the pitch, roll and azimuth? I would like to know if there is a way to get the devices local roll, pitch and yaw values within the closed range of [0...360] for each axis and using a system that doesn't involve gravity fields and magnetic poles.