diff --git a/src/MissionManager/MissionSettingsItem.cc b/src/MissionManager/MissionSettingsItem.cc index bcf63aed9185bd8e42813d74124339370fc8a3fe..67072b78b96e8ff82776e26f8bac44d8ea4742e7 100644 --- a/src/MissionManager/MissionSettingsItem.cc +++ b/src/MissionManager/MissionSettingsItem.cc @@ -220,10 +220,14 @@ void MissionSettingsItem::_setDirty(void) void MissionSettingsItem::setCoordinate(const QGeoCoordinate& coordinate) { if (_plannedHomePositionCoordinate != coordinate) { - _plannedHomePositionCoordinate = coordinate; - emit coordinateChanged(coordinate); - emit exitCoordinateChanged(coordinate); - _plannedHomePositionAltitudeFact.setRawValue(coordinate.altitude()); + // ArduPilot tends to send crap home positions at initial vehicel boot, discard them + if (coordinate.latitude() != 0 || coordinate.longitude() != 0) { + qDebug() << "Setting home position" << coordinate; + _plannedHomePositionCoordinate = coordinate; + emit coordinateChanged(coordinate); + emit exitCoordinateChanged(coordinate); + _plannedHomePositionAltitudeFact.setRawValue(coordinate.altitude()); + } } }