mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-24 00:35:34 +03:00
FW: Remove limitation of minimum ground speed for navigation
This commit is contained in:
parent
8860c9034b
commit
c801ce80fa
1 changed files with 10 additions and 0 deletions
|
@ -385,12 +385,15 @@ void resetFixedWingHeadingController(void)
|
|||
magHold = CENTIDEGREES_TO_DEGREES(posControl.actualState.yaw);
|
||||
}
|
||||
|
||||
//#define NAV_FW_LIMIT_MIN_FLY_VELOCITY
|
||||
|
||||
void applyFixedWingNavigationController(navigationFSMStateFlags_t navStateFlags, uint32_t currentTime)
|
||||
{
|
||||
if (navStateFlags & NAV_CTL_EMERG) {
|
||||
applyFixedWingEmergencyLandingController();
|
||||
}
|
||||
else {
|
||||
#ifdef NAV_FW_LIMIT_MIN_FLY_VELOCITY
|
||||
// Don't apply anything if ground speed is too low (<3m/s)
|
||||
float forwardVelocitySquared = sq(posControl.actualState.vel.V.X) + sq(posControl.actualState.vel.V.Y);
|
||||
if (forwardVelocitySquared > (300 * 300)) {
|
||||
|
@ -405,6 +408,13 @@ void applyFixedWingNavigationController(navigationFSMStateFlags_t navStateFlags,
|
|||
posControl.rcAdjustment[ROLL] = 0;
|
||||
posControl.rcAdjustment[THROTTLE] = 0;
|
||||
}
|
||||
#else
|
||||
if (navStateFlags & NAV_CTL_ALT)
|
||||
applyFixedWingAltitudeController(currentTime);
|
||||
|
||||
if (navStateFlags & NAV_CTL_POS)
|
||||
applyFixedWingPositionController(currentTime);
|
||||
#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