mirror of https://github.com/ArduPilot/ardupilot
AHRS: only use GPS for yaw when compass is not being used
this avoids having two competing controllers
This commit is contained in:
parent
6653c0b874
commit
9d7ed30023
|
@ -461,7 +461,15 @@ AP_AHRS_DCM::drift_correction(float deltat)
|
||||||
|
|
||||||
// step 6
|
// step 6
|
||||||
error = GA_b % GA_e2;
|
error = GA_b % GA_e2;
|
||||||
|
|
||||||
|
// only use the gps/accelerometers for earth frame yaw correction
|
||||||
|
// if we are not using a compass. Otherwise we have two competing
|
||||||
|
// controllers for yaw correction
|
||||||
|
if (_compass && _compass->use_for_yaw()) {
|
||||||
|
error.z = 0;
|
||||||
|
} else {
|
||||||
error.z = earth_error_Z;
|
error.z = earth_error_Z;
|
||||||
|
}
|
||||||
|
|
||||||
// convert the error term to body frame
|
// convert the error term to body frame
|
||||||
error = _dcm_matrix.mul_transpose(error);
|
error = _dcm_matrix.mul_transpose(error);
|
||||||
|
|
Loading…
Reference in New Issue