From 5be3aad67bcd723fb020a308066c8ed1cb196a68 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 17 Dec 2017 18:53:40 +0100 Subject: [PATCH] LP-569 Ignore YawControl while using PosHold, AutoTakeOff and AutoCruize --- flight/modules/PathFollower/vtolflycontroller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flight/modules/PathFollower/vtolflycontroller.cpp b/flight/modules/PathFollower/vtolflycontroller.cpp index bb17b68c0..55944bd87 100644 --- a/flight/modules/PathFollower/vtolflycontroller.cpp +++ b/flight/modules/PathFollower/vtolflycontroller.cpp @@ -274,7 +274,9 @@ int8_t VtolFlyController::UpdateStabilizationDesired(bool yaw_attitude, float ya } #endif // if 0 - if (yaw_attitude) { + // Yaw Attitude will be disabled without velocity requested. + // PositionHold, AutoTakeoff or AutoCruise still using manual Yaw. + if (yaw_attitude && ((fabsf(pathDesired->StartingVelocity) > 0.0f) && (fabsf(pathDesired->EndingVelocity) > 0.0f))) { stabDesired.StabilizationMode.Yaw = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE; stabDesired.Yaw = yaw_direction; } else {