I'm afraid it's not mathematically possible to generate a full
attitude solution from a single vector observation (mag vector,
gravity vector, etc..). There simply isn't enough information there.
It doesn't matter if you're not pointed along the mag field, you will
still only get a partial attitude solution in the shape of a cone
centered around the mag field. This has been an issue in the aerospace
industry for a while now, and usually the problem is solved by
combining information from two or more sensors. In this case, the
Android API is probably using the mag field and what it assumes is a
gravity vector from the accelerometer (that's why the solution is
affected by external accelerations).

If you're interested in how to generate an attitude solution from two
vector observations, you should look up the TRIAD algorithm for
attitude determination.

Cheers,
Scott


On Oct 12, 4:25 am, DD <[email protected]> wrote:
> Hi, is it possible to calculate yaw,pitch,roll solely from x,y,z
> magnetic field values obtained from the magnetometer, for example,
> according to physics? How? Thanks a lot!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to