mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-19 06:15:14 +03:00
Update navigation_fixedwing.c
This commit is contained in:
parent
99b03c70be
commit
1d292b1925
1 changed files with 6 additions and 7 deletions
|
@ -755,14 +755,13 @@ void applyFixedWingEmergencyLandingController(timeUs_t currentTimeUs)
|
|||
rcCommand[PITCH] = pidAngleToRcCommand(failsafeConfig()->failsafe_fw_pitch_angle, pidProfile()->max_angle_inclination[FD_PITCH]);
|
||||
}
|
||||
|
||||
// Hold position of possible
|
||||
if (posControl.flags.estPosStatus >= EST_USABLE) {
|
||||
if (posControl.flags.estPosStatus >= EST_USABLE) { // Hold position if possible
|
||||
applyFixedWingPositionController(currentTimeUs);
|
||||
if (isRollAdjustmentValid) {
|
||||
// ROLL >0 right, <0 left
|
||||
int16_t rollCorrection = constrain(posControl.rcAdjustment[ROLL], -DEGREES_TO_DECIDEGREES(navConfig()->fw.max_bank_angle), DEGREES_TO_DECIDEGREES(navConfig()->fw.max_bank_angle));
|
||||
rcCommand[ROLL] = pidAngleToRcCommand(rollCorrection, pidProfile()->max_angle_inclination[FD_ROLL]);
|
||||
}
|
||||
int16_t rollCorrection = constrain(posControl.rcAdjustment[ROLL],
|
||||
-DEGREES_TO_DECIDEGREES(navConfig()->fw.max_bank_angle),
|
||||
DEGREES_TO_DECIDEGREES(navConfig()->fw.max_bank_angle));
|
||||
rcCommand[ROLL] = pidAngleToRcCommand(rollCorrection, pidProfile()->max_angle_inclination[FD_ROLL]);
|
||||
rcCommand[YAW] = 0;
|
||||
} else {
|
||||
rcCommand[ROLL] = pidAngleToRcCommand(failsafeConfig()->failsafe_fw_roll_angle, pidProfile()->max_angle_inclination[FD_ROLL]);
|
||||
rcCommand[YAW] = -pidRateToRcCommand(failsafeConfig()->failsafe_fw_yaw_rate, currentControlRateProfile->stabilized.rates[FD_YAW]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue