Skip to content

fix: stuck GNSS control logic on intermittent data#27416

Open
bresch wants to merge 2 commits into
mainfrom
pr-gnss_fusion_stuck
Open

fix: stuck GNSS control logic on intermittent data#27416
bresch wants to merge 2 commits into
mainfrom
pr-gnss_fusion_stuck

Conversation

@bresch
Copy link
Copy Markdown
Member

@bresch bresch commented May 20, 2026

Solved Problem

I found a race condition where the GNSS checks initially passed and then started to fail intermittently while the drone was on the ground (no relaxed checks). This caused the GnssChecks::run function to always return false, which prevents the samples to be fused, but the GNSS fusion never gets disabled as _time_last_pass_us is still updated by the intermittent good samples.
This logic is supposed to stop the GNSS fusion when quality is degraded.

Screenshot from 2026-05-19 17-30-08

Solution

Only update _time_last_pass_us when the full check really passes (includes the hysteresis).

Test coverage

add unit test to re-create the race condition (fails without the fix)

bresch added 2 commits May 20, 2026 16:24
This fixes the case where the gnss checks is reporting false but the
failure doesn't make the control logic time out.
@bresch bresch requested a review from haumarco May 20, 2026 14:37
@bresch bresch self-assigned this May 20, 2026
@github-actions github-actions Bot added kind:test Adds or improves tests. risk:safety-critical May affect arming, failsafe, control, navigation, or flight safety. scope:estimation EKF, local position, attitude, wind, bias, or aiding logic. scope:testing Unit, integration, fuzzing, or test data. labels May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

❌ PR title needs conventional commit format

Expected format: type(scope): description (conventional commits).

Your title:

fix: stuck GNSS control logic on intermittent data

Suggested fix:

feat(fix): stuck GNSS control logic on intermittent data

To fix this: click the ✏️ next to the PR title at the top of this page and update it.

See CONTRIBUTING.md for details.


This comment will be automatically removed once the issue is resolved.

@github-actions
Copy link
Copy Markdown
Contributor

💡 Commit messages could be improved

Not blocking, but these commit messages could use some cleanup.

Commit Message Suggestion
c8512bdc64 test: add intermittent GNSS failure case test Missing conventional commit format (e.g. "feat(ekf2): add something")
28f7bb5eb4 fix: only record GNSS check success time when passing hysteresis Missing conventional commit format (e.g. "feat(ekf2): add something")

See the commit message convention for details.


This comment will be automatically removed once the issues are resolved.

Copy link
Copy Markdown
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.

can you use the type(scope): description format for the commits to make CI happy

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

Labels

kind:test Adds or improves tests. risk:safety-critical May affect arming, failsafe, control, navigation, or flight safety. scope:estimation EKF, local position, attitude, wind, bias, or aiding logic. scope:testing Unit, integration, fuzzing, or test data.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants