Files
PX4-Autopilot/ROMFS
4ad48205df feat(gnss): check each receiver and carry the result on the sample (#28520)
* refactor(gnss): move GnssChecks to src/lib/gnss

The checks judge a receiver, not the estimate, and the sensors module needs one checker per receiver. GnssChecks now takes its thresholds as a params struct and armed, in air and at rest per call instead of referencing EKF2's parameters and control status, and the thresholds become GNSS_CHECK and GNSS_REQ_*, with GNSS_REQ_TIME for the health time. EKF2 still runs it, so the checks behave as before.

Co-authored-by: jonas <jonas.perolini@rigi.tech>
Assisted-by: Claude:claude-opus-5-5

* feat(gnss): carry the GNSS check result on the sample

A latest-wins status can't gate fusion: it describes the newest sample, which runs ahead of the one EKF2 fuses by the GNSS delay plus the EKF buffer. The sensors module now runs one GnssChecks per receiver and stamps the selected receiver's result on each vehicle_gnss sample (usable, and failed_checks in GNSS_CHECK bit order), and EKF2 fuses a sample only if that sample is usable. EKF2 drops its own checker and estimator_gps_status; estimator_status.gps_check_fail_flags forwards the sample's failures in its own bit order until commander reads vehicle_gnss. Every receiver's diagnostics go on sensors_status_gnss.

Co-authored-by: Matheo Taillandier <matheo.taillandier@rigi.tech>
Co-authored-by: jonas <jonas.perolini@rigi.tech>
Assisted-by: Claude:claude-opus-5-5

* feat(commander): count GNSS receivers that pass their checks

A 3D fix says nothing about accuracy, drift, spoofing or jamming, so the redundancy check counted receivers the sensors module rejects. It now counts a receiver while sensors_status_gnss says it passes its checks.

Co-authored-by: jonas <jonas.perolini@rigi.tech>
Assisted-by: Claude:claude-opus-5-5

* fix(boards): drop EKF2::PublishGpsStatus from the i.MX RT ITCM lists

The function went with estimator_gps_status, and the ITCM check fails on a listed symbol that is missing from the ELF.

Assisted-by: Claude:claude-fable-5-1

* fix(ekf2): report GNSS check failures only while GNSS fusion is enabled

EKF2 ran the checks only past its GNSS-intended gate, so with EKF2_GPS_CTRL 0 estimator_status.gps_check_fail_flags stayed 0. Forwarding the sample's failures unconditionally made commander turn a receiver EKF2 ignores into pre-arm failures, and into an arming block with COM_ARM_WO_GPS 0.

Assisted-by: Claude:claude-fable-5-1

* refactor(commander): index the GNSS status by receiver instance

The sensors module fills sensors_status_gnss by sensor_gnss instance, the index the redundancy check already subscribes with, so the device_id lookup was redundant. Its sizeof idiom also tripped clang-tidy's bugprone-sizeof-expression.

Assisted-by: Claude:claude-fable-5-1

* refactor(ekf2): rename the GNSS checks pass time to sample accepted

It is set only for a sample that is both usable and within EKF2_VEL_LIM, so it is the last time a sample was accepted for fusion, not the last time the checks passed.

Assisted-by: Claude:claude-fable-5-1

* docs(msg): keep thresholds and parameters out of the GNSS check comments

Message comments describe the message and its fields, not the code that fills them.

Assisted-by: Claude:claude-fable-5-1

---------

Co-authored-by: Matheo Taillandier <matheo.taillandier@rigi.tech>
Co-authored-by: jonas <jonas.perolini@rigi.tech>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-30 11:34:05 -06:00
..