EKF mag_fusion avoid unnecessary double promotion

This commit is contained in:
Daniel Agar 2019-02-07 22:54:45 -05:00
parent 54ab8191e3
commit 1378ec1797
1 changed files with 1 additions and 1 deletions

View File

@ -973,7 +973,7 @@ void Ekf::limitDeclination()
const float decl_tolerance = 0.5f;
const float decl_max = decl_reference + decl_tolerance;
const float decl_min = decl_reference - decl_tolerance;
const float decl_estimate = atan2(_state.mag_I(1) , _state.mag_I(0));
const float decl_estimate = atan2f(_state.mag_I(1) , _state.mag_I(0));
if (decl_estimate > decl_max) {
_state.mag_I(0) = h_field * cosf(decl_max);
_state.mag_I(1) = h_field * sinf(decl_max);