Ekf2 add jamming to gnss checks (#26085)

* add jamming check to gnss checks

* keep original order of gnss_check params for default backwards compability
This commit is contained in:
Marco Hauswirth
2025-12-16 10:10:37 +01:00
committed by GitHub
parent 1345b3500a
commit 8393f46100
8 changed files with 43 additions and 4 deletions
@@ -272,6 +272,22 @@ void EstimatorChecks::checkEstimatorStatus(const Context &context, Report &repor
_gnss_spoofed = false;
}
if (estimator_status.gps_check_fail_flags & (1 << estimator_status_s::GPS_CHECK_FAIL_JAMMED)) {
if (!_gnss_jammed) {
_gnss_jammed = true;
if (reporter.mavlink_log_pub()) {
mavlink_log_critical(reporter.mavlink_log_pub(), "GNSS signal jammed\t");
}
events::send(events::ID("check_estimator_gnss_warning_jamming"), {events::Log::Alert, events::LogInternal::Info},
"GNSS signal jammed");
}
} else {
_gnss_jammed = false;
}
if (!context.isArmed() && ekf_gps_check_fail) {
NavModesMessageFail required_modes;
events::Log log_level;
@@ -435,6 +451,18 @@ void EstimatorChecks::checkEstimatorStatus(const Context &context, Report &repor
events::ID("check_estimator_gps_spoofed"),
log_level, "GPS signal spoofed");
} else if (estimator_status.gps_check_fail_flags & (1 << estimator_status_s::GPS_CHECK_FAIL_JAMMED)) {
message = "Preflight%s: GPS signal jammed";
/* EVENT
* @description
* <profile name="dev">
* Can be configured with <param>EKF2_GPS_CHECK</param> and <param>COM_ARM_WO_GPS</param>.
* </profile>
*/
reporter.armingCheckFailure(required_modes, health_component_t::gps,
events::ID("check_estimator_gps_jammed"),
log_level, "GPS signal jammed");
} else {
if (!ekf_gps_fusion) {
// Likely cause unknown
@@ -103,6 +103,7 @@ private:
bool _gps_was_fused{false};
bool _gnss_spoofed{false};
bool _gnss_jammed{false};
bool _nav_failure_imminent_warned{false};