-
Notifications
You must be signed in to change notification settings - Fork 14.2k
EKF2: Aux Globlal Pos (AGP) reset mode #25223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This allows the pilot to override position esitmates manually
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 256 byte (0.01 %)]
px4_fmu-v6x [Total VM Diff: 256 byte (0.01 %)]
Updated: 2025-07-15T12:02:30 |
enum class Mode : uint8_t { | ||
AUTO = 0, ///< Reset on fusion timeout if no other source of position is available | ||
DEAD_RECKONING = 1 ///< Reset on fusion timeout if no source of velocity is availabl | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -335,9 +335,11 @@ bool Ekf::resetGlobalPosToExternalObservation(const double latitude, const doubl | |||
|
|||
const bool innov_rejected = (test_ratio > 1.f); | |||
|
|||
if (!_control_status.flags.in_air || (eph > 0.f && eph < 1.f) || innov_rejected) { | |||
// when on ground or accuracy chosen to be very low, we hard reset position | |||
if (!_control_status.flags.in_air || (eph > 0.f && eph < 1.f) || innov_rejected || isHorizontalPositionAidingActive()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to trigger a hard reset when we have horizontal position aiding?
I see that we already had _!ekf.control_status_flags().gnss_pos as a condition and I understand the intent. One wants to quickly reset to the correct position so that AGP/EV don’t remain stuck, but wouldn’t it still be preferable to perform a fusion-based reset when the variance / test-ratio allows it?
Solved Problem
The EKF performs statistical consistency checks using normalized innovation tests. However, when the AGP measurement starts to fail a test, we directly reset to the measurement after a timeout period.
Solution
Add a "reset mode" parameter that tells the EKF whether it should always try to reset to the AGP position measurement when the statistical check fails or if the EKF is allowed to continue using solely velocity measurements.
New parameter:
EKF2_AGP_MODE
Additionally, the
VEHICLE_CMD_EXTERNAL_POSITION_ESTIMATE
is no longer filtered by the EKF2 front end. The command is sent and executed by the EKF as any other measurement. This allows the user to override the current position estimate.Changelog Entry
For release notes:
Test coverage
tested in SIH with simulated AGP failures