FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add GPS fix type check bit to EKF2 GPS checks by ischollETH · Pull Request #25215 · PX4/PX4-Autopilot · GitHub

Add GPS fix type check bit to EKF2 GPS checks - #25215

Merged
dagar merged 9 commits into
PX4:mainfrom
ischollETH:gps-fix-type-check
Aug 8, 2025
Merged

dagar merged 9 commits into
PX4:mainfrom
ischollETH:gps-fix-type-check

Conversation

ischollETH commented Jul 14, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

Solved Problem

When using a RTK GPS setup for precise start & landing scenarios I found that if the pilot takes off before there is a proper RTK fix, on return the home position was potentially imprecise and therefore an exact landing at the same spot can fail:
--> there is currently no way to enable a pre-flight check of the GPS fix type required before takeoff

Solution

  • Add an extra bit in the EKF2_GPS_CHECK for adding a GPS fix type check
  • Add EKF2_REQ_FIX to define what minimum fix type has to be given for allowing arming

Changelog Entry

Added GPS fix type requirement to pre-flight GPS checks

Test coverage

  • Tested in hardware that the pre-flight warning pops up when requiring a 3D GPS fix (type 3) while the GPS is inside and has no fix, which disappeared when reducing the required fix to e.g. 0 or 1

dakejahl previously approved these changes Jul 14, 2025

dakejahl 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Makes sense thanks!

bresch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nice, just a comment about the simplified checks

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
bresch previously approved these changes Jul 15, 2025

bresch commented Jul 15, 2025

Copy link
Copy Markdown
Member

@ischollETH please run ./Tools/astyle/fix_code_style.sh src/modules/ekf2/EKF/aid_sources/gnss/gnss_checks.hpp to fix formatting

Copy link
Copy Markdown
Contributor Author

@bresch done

ischollETH requested a review from bresch July 16, 2025 01:47
MaEtUgR force-pushed the gps-fix-type-check branch from 0d47096 to 2b0102e Compare July 21, 2025 15:36
MaEtUgR previously approved these changes Jul 21, 2025

MaEtUgR left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I checked why the unit tests were failing and it was because the GPS fix type check was not enabled anymore for them because the default value for the bitmask in the constructor when it's not overridden by the parameter (like in the unit tests) was not updated.

I'm not sure why by default it was 21 but adding the 11th bit makes it 21 + 1024 = 1045 without changing anything else and that works. See 2b0102e

@bresch Can you give it a last check?

bresch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

All good, thanks!

Copy link
Copy Markdown
Contributor Author

@bresch I changed the parameter into an enum

ischollETH requested a review from bresch July 30, 2025 17:41
ischollETH requested a review from MaEtUgR July 30, 2025 17:41
dagar merged commit 4812311 into PX4:main Aug 8, 2025
Beatriz-Diniz pushed a commit to Beatriz-Diniz/PX4-Autopilot that referenced this pull request Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL