DCM: fixed the sense of the compass GPS test in initial yaw

we were only disabling null offsets when we didn't have a compass,
which doesn't make much sense!
This commit is contained in:
Andrew Tridgell 2012-02-26 22:23:29 +11:00
parent cf749ef29c
commit 5bf138fb38

View File

@ -426,11 +426,11 @@ AP_DCM::drift_correction(void)
// DCM matrix to the current
// roll/pitch values, but with yaw
// from the GPS
if (!_compass) {
if (_compass) {
_compass->null_offsets_disable();
}
rotation_matrix_from_euler(_dcm_matrix, roll, pitch, ToRad(_gps->ground_course));
if (!_compass) {
if (_compass) {
_compass->null_offsets_enable();
}
_have_initial_yaw = true;