Gyroscopes measure rotation speed, so the gyroscope output will change in yaw per second (e.g. rad / s), rather than absolute yaw. There are various methods for using gyroscopes to βcalculate deadβ orientations, but in practice, while they are very accurate in the short term, integrating gyroscopes to determine orientations βdriftsβ significantly, so you need to continue to calibrate against some absolute measure.
It would be very trivial to use a gyroscope to interpolate between compass readings or to calculate a bearing based on a gyroscope only for short fast movements, while the compass catches up, but the correct merging of the compass and gyroscope is not trivial. There we talk about sensor integration for Android, which could be a good start. The standard method for melting sensors is to use a Kalman filter, here is an introduction here . These are pretty attractive tools, you need a good error model for your sensor, for example.
source share