언어 설정

Menu
Sites
Language
How to caculate roll, pitch, yaw angle of screen from accelerometer data?

I've got accelerometer data and I want to identify the rotation angles of the screen.

Assuming when I put the phone at horizontal plane with screen up, the angles for roll, pitch, yaw are all zero degree.

At this time, the accelerometer value should be X=0 m/s^2, Y=0 m/s^2, Z= 9.8 m/s^2.

If I adjust the phone screen to arbitrary angle as below picture shows, how to caculate the roll, pitch and yaw angles from the accelerometer value at that place?

Responses

3 댓글
Alex Dem

Hi,
I have found only this :
https://developer.tizen.org/development/guides/native-application/system/sensor
Alexey.

colin Rao

seems it's similar with the sample project "Sensor". File -> New Tizen Native Project > Sample > Sensor

Jean Yang

I tried to do this thing:

Known the three compent of G, that is, X, Y, Z, to caculate the roll, pitch, yaw of the screen compare to the original position when the screen is put horizental.

To analyze this problem, I draw below graphic:

I found it's a difficult caculation although we can do this by set up the quaternion equation for the rotation of the screen.

In fact, I do not really need to get the accurate rotation of the screen because I just want to use the accelerometer to adjust the perspective of the viewing from the screen, so to do such a difficult caculation is not worth. And more, the accelerometer is not so accurate, the error from the output data of the Z1 accelerometer seems so big that it will impact on the caculation result so much.

So I give up to do such caculation. And I just need to notice the 2D values, values of X and Y is enough for my applicaiton to adjust the viewing perspective.

Forget this quesiton, it's only a geometric caculation. Not worth any one more to reply on it. Thanks!