Browse Source

AP_Compass: Use the value of pi

zr-v5.1
murata 4 years ago committed by Andrew Tridgell
parent
commit
072a321a01
  1. 2
      libraries/AP_Compass/AP_Compass.cpp

2
libraries/AP_Compass/AP_Compass.cpp

@ -1769,7 +1769,7 @@ Compass::calculate_heading(const Matrix3f &dcm_matrix, uint8_t i) const @@ -1769,7 +1769,7 @@ Compass::calculate_heading(const Matrix3f &dcm_matrix, uint8_t i) const
// magnetic heading
// 6/4/11 - added constrain to keep bad values from ruining DCM Yaw - Jason S.
float heading = constrain_float(atan2f(-headY,headX), -3.15f, 3.15f);
float heading = constrain_float(atan2f(-headY,headX), -M_PI, M_PI);
// Declination correction (if supplied)
if ( fabsf(_declination) > 0.0f ) {

Loading…
Cancel
Save