Skip to content

Commit 578e7ad

Browse files
f5sohfilnet
authored andcommitted
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>
2 parents 4c9c3c2 + 5be3aad commit 578e7ad

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

flight/modules/PathFollower/vtolflycontroller.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ int8_t VtolFlyController::UpdateStabilizationDesired(bool yaw_attitude, float ya
274274
}
275275
#endif // if 0
276276

277-
if (yaw_attitude) {
277+
// Yaw Attitude will be disabled without velocity requested.
278+
// PositionHold, AutoTakeoff or AutoCruise still using manual Yaw.
279+
if (yaw_attitude && ((fabsf(pathDesired->StartingVelocity) > 0.0f) && (fabsf(pathDesired->EndingVelocity) > 0.0f))) {
278280
stabDesired.StabilizationMode.Yaw = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
279281
stabDesired.Yaw = yaw_direction;
280282
} else {

0 commit comments

Comments
 (0)