Skip to content
Snippets Groups Projects
Commit 5f5c884a authored by Andrew Tridgell's avatar Andrew Tridgell
Browse files

AHRS: if we don't have gps correction enabled, zero the yaw correction

parent 6067170f
No related branches found
No related tags found
No related merge requests found
......@@ -489,9 +489,13 @@ AP_AHRS_DCM::drift_correction(float deltat)
// to reduce the impact of two competing yaw controllers, we
// reduce the impact of the gps/accelerometers on yaw when we are
// flat, but still allow for yaw correction using the
// accelerometers at high roll angles.
// accelerometers at high roll angles as long as we have a GPS
if (_compass && _compass->use_for_yaw()) {
error.z *= sin(fabs(roll));
if (_gps && _gps->status() == GPS::GPS_OK && gps_gain == 1.0) {
error.z *= sin(fabs(roll));
} else {
error.z = 0;
}
}
// convert the error term to body frame
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment