commander: do not check dead-reckoning flag to send GPS invalid msg

The dead-reckoning flag comes from EKF2 and isn't in sync with the other
commander flags. This can lead to the message not being printed because
EKF2 can take a bit more time to stop the GPS fusion and set the DR
flag.
This commit is contained in:
bresch
2023-01-12 15:25:11 +01:00
committed by fury1895
parent 9fe5652252
commit 34423a6c92
+3 -5
View File
@@ -4461,14 +4461,12 @@ void Commander::estimator_check()
}
if (condition_gps_position_was_valid && !_vehicle_status_flags.gps_position_valid) {
PX4_DEBUG("GPS no longer valid");
// report GPS failure if flying and the global position estimate is still valid
if (!_vehicle_land_detected.landed && _vehicle_status_flags.global_position_valid
&& _vehicle_status_flags.dead_reckoning) {
mavlink_log_warning(&_mavlink_log_pub, "GPS no longer valid, switching to dead-reckoning\t");
if (!_vehicle_land_detected.landed && _vehicle_status_flags.global_position_valid) {
mavlink_log_warning(&_mavlink_log_pub, "GPS no longer valid\t");
events::send(events::ID("commander_gps_lost"), {events::Log::Critical, events::LogInternal::Info},
"GPS no longer valid, switching to dead-reckoning");
"GPS no longer valid");
}
} else if (!condition_gps_position_was_valid && _vehicle_status_flags.gps_position_valid) {