diff --git a/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.cpp b/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.cpp index b433e47ba4..9579d70b3a 100644 --- a/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.cpp +++ b/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.cpp @@ -50,6 +50,10 @@ void CpuResourceChecks::checkAndReport(const Context &context, Report &reporter) return; } + if (!_cpuload_sub.advertised()) { + return; + } + cpuload_s cpuload; if (!_cpuload_sub.copy(&cpuload) || hrt_elapsed_time(&cpuload.timestamp) > 2_s) { diff --git a/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp b/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp index b1e1374026..dc36c35974 100644 --- a/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp +++ b/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp @@ -109,14 +109,16 @@ void EstimatorChecks::checkAndReport(const Context &context, Report &reporter) } if (missing_data && (param_ekf2_en == 1)) { - /* EVENT - */ - reporter.armingCheckFailure(required_groups, health_component_t::local_position_estimate, - events::ID("check_estimator_missing_data"), - events::Log::Info, "Waiting for estimator to initialize"); + if (_estimator_status_sub.advertised()) { + /* EVENT + */ + reporter.armingCheckFailure(required_groups, health_component_t::local_position_estimate, + events::ID("check_estimator_missing_data"), + events::Log::Info, "Waiting for estimator to initialize"); - if (reporter.mavlink_log_pub()) { - mavlink_log_critical(reporter.mavlink_log_pub(), "Preflight Fail: ekf2 missing data"); + if (reporter.mavlink_log_pub()) { + mavlink_log_critical(reporter.mavlink_log_pub(), "Preflight Fail: ekf2 missing data"); + } } } else {