mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-19 22:35:19 +03:00
fix2
This commit is contained in:
parent
6dce0e076e
commit
81a4788246
1 changed files with 6 additions and 4 deletions
|
@ -655,24 +655,26 @@ void applyFixedWingNavigationController(navigationFSMStateFlags_t navStateFlags,
|
|||
// 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
|
||||
} else {
|
||||
applyFixedWingAltitudeAndThrottleController(currentTimeUs);
|
||||
}
|
||||
}
|
||||
|
||||
if (navStateFlags & NAV_CTL_POS)
|
||||
if (navStateFlags & NAV_CTL_POS) {
|
||||
applyFixedWingPositionController(currentTimeUs);
|
||||
}
|
||||
|
||||
} else {
|
||||
posControl.rcAdjustment[PITCH] = 0;
|
||||
posControl.rcAdjustment[ROLL] = 0;
|
||||
}
|
||||
|
||||
if (FLIGHT_MODE(NAV_COURSE_HOLD_MODE) && posControl.flags.isAdjustingPosition){
|
||||
if (FLIGHT_MODE(NAV_COURSE_HOLD_MODE) && posControl.flags.isAdjustingPosition) {
|
||||
rcCommand[ROLL] = applyDeadbandRescaled(rcCommand[ROLL], rcControlsConfig()->pos_hold_deadband, -500, 500);
|
||||
}
|
||||
|
||||
//if (navStateFlags & NAV_CTL_YAW)
|
||||
if ((navStateFlags & NAV_CTL_ALT) || (navStateFlags & NAV_CTL_POS)){
|
||||
if ((navStateFlags & NAV_CTL_ALT) || (navStateFlags & NAV_CTL_POS)) {
|
||||
applyFixedWingPitchRollThrottleController(navStateFlags, currentTimeUs);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue