APM: Removed incorrect nav_gain_scaler from nav_roll calculation.

nav_gain_scaler was originally added due to a perceived improvement in
loiter performance, but is incorrect for navigation. Turn rate is a
function of airspeed and bank angle, ground speed has no effect on
that.
This commit is contained in:
Jonathan Challinger 2012-07-16 20:25:55 -07:00 committed by Andrew Tridgell
parent 504809d146
commit 87c78cff5e
1 changed files with 1 additions and 7 deletions

View File

@ -202,17 +202,11 @@ static void calc_nav_pitch()
static void calc_nav_roll()
{
// Adjust gain based on ground speed - We need lower nav gain going in to a headwind, etc.
// This does not make provisions for wind speed in excess of airframe speed
nav_gain_scaler = (float)g_gps->ground_speed / (STANDARD_SPEED * 100.0);
nav_gain_scaler = constrain(nav_gain_scaler, 0.2, 1.4);
// negative error = left turn
// positive error = right turn
// Calculate the required roll of the plane
// ----------------------------------------
nav_roll = g.pidNavRoll.get_pid(bearing_error, nav_gain_scaler); //returns desired bank angle in degrees*100
nav_roll = g.pidNavRoll.get_pid(bearing_error); //returns desired bank angle in degrees*100
nav_roll = constrain(nav_roll, -g.roll_limit.get(), g.roll_limit.get());
Vector3f omega;