Confused about the terminology when using the orientation sensor in Android -


i've written small app outputs roll, pitch, , azimuth returned device's sensor. however, i'm having difficulty understanding numbers returns.

imagine user holding smartphone in portrait mode screen directly in front of him (the pose using snap photograph). jams pencil through middle of screen , rotates device around pencil. if wanted detect when user rotated 90 degrees around pencil (relative it's starting position), should interested in: roll, pitch, or azimuth?

the answer seem obvious after little experimentation or reading google docs. however, 3 numbers change @ approximately same rate during tests, i'm thoroughly confused.

why not use accelerometer instead?

i think that's better solution you, when want detect rotation of phone.

using accelerometer give result:

when holding phone in example, 1 of x, y or z values either -9.82 or 9.82 depending way hold phone. let's x -9.82, , when rotates value increase until hits 0 , y start increase/decrease depending om rotation. when y either -9.82 or 9.82 you've rotated phone 90 degrees, , if x goes -9.82 9.82 you've rotated 180 degrees.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -