Commit bc0f7b12 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #5077 from DonLakeFlyer/MaxGoTo

Guided: Max goto location of 1km
parents 99c062d3 8bb1b5ed
......@@ -2024,6 +2024,14 @@ void Vehicle::guidedModeGotoLocation(const QGeoCoordinate& gotoCoord)
qgcApp()->showMessage(guided_mode_not_supported_by_vehicle);
return;
}
if (!coordinate().isValid()) {
return;
}
double maxDistance = 1000.0;
if (coordinate().distanceTo(gotoCoord) > maxDistance) {
qgcApp()->showMessage(QString("New location is too far. Must be less than %1 %2").arg(qRound(FactMetaData::metersToAppSettingsDistanceUnits(maxDistance).toDouble())).arg(FactMetaData::appSettingsDistanceUnitsString()));
return;
}
_firmwarePlugin->guidedModeGotoLocation(this, gotoCoord);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment