AP_Math: added fixedwing_turn_rate() helper
This commit is contained in:
parent
b450740fb0
commit
e884e4c5ac
@ -404,3 +404,13 @@ void fill_nanf(float *f, uint16_t count)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
calculate turn rate in deg/sec given a bank angle and airspeed for a
|
||||
fixed wing aircraft
|
||||
*/
|
||||
float fixedwing_turn_rate(float bank_angle_deg, float airspeed)
|
||||
{
|
||||
bank_angle_deg = constrain_float(bank_angle_deg, -80, 80);
|
||||
return degrees(GRAVITY_MSS*tanf(radians(bank_angle_deg))/MAX(airspeed,1));
|
||||
}
|
||||
|
@ -297,3 +297,8 @@ float calc_lowpass_alpha_dt(float dt, float cutoff_freq);
|
||||
void fill_nanf(float *f, uint16_t count);
|
||||
#endif
|
||||
|
||||
/*
|
||||
calculate turn rate in deg/sec given a bank angle and airspeed for a
|
||||
fixed wing aircraft
|
||||
*/
|
||||
float fixedwing_turn_rate(float bank_angle_deg, float airspeed);
|
||||
|
Loading…
Reference in New Issue
Block a user