AP_Mount: use M_PI_F instead of (float)M_PI

This commit is contained in:
Andrew Tridgell 2015-05-05 13:44:25 +10:00
parent 84ac721340
commit 730644eaeb
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ void AP_Mount_Servo::stabilize()
// lead filter
const Vector3f &gyro = _frontend._ahrs.get_gyro();
if (_state._stab_roll && !is_zero(_state._roll_stb_lead) && fabsf(_frontend._ahrs.pitch) < (float)M_PI/3.0f) {
if (_state._stab_roll && !is_zero(_state._roll_stb_lead) && fabsf(_frontend._ahrs.pitch) < M_PI_F/3.0f) {
// Compute rate of change of euler roll angle
float roll_rate = gyro.x + (_frontend._ahrs.sin_pitch() / _frontend._ahrs.cos_pitch()) * (gyro.y * _frontend._ahrs.sin_roll() + gyro.z * _frontend._ahrs.cos_roll());
_angle_bf_output_deg.x -= degrees(roll_rate) * _state._roll_stb_lead;