Browse Source

AP_Compass: fixed last_update for secondary compass with primary failed

this ensures EKF and DCM will use a secondary compass if the primary
fails
mission-4.1.18
Andrew Tridgell 11 years ago
parent
commit
485ae596fc
  1. 4
      libraries/AP_Compass/AP_Compass_PX4.cpp

4
libraries/AP_Compass/AP_Compass_PX4.cpp

@ -129,9 +129,9 @@ bool AP_Compass_PX4::read(void) @@ -129,9 +129,9 @@ bool AP_Compass_PX4::read(void)
_count[i] = 0;
}
last_update = _last_timestamp[0];
last_update = _last_timestamp[_get_primary()];
return _healthy[0];
return _healthy[_get_primary()];
}
void AP_Compass_PX4::accumulate(void)

Loading…
Cancel
Save