mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-09 13:41:36 +08:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user