Skip to content

Conversation

bresch
Copy link
Member

@bresch bresch commented May 23, 2025

requires #24908

Solved Problem

Thresholds of GNSS checks are supposed to be tight enough to make sure the drone starts with a good initial fix. However, currently, degradation of a single metric also stops the fusion (e.g.: high DOP) when other metrics are still good.

Solution

Add a "simplified" list of checks with large (arbitrary) thresholds. Those values can be discussed, but hopefully we can agree on a common value to avoid additional parameters.

Changelog Entry

For release notes:

Improvement: Simplified GNSS checks after initial fix 

Test coverage

unit tests
@haumarco flight tested

Copy link

github-actions bot commented May 23, 2025

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 216 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +216  +0.0%    +216    .text
  [NEW]    +212  [NEW]    +212    estimator::GnssChecks::runSimplifiedChecks()
  +0.0%      +8  +0.0%      +8    [section .text]
  -0.7%      -4  -0.7%      -4    Ekf::updateGnssVel()
+0.0%     +55  [ = ]       0    .debug_abbrev
+0.0%      +8  [ = ]       0    .debug_aranges
+0.0%     +16  [ = ]       0    .debug_frame
+0.0%    +331  [ = ]       0    .debug_info
+0.0%    +294  [ = ]       0    .debug_line
  +300%      +3  [ = ]       0    [Unmapped]
  +0.0%    +291  [ = ]       0    [section .debug_line]
+0.0%    +315  [ = ]       0    .debug_loclists
+0.0%      +7  [ = ]       0    .debug_rnglists
+0.0%     +86  [ = ]       0    .debug_str
-0.8%      -2  [ = ]       0    .shstrtab
+0.0%     +66  [ = ]       0    .strtab
  [NEW]     +66  [ = ]       0    estimator::GnssChecks::runSimplifiedChecks()
+0.0%     +48  [ = ]       0    .symtab
 -33.3%     -16  [ = ]       0    ___ZNK3Ekf21updateAidSourceStatusI24estimator_aid_source3d_sN6matrix7Vector3IfEES4_EEvRT_RKyRKT1_RKT0_SE_SE_f.isra.0_veneer
 -25.0%     -16  [ = ]       0    __nxsem_tickwait_uninterruptible_veneer
   +50%     +16  [ = ]       0    __stm32_i2c_set_bytes_to_transfer_veneer
   +33%     +16  [ = ]       0    __stm32_recvfifo_veneer
  [NEW]     +48  [ = ]       0    estimator::GnssChecks::runSimplifiedChecks()
-2.0%    -216  [ = ]       0    [Unmapped]
+0.0% +1.20Ki  +0.0%    +216    TOTAL

px4_fmu-v6x [Total VM Diff: 216 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +216  +0.0%    +216    .text
  [NEW]    +212  [NEW]    +212    estimator::GnssChecks::runSimplifiedChecks()
  +0.0%      +8  +0.0%      +8    [section .text]
  -0.7%      -4  -0.7%      -4    Ekf::updateGnssVel()
+0.0%     +55  [ = ]       0    .debug_abbrev
+0.0%      +8  [ = ]       0    .debug_aranges
+0.0%     +16  [ = ]       0    .debug_frame
+0.0%    +331  [ = ]       0    .debug_info
+0.0%    +286  [ = ]       0    .debug_line
 -71.4%      -5  [ = ]       0    [Unmapped]
  +0.0%    +291  [ = ]       0    [section .debug_line]
+0.0%    +230  [ = ]       0    .debug_loclists
+0.0%      +8  [ = ]       0    .debug_rnglists
  +100%      +1  [ = ]       0    [Unmapped]
  +0.0%      +7  [ = ]       0    [section .debug_rnglists]
+0.0%     +86  [ = ]       0    .debug_str
-0.8%      -2  [ = ]       0    .shstrtab
+0.0%     +66  [ = ]       0    .strtab
  [NEW]     +66  [ = ]       0    estimator::GnssChecks::runSimplifiedChecks()
+0.0%     +48  [ = ]       0    .symtab
  [NEW]     +48  [ = ]       0    estimator::GnssChecks::runSimplifiedChecks()
-4.4%    -216  [ = ]       0    [Unmapped]
+0.0% +1.11Ki  +0.0%    +216    TOTAL

Updated: 2025-06-05T09:14:59

@bresch bresch force-pushed the pr-ekf2_gnss_checks branch from e4a1fd9 to 78abe87 Compare May 23, 2025 10:06
@bresch bresch force-pushed the pr-ekf2_simplified_gnss_checks branch from baddbcd to ab8791c Compare May 23, 2025 10:08
@haumarco
Copy link
Contributor

Why do we want to always use the simplified checks? Shouldn't this be something which can be configured by the user? Are the current thresholds not really, really high? Or should it simply be a better sanity check and we let the test-ratio do the proper evaluation?

Base automatically changed from pr-ekf2_gnss_checks to main June 3, 2025 07:22
This prevents stopping GNSS fusion on slightly degraded solution when
tight checks are set
@bresch bresch force-pushed the pr-ekf2_simplified_gnss_checks branch from ab8791c to f1773e8 Compare June 5, 2025 09:08
@bresch bresch marked this pull request as ready for review June 5, 2025 09:08
Copy link
Contributor

@haumarco haumarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After further discussion and comparison to previous versions of GNSS checks in PX4, I also think this is a good approach to loosen the checks. About the specific magnitude of the new thresholds I'm still not 100% sure since I could not test with "real"/in-air scenarios where GNSS gets bad all of the sudden.

Here's a test of starting outdoors and then moving indoors.
log_142_2025-6-6-15-19-52.zip

@MaEtUgR MaEtUgR merged commit 457ce90 into main Jun 6, 2025
68 of 69 checks passed
@github-project-automation github-project-automation bot moved this to ✅ Done in PX4 EKF Jun 6, 2025
@MaEtUgR MaEtUgR deleted the pr-ekf2_simplified_gnss_checks branch June 6, 2025 13:59
@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/wiki-errors-for-ek2-gps-check/45940/10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants