Navigator: VTOL: disable weather vane during yaw aligning before front transition

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2019-08-21 10:08:04 +02:00
committed by Roman Bapst
parent af0d63250c
commit ab28f1e4f7
5 changed files with 26 additions and 6 deletions
@@ -535,12 +535,14 @@ MulticopterPositionControl::run()
if (_wv_controller != nullptr) {
// in manual mode we just want to use weathervane if position is controlled as well
if (_wv_controller->weathervane_enabled() && (!_control_mode.flag_control_manual_enabled
|| _control_mode.flag_control_position_enabled)) {
_wv_controller->activate();
// in mission, enabling wv is done in flight task
if (_control_mode.flag_control_manual_enabled) {
if (_control_mode.flag_control_position_enabled && _wv_controller->weathervane_enabled()) {
_wv_controller->activate();
} else {
_wv_controller->deactivate();
} else {
_wv_controller->deactivate();
}
}
_wv_controller->update(matrix::Quatf(_att_sp.q_d), _states.yaw);