AP_Compass: Use the value of pi
This commit is contained in:
parent
cfaf9f9420
commit
072a321a01
@ -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…
Reference in New Issue
Block a user