mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 21:33:33 +08:00
EKF: update get_mag_decl_deg()
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
This commit is contained in:
committed by
Paul Riseborough
parent
2b17ced405
commit
8d6e8ae078
@@ -777,17 +777,14 @@ float Ekf::getMagDeclination()
|
||||
} else if (_params.mag_declination_source & MASK_USE_GEO_DECL) {
|
||||
// use parameter value until GPS is available, then use value returned by geo library
|
||||
if (_NED_origin_initialised) {
|
||||
_mag_declination_to_save_deg = math::degrees(_mag_declination_gps);
|
||||
return _mag_declination_gps;
|
||||
|
||||
} else {
|
||||
_mag_declination_to_save_deg = _params.mag_declination_deg;
|
||||
return math::radians(_params.mag_declination_deg);
|
||||
}
|
||||
|
||||
} else {
|
||||
// always use the parameter value
|
||||
_mag_declination_to_save_deg = _params.mag_declination_deg;
|
||||
return math::radians(_params.mag_declination_deg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user