Commit 8bb1b5ed authored by DonLakeFlyer's avatar DonLakeFlyer

Max goto location of 1km

parent 6e57a50a
......@@ -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