mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-17 13:25:27 +03:00
Disable ALTHOLD on user motor stop request
This commit is contained in:
parent
99f7b1daf2
commit
f046554d97
4 changed files with 40 additions and 24 deletions
|
@ -527,23 +527,25 @@ void applyFixedWingNavigationController(navigationFSMStateFlags_t navStateFlags,
|
|||
#ifdef NAV_FW_LIMIT_MIN_FLY_VELOCITY
|
||||
// Don't apply anything if ground speed is too low (<3m/s)
|
||||
if (posControl.actualState.velXY > 300) {
|
||||
if (navStateFlags & NAV_CTL_ALT)
|
||||
applyFixedWingAltitudeAndThrottleController(currentTimeUs);
|
||||
#else
|
||||
if (true) {
|
||||
#endif
|
||||
if (navStateFlags & NAV_CTL_ALT) {
|
||||
if (getMotorStatus() == MOTOR_STOPPED_USER) {
|
||||
// Motor has been stopped by user. Update target altitude and bypass navigation pitch/throttle control
|
||||
resetFixedWingAltitudeController();
|
||||
setDesiredPosition(&navGetCurrentActualPositionAndVelocity()->pos, posControl.actualState.yaw, NAV_POS_UPDATE_Z);
|
||||
} else
|
||||
applyFixedWingAltitudeAndThrottleController(currentTimeUs);
|
||||
}
|
||||
|
||||
if (navStateFlags & NAV_CTL_POS)
|
||||
applyFixedWingPositionController(currentTimeUs);
|
||||
}
|
||||
else {
|
||||
|
||||
} else {
|
||||
posControl.rcAdjustment[PITCH] = 0;
|
||||
posControl.rcAdjustment[ROLL] = 0;
|
||||
}
|
||||
#else
|
||||
if (navStateFlags & NAV_CTL_ALT)
|
||||
applyFixedWingAltitudeAndThrottleController(currentTimeUs);
|
||||
|
||||
if (navStateFlags & NAV_CTL_POS)
|
||||
applyFixedWingPositionController(currentTimeUs);
|
||||
#endif
|
||||
|
||||
//if (navStateFlags & NAV_CTL_YAW)
|
||||
if ((navStateFlags & NAV_CTL_ALT) || (navStateFlags & NAV_CTL_POS))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue