Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plane: restore thr_min behavior #11059

Merged
merged 1 commit into from Apr 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ArduPlane/Parameters.cpp
Expand Up @@ -401,7 +401,7 @@ const AP_Param::Info Plane::var_info[] = {

// @Param: THR_MIN
// @DisplayName: Minimum Throttle
// @Description: Minimum throttle percentage used in automatic throttle modes. Negative values allow reverse thrust if hardware supports it.
// @Description: Minimum throttle percentage used in all modes except manual, provided THR_PASS_STAB is not set. Negative values allow reverse thrust if hardware supports it.
// @Units: %
// @Range: -100 100
// @Increment: 1
Expand Down
12 changes: 7 additions & 5 deletions ArduPlane/servos.cpp
Expand Up @@ -442,9 +442,10 @@ void Plane::set_servos_controlled(void)
} else if (g.throttle_passthru_stabilize) {
// manual pass through of throttle while in FBWA or
// STABILIZE mode with THR_PASS_STAB set
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, channel_throttle->get_control_in_zero_dz());
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, get_throttle_input(true));
IamPete1 marked this conversation as resolved.
Show resolved Hide resolved
} else {
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, channel_throttle->get_control_in());
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle,
constrain_int16(get_throttle_input(true), min_throttle, max_throttle));
}
} else if ((control_mode == &mode_guided || control_mode == &mode_avoidADSB) &&
guided_throttle_passthru) {
Expand Down Expand Up @@ -749,9 +750,10 @@ void Plane::set_servos(void)

case AP_Arming::Required::YES_MIN_PWM:
default:
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, 0);
SRV_Channels::set_output_scaled(SRV_Channel::k_throttleLeft, 0);
SRV_Channels::set_output_scaled(SRV_Channel::k_throttleRight, 0);
int8_t min_throttle = MAX(aparm.throttle_min.get(),0);
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, min_throttle);
SRV_Channels::set_output_scaled(SRV_Channel::k_throttleLeft, min_throttle);
SRV_Channels::set_output_scaled(SRV_Channel::k_throttleRight, min_throttle);
break;
}
}
Expand Down