Rover: remove SPEED_TURN_GAIN

Loiter was the only mode using this, replaced with hardcoded gain.  The desired speed in Loiter also uses a hardcoded gain so this should work
This commit is contained in:
Randy Mackay 2018-06-05 12:33:13 +09:00
parent ccb1042074
commit c8f4227313
3 changed files with 3 additions and 13 deletions

View File

@ -100,15 +100,6 @@ const AP_Param::Info Rover::var_info[] = {
// @User: Standard
GSCALAR(speed_cruise, "CRUISE_SPEED", CRUISE_SPEED),
// @Param: SPEED_TURN_GAIN
// @DisplayName: Target speed reduction while turning
// @Description: The percentage to reduce the throttle to while turning. If this is 100% then the target speed is not reduced while turning. If this is 50% then the target speed is reduced in proportion to the turn rate, with a reduction of 50% when the steering is maximally deflected.
// @Units: %
// @Range: 0 100
// @Increment: 1
// @User: Standard
GSCALAR(speed_turn_gain, "SPEED_TURN_GAIN", 50),
// @Param: PIVOT_TURN_ANGLE
// @DisplayName: Pivot turn angle
// @Description: Navigation angle threshold in degrees to switch to pivot steering when SKID_STEER_OUT is 1. This allows you to setup a skid steering rover to turn on the spot in auto mode when the angle it needs to turn it greater than this angle. An angle of zero means to disable pivot turning. Note that you will probably also want to set a low value for WP_RADIUS to get neat turns.

View File

@ -102,7 +102,7 @@ public:
k_param_crosstrack_gain = 150, // unused
k_param_crosstrack_entry_angle, // unused
k_param_speed_cruise,
k_param_speed_turn_gain,
k_param_speed_turn_gain, // unused
k_param_speed_turn_dist, // unused
k_param_ch7_option,
k_param_auto_trigger_pin,
@ -225,7 +225,6 @@ public:
// navigation parameters
//
AP_Float speed_cruise;
AP_Int8 speed_turn_gain;
AP_Int8 ch7_option;
AP_Int8 auto_trigger_pin;
AP_Float auto_kickstart;

View File

@ -43,8 +43,8 @@ void ModeLoiter::update()
}
// reduce desired speed if yaw_error is large
// note: copied from calc_reduced_speed_for_turn_or_distance
float yaw_error_ratio = 1.0f - constrain_float(fabsf(_yaw_error_cd / 9000.0f), 0.0f, 1.0f) * ((100.0f - g.speed_turn_gain) * 0.01f);
// 45deg of error reduces speed to 75%, 90deg of error reduces speed to 50%
float yaw_error_ratio = 1.0f - constrain_float(fabsf(_yaw_error_cd / 9000.0f), 0.0f, 1.0f) * 0.5f;
_desired_speed *= yaw_error_ratio;
}