AP_Compass: Use the value of pi

This commit is contained in:
murata 2021-05-23 14:29:01 +09:00 committed by Andrew Tridgell
parent cfaf9f9420
commit 072a321a01

View File

@ -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 ) {