reset hover thrust value in controllers when disarmed

During landing, hover thrust value can be very incorrect so it should be
reset before taking off
This commit is contained in:
Nicolas Martin
2021-10-01 14:24:56 +02:00
committed by Mathieu Bresciani
parent ba1b7f3a07
commit ba66f8a1e2
2 changed files with 11 additions and 3 deletions
@@ -394,6 +394,8 @@ void MulticopterPositionControl::Run()
// make sure takeoff ramp is not amended by acceleration feed-forward
if (!flying) {
_setpoint.acceleration[2] = NAN;
// hover_thrust maybe reset on takeoff
_control.setHoverThrust(_param_mpc_thr_hover.get());
}
const bool not_taken_off = (_takeoff.getTakeoffState() < TakeoffState::rampup);