I was about to ask the same question, so I'll share what _I_ think, and hope someone chips in to tell me if I'm wrong.
1 - the compass gives you absolute orientation of your UAV compared to the magnetic north pole - currently somewhere north of Siberia
2 - it's a good secondary way to measure (and therefore correct for) yaw - integrating the gyro Z axis to get yaw is good for a while, but it will drift, whereas the position of the magnetic north pole, and therefore the magnetometer does not - well not during the length of a flight / float / drive.
3 There are 3 fixed-position orthogonal sensors in the magnetometer. Combining these will produce a direction vector of the north pole compared to your UAV. This allows you to track a course in an absolute direction (e.g. north) instead of a relative direction (e.g. forward).
For example, if you set a quadcopter on the ground and measure the magnetormeter vector, then during flight, any change in the direction of that vector shows your quad is no longer heading in the direction it was pointing at launch.
I _think_ though you need to be careful of the absolute value of the vector as well as the direction; if the value changes from a "normal" value, that suggests a large lump of iron nearby (like a car) is distorting the earth's magnetic field locally - therefore you can't rely on the compass alone - you must use the combination of the short-term trustworthy yaw readings with the long-term trust-worthy readings of the compass. The trustworthy period of the compass depends on whether you're in a big-city or the sahara desert.
Replies
I was about to ask the same question, so I'll share what _I_ think, and hope someone chips in to tell me if I'm wrong.
1 - the compass gives you absolute orientation of your UAV compared to the magnetic north pole - currently somewhere north of Siberia
2 - it's a good secondary way to measure (and therefore correct for) yaw - integrating the gyro Z axis to get yaw is good for a while, but it will drift, whereas the position of the magnetic north pole, and therefore the magnetometer does not - well not during the length of a flight / float / drive.
3 There are 3 fixed-position orthogonal sensors in the magnetometer. Combining these will produce a direction vector of the north pole compared to your UAV. This allows you to track a course in an absolute direction (e.g. north) instead of a relative direction (e.g. forward).
For example, if you set a quadcopter on the ground and measure the magnetormeter vector, then during flight, any change in the direction of that vector shows your quad is no longer heading in the direction it was pointing at launch.
I _think_ though you need to be careful of the absolute value of the vector as well as the direction; if the value changes from a "normal" value, that suggests a large lump of iron nearby (like a car) is distorting the earth's magnetic field locally - therefore you can't rely on the compass alone - you must use the combination of the short-term trustworthy yaw readings with the long-term trust-worthy readings of the compass. The trustworthy period of the compass depends on whether you're in a big-city or the sahara desert.