Basic doubt about sensor usage

Posted by Al on Stack Overflow See other posts from Stack Overflow or by Al
Published on 2009-07-27T16:11:46Z Indexed on 2010/05/02 2:07 UTC
Read the original article Hit count: 345

Suppose I have a cellphone with accelerometer and magnetometer, and want to determine its absolute (wrt North/East/South/West) 3d position. Imagine the phone is laid vertically, with the screen facing me, the "up" vector pointing to the ceil. Whenever I tilt, the accelerometer allows me to get the "up" vector info change. The problem is that if I tilt the device and put it horizontally (screen now facing ceil, and "up" vector pointing to the opposite of where I am), then the up vector doesn't get updated any more if I rotate the phone horizontally on the table. This is something that clearly is detected by the magnetometer now. So, the question is, when to know where to use acc or mag for each case? Is there a generic way to achieve this?

© Stack Overflow or respective owner

Related posts about accelerometer

Related posts about magnetometer