compass: set the orientation of compass before compass.init()

the compass.init() code uses the orientation when calculating the
calibration. We need to use the right orientation.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@3071 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
tridge60@gmail.com 2011-08-10 12:52:53 +00:00
parent 7d58916a9d
commit 6ca3a2b359

View File

@ -453,9 +453,9 @@ static void resetPerfData(void) {
static void static void
init_compass() init_compass()
{ {
compass.set_orientation(MAG_ORIENTATION); // set compass's orientation on aircraft
dcm.set_compass(&compass); dcm.set_compass(&compass);
bool junkbool = compass.init(); bool junkbool = compass.init();
compass.set_orientation(MAG_ORIENTATION); // set compass's orientation on aircraft
Vector3f junkvector = compass.get_offsets(); // load offsets to account for airframe magnetic interference Vector3f junkvector = compass.get_offsets(); // load offsets to account for airframe magnetic interference
} }