H
H
hlx2012-01-06 09:49:41
Android
hlx, 2012-01-06 09:49:41

Android + Accelerometer + Direction

Hello. When I receive data from the accelerometer, the value of the tilt angle is always positive, no matter which way I turn the device. Actually the question is: how to determine in which direction the device is tilted?
And another question: all the data from the accelerometer lie in the garnets from 0 to 10. What is this coefficient and how to get the real angle relative to the center of the device?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
H
hlx, 2012-01-06
@hlx

So far, it has only been possible to calculate linear acceleration along a certain axis ( there are examples here ), depending on which you can determine the direction of movement, from where the plane in which the device is located is already.
Based on all the data, you can quite clearly calculate everything, but somehow it's all confused :(

E
EndUser, 2012-01-09
@EndUser

habrahabr.ru/blogs/android_development/131555/

H
hlx, 2012-01-13
@hlx

The angle of inclination, or rather all three Euler angles ( roll , pitch and yaw ), can be obtained using the Orientation sensor . Here is the tutorial .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question