From 680fe86c0535ede9fe7bcb0cebfdf6c94a355e8e Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Fri, 22 Apr 2022 19:05:08 +0200 Subject: [PATCH] FlightTaskAuto: fix Weather Vane during landing Weather vane should only set a yawrate setpoint, but no yaw setpoint. Setting it to NAN when WV is active makes sure that whatever _yaw_setpoint is set previously (e.g. through Waypoint) is not used. Signed-off-by: Silvan Fuhrer --- src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp b/src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp index 78af0ade60..96fe3483a7 100644 --- a/src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp +++ b/src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp @@ -483,7 +483,7 @@ bool FlightTaskAuto::_evaluateTriplets() // set heading if (_ext_yaw_handler != nullptr && _ext_yaw_handler->is_active()) { - _yaw_setpoint = _yaw; + _yaw_setpoint = NAN; // use the yawrate setpoint from WV only if not moving lateral (velocity setpoint below half of _param_mpc_xy_cruise) // otherwise, keep heading constant (as output from WV is not according to wind in this case) bool vehicle_is_moving_lateral = _velocity_setpoint.xy().longerThan(_param_mpc_xy_cruise.get() / 2.0f);