mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-19 06:15:14 +03:00
NAV: More consistent detection of good GPS on arming. BEEPER_ARMING_GPS_FIX will be triggered based on position estimation status, not satellite count
This commit is contained in:
parent
e5726c3c35
commit
2131daf42e
3 changed files with 10 additions and 3 deletions
|
@ -2109,6 +2109,12 @@ bool naivationBlockArming(void)
|
|||
return shouldBlockArming;
|
||||
}
|
||||
|
||||
|
||||
bool navigationPositionEstimateIsHealthy(void)
|
||||
{
|
||||
return posControl.flags.hasValidPositionSensor && STATE(GPS_FIX_HOME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate ready/not ready status
|
||||
*/
|
||||
|
@ -2117,7 +2123,7 @@ static void updateReadyStatus(void)
|
|||
static bool posReadyBeepDone = false;
|
||||
|
||||
/* Beep out READY_BEEP once when position lock is firstly acquired and HOME set */
|
||||
if (posControl.flags.hasValidPositionSensor && STATE(GPS_FIX_HOME) && !posReadyBeepDone) {
|
||||
if (navigationPositionEstimateIsHealthy() && !posReadyBeepDone) {
|
||||
beeper(BEEPER_READY_BEEP);
|
||||
posReadyBeepDone = true;
|
||||
}
|
||||
|
|
|
@ -241,6 +241,7 @@ bool naivationRequiresAngleMode(void);
|
|||
bool navigationRequiresThrottleTiltCompensation(void);
|
||||
int8_t naivationGetHeadingControlState(void);
|
||||
bool naivationBlockArming(void);
|
||||
bool navigationPositionEstimateIsHealthy(void);
|
||||
|
||||
/* Access to estimated position and velocity */
|
||||
float getEstimatedActualVelocity(int axis);
|
||||
|
|
|
@ -260,8 +260,8 @@ void mwArm(void)
|
|||
disarmAt = millis() + masterConfig.auto_disarm_delay * 1000; // start disarm timeout, will be extended when throttle is nonzero
|
||||
|
||||
//beep to indicate arming
|
||||
#ifdef GPS
|
||||
if (feature(FEATURE_GPS) && STATE(GPS_FIX) && gpsSol.numSat >= 5)
|
||||
#ifdef NAV
|
||||
if (navigationPositionEstimateIsHealthy())
|
||||
beeper(BEEPER_ARMING_GPS_FIX);
|
||||
else
|
||||
beeper(BEEPER_ARMING);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue