Copter: use M_PI_F instead of (float)M_PI
This commit is contained in:
parent
f9114f849b
commit
b88c12ad1f
@ -701,7 +701,7 @@ static bool verify_circle(const AP_Mission::Mission_Command& cmd)
|
||||
}
|
||||
|
||||
// check if we have completed circling
|
||||
return fabsf(circle_nav.get_angle_total()/(float)(2*M_PI)) >= LOWBYTE(cmd.p1);
|
||||
return fabsf(circle_nav.get_angle_total()/(2*M_PI_F)) >= LOWBYTE(cmd.p1);
|
||||
}
|
||||
|
||||
// externs to remove compiler warning
|
||||
|
@ -641,8 +641,8 @@ static void poshold_get_wind_comp_lean_angles(int16_t &roll_angle, int16_t &pitc
|
||||
poshold.wind_comp_timer = 0;
|
||||
|
||||
// convert earth frame desired accelerations to body frame roll and pitch lean angles
|
||||
roll_angle = (float)fast_atan((-poshold.wind_comp_ef.x*ahrs.sin_yaw() + poshold.wind_comp_ef.y*ahrs.cos_yaw())/981)*(18000/(float)M_PI);
|
||||
pitch_angle = (float)fast_atan(-(poshold.wind_comp_ef.x*ahrs.cos_yaw() + poshold.wind_comp_ef.y*ahrs.sin_yaw())/981)*(18000/(float)M_PI);
|
||||
roll_angle = (float)fast_atan((-poshold.wind_comp_ef.x*ahrs.sin_yaw() + poshold.wind_comp_ef.y*ahrs.cos_yaw())/981)*(18000/M_PI_F);
|
||||
pitch_angle = (float)fast_atan(-(poshold.wind_comp_ef.x*ahrs.cos_yaw() + poshold.wind_comp_ef.y*ahrs.sin_yaw())/981)*(18000/M_PI_F);
|
||||
}
|
||||
|
||||
// poshold_roll_controller_to_pilot_override - initialises transition from a controller submode (brake or loiter) to a pilot override on roll axis
|
||||
|
Loading…
Reference in New Issue
Block a user