|
|
|
@ -22,10 +22,10 @@ static float get_speed_scaler(void)
@@ -22,10 +22,10 @@ static float get_speed_scaler(void)
|
|
|
|
|
speed_scaler = constrain_float(speed_scaler, 0.5, 2.0); |
|
|
|
|
} else { |
|
|
|
|
if (channel_throttle->servo_out > 0) { |
|
|
|
|
speed_scaler = 0.5 + ((float)THROTTLE_CRUISE / channel_throttle->servo_out / 2.0); // First order taylor expansion of square root |
|
|
|
|
speed_scaler = 0.5f + ((float)THROTTLE_CRUISE / channel_throttle->servo_out / 2.0f); // First order taylor expansion of square root |
|
|
|
|
// Should maybe be to the 2/7 power, but we aren't goint to implement that... |
|
|
|
|
}else{ |
|
|
|
|
speed_scaler = 1.67; |
|
|
|
|
speed_scaler = 1.67f; |
|
|
|
|
} |
|
|
|
|
// This case is constrained tighter as we don't have real speed info |
|
|
|
|
speed_scaler = constrain_float(speed_scaler, 0.6, 1.67); |
|
|
|
|