these allow you to control if the compass should be used for yaw and
if it should learn its offsets. This is useful for locking in compass
offsets once they are confirmed to be good, and for learning offsets
without using them in flights.
The default is to behave the same as previously, which is
COMPASS_LEARN=1 and COMPASS_USE=1
this changes the calibration code to require at least 5 good reads
from the compass during initialisation. The calibration is taken as
the average of the 5 values.
This also fixes the expected values for the 3 axes for the 5883 to
match reality.
We also save a bit of code space by adding a common rotate_for_5883L()
routine.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@3087 f9c3cf11-9bcb-44bc-f272-b75c42450872
this adds a 50ms delay after setting the compass gains before reading
the compass. Added as paranoia after some strange results on a 5843
git-svn-id: https://arducopter.googlecode.com/svn/trunk@3070 f9c3cf11-9bcb-44bc-f272-b75c42450872
we were looking for the wrong regA value
Thanks to Chris for the debugging help! (and happy birthday!)
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2828 f9c3cf11-9bcb-44bc-f272-b75c42450872
this adds error checking to all operations on the compass, to ensure
that we don't accept invalid data
This also fixes the calibration values for the 5883L to match the
recommended values in the spec
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2815 f9c3cf11-9bcb-44bc-f272-b75c42450872
this fixes a compass initialisation bug where if the first value from
the compass isn't in the right range we would set bad calibration
scaling factors.
This also changes the maximum acceptable calibration values to 2000,
which is needed for the 5883 compass
pair-programmed-with: Randy Mackay
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2718 f9c3cf11-9bcb-44bc-f272-b75c42450872
Most of the compass functionality is now abstracted in a base class, with the various sub-classes implementing just their unique functionality.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1647 f9c3cf11-9bcb-44bc-f272-b75c42450872