Skip to content

fix(estimator-checks): do not report sensor failure on jamming detection - #28305

Merged
bresch merged 3 commits into
mainfrom
fix-jamming-no-fail
Aug 20, 2026
Merged

fix(estimator-checks): do not report sensor failure on jamming detection#28305
bresch merged 3 commits into
mainfrom
fix-jamming-no-fail

Conversation

@bresch

@bresch bresch commented Aug 20, 2026

Copy link
Copy Markdown
Member

Solved Problem

Even when a position estimate is not required, the jamming state sets the GPS health status to false in SYS_STATUS. This can cause the listener (e.g.: GCS) to report an issue.

Solution

Using "Notice" instead of "Warning" makes sure the the GPS bit in SYS_STATUS stays healthy while still reporting the jamming message.
This is of course only the case if the current mode does't require a valid position.
image

The change was tested in SITL by adding SYS_FAIL_GPS_JAM that can be configured to change the jamming status when triggering failure gps wrong.

Additional fix: there was a mismatch between the bits in EKF2_GPS_CHECK and the published gps_check_fail_flags which led to the jamming checks being enabled while it was disabled in the parameter.

Changelog Entry

For release notes:

New parameter: SYS_FAIL_GPS_JAM
Documentation: -

Test coverage

SITL

Using "Notice" instead of "Warning" makes sure the the GPS bit in SYS_STATUS stays healthy
while still reporting the jamming message.
@bresch bresch self-assigned this Aug 20, 2026
@github-actions github-actions Bot added kind:bug Something is broken or behaving incorrectly. scope:commander Arming, modes, failsafe, health checks, or vehicle state. labels Aug 20, 2026
@github-actions github-actions Bot added the scope:parameters Parameter definitions, metadata, migration, or defaults. label Aug 20, 2026
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 80 byte (0 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +80  +0.0%     +80    .text
     +13%     +80   +13%     +80    EKF2::PublishStatus()
  +0.0%     +55  [ = ]       0    .debug_abbrev
  +0.0%    +653  [ = ]       0    .debug_info
  +0.0%    +356  [ = ]       0    .debug_line
    +200%      +2  [ = ]       0    [Unmapped]
    +0.0%    +354  [ = ]       0    [section .debug_line]
  +0.0%    +126  [ = ]       0    .debug_loclists
  +0.0%    +172  [ = ]       0    .debug_rnglists
    [NEW]      +1  [ = ]       0    [Unmapped]
    +0.0%    +171  [ = ]       0    [section .debug_rnglists]
  +0.0%    +166  [ = ]       0    .debug_str
  -0.9%     -80  [ = ]       0    [Unmapped]
  +0.0% +1.49Ki  +0.0%     +80    TOTAL

px4_fmu-v6x [Total VM Diff: 80 byte (0 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +80  +0.0%     +80    .text
     +13%     +80   +13%     +80    EKF2::PublishStatus()
  +0.0%     +55  [ = ]       0    .debug_abbrev
  +0.0%    +653  [ = ]       0    .debug_info
  +0.0%    +356  [ = ]       0    .debug_line
    [NEW]      +6  [ = ]       0    [Unmapped]
    +0.0%    +350  [ = ]       0    [section .debug_line]
  +0.0%    +251  [ = ]       0    .debug_loclists
  +0.0%    +171  [ = ]       0    .debug_rnglists
  +0.0%    +166  [ = ]       0    .debug_str
  -1.6%     -80  [ = ]       0    [Unmapped]
  +0.0% +1.61Ki  +0.0%     +80    TOTAL

Updated: 2026-08-20T12:43:53

@bresch
bresch requested a review from mahima-yoga August 20, 2026 10:10
The published gps_check_fail_flags mask was derived from EKF2_GPS_CHECK with a
positional shift, assuming param bit N corresponds to fail status bit N+1. That
only holds up to kSpoofed: the fix check sits at param bit 10 but status bit 0,
so the shift made param bit 10 (Fix type) publish status bit 11 (jammed), and
param bit 11 (Jamming) map to a status bit no check ever sets.

With the default EKF2_GPS_CHECK of 2047 the published mask was therefore 4095,
which reports a jamming failure even though the jamming check is disabled, while
enabling the jamming check published nothing.

Map the two layouts one by one in GnssChecks, which owns both, so appending a
check to one enum can no longer silently misassign the others. The fix bit is
now gated on kFix like every other check, matching how it is already gated when
computing whether the checks passed.
@github-actions github-actions Bot added the scope:estimation EKF, local position, attitude, wind, bias, or aiding logic. label Aug 20, 2026

@mahima-yoga mahima-yoga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me!

@bresch
bresch merged commit 768d1ce into main Aug 20, 2026
75 checks passed
@bresch
bresch deleted the fix-jamming-no-fail branch August 20, 2026 13:06
@Claudio-Chies

Copy link
Copy Markdown
Member

@bresch would it not make sense to introduce a new FAILURE_TYPE? The approach here breaks the proposed implementation in QGC (mavlink/qgroundcontrol#14578) where we display the SYS_FAIL_GPS_WRG parameter in the failure_injection tab, so the user can specify the type of wrong failure on the UI. if we go down this route we would then have to list N parameters there.

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

Labels

kind:bug Something is broken or behaving incorrectly. scope:commander Arming, modes, failsafe, health checks, or vehicle state. scope:estimation EKF, local position, attitude, wind, bias, or aiding logic. scope:parameters Parameter definitions, metadata, migration, or defaults.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants