AP_AHRS: fixed wrapping bug in GPS based heading error
this bug could cause the GPS based yaw to use an expensive reset far too often
This commit is contained in:
parent
1c9dfb9b8a
commit
820ec465c7
@ -367,7 +367,7 @@ AP_AHRS_DCM::drift_correction_yaw(void)
|
||||
_gps_last_update = _gps->last_fix_time;
|
||||
new_value = true;
|
||||
float gps_course_rad = ToRad(_gps->ground_course_cd * 0.01f);
|
||||
float yaw_error_rad = gps_course_rad - yaw;
|
||||
float yaw_error_rad = wrap_PI(gps_course_rad - yaw);
|
||||
yaw_error = sinf(yaw_error_rad);
|
||||
|
||||
/* reset yaw to match GPS heading under any of the
|
||||
|
Loading…
Reference in New Issue
Block a user