1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-30 15:52:12 +01:00

Merged in f5soh/librepilot/LP-569_PosHold_YawControl (pull request #485)

LP-569 Ignore YawControl while using PosHold, AutoTakeOff and AutoCruize

Approved-by: Lalanne Laurent <f5soh@free.fr>
Approved-by: Alessio Morale <alessiomorale@gmail.com>
Approved-by: Philippe Renon <philippe_renon@yahoo.fr>
Approved-by: Paul Jewell <paul@teulu.org>
This commit is contained in:
Lalanne Laurent 2018-03-11 12:22:52 +00:00 committed by Philippe Renon
commit 578e7adb94

View File

@ -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 {