mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-26 20:40:35 +08:00
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:
committed by
Mathieu Bresciani
parent
ba1b7f3a07
commit
ba66f8a1e2
@@ -96,7 +96,8 @@ AngularVelocityController::parameters_updated()
|
||||
_control.setInertiaMatrix(matrix::Matrix3f(inertia));
|
||||
|
||||
// Hover thrust
|
||||
if (!_param_mpc_use_hte.get()) {
|
||||
if (!_param_mpc_use_hte.get()
|
||||
|| !_vehicle_control_mode.flag_armed) {
|
||||
_hover_thrust = _param_mpc_thr_hover.get();
|
||||
}
|
||||
}
|
||||
@@ -149,11 +150,16 @@ AngularVelocityController::Run()
|
||||
}
|
||||
|
||||
// Check for updates of hover thrust
|
||||
if (_param_mpc_use_hte.get()) {
|
||||
if (!_vehicle_control_mode.flag_armed) {
|
||||
_hover_thrust = _param_mpc_thr_hover.get();
|
||||
|
||||
} else if (_param_mpc_use_hte.get()) {
|
||||
hover_thrust_estimate_s hte;
|
||||
|
||||
if (_hover_thrust_estimate_sub.update(&hte)) {
|
||||
_hover_thrust = hte.hover_thrust;
|
||||
if (hte.valid) {
|
||||
_hover_thrust = hte.hover_thrust;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user