mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-17 21:35:37 +03:00
Add the AT_LEAST_LINEAR_DESCENT RTH altitude mode (#4188)
This commit is contained in:
parent
5ba4e5b674
commit
644259f936
9 changed files with 105 additions and 66 deletions
|
@ -432,6 +432,11 @@ int16_t applyFixedWingMinSpeedController(timeUs_t currentTimeUs)
|
|||
return throttleSpeedAdjustment;
|
||||
}
|
||||
|
||||
int16_t fixedWingPitchToThrottleCorrection(int16_t pitch)
|
||||
{
|
||||
return DECIDEGREES_TO_DEGREES(pitch) * navConfig()->fw.pitch_to_throttle;
|
||||
}
|
||||
|
||||
void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStateFlags, timeUs_t currentTimeUs)
|
||||
{
|
||||
int16_t minThrottleCorrection = navConfig()->fw.min_throttle - navConfig()->fw.cruise_throttle;
|
||||
|
@ -447,7 +452,7 @@ void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStat
|
|||
// PITCH >0 dive, <0 climb
|
||||
int16_t pitchCorrection = constrain(posControl.rcAdjustment[PITCH], -DEGREES_TO_DECIDEGREES(navConfig()->fw.max_dive_angle), DEGREES_TO_DECIDEGREES(navConfig()->fw.max_climb_angle));
|
||||
rcCommand[PITCH] = -pidAngleToRcCommand(pitchCorrection, pidProfile()->max_angle_inclination[FD_PITCH]);
|
||||
int16_t throttleCorrection = DECIDEGREES_TO_DEGREES(pitchCorrection) * navConfig()->fw.pitch_to_throttle;
|
||||
int16_t throttleCorrection = fixedWingPitchToThrottleCorrection(pitchCorrection);
|
||||
|
||||
#ifdef NAV_FIXED_WING_LANDING
|
||||
if (navStateFlags & NAV_CTL_LAND) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue