mission: warn at 2/3 of the max distance

This was wrong, instead of warning at 2/3 of the max distance as
mentioned in the comment, we would start to warn at 3/2 of the distance
which would then never actually happen.
This commit is contained in:
Julian Oes
2018-02-12 08:58:01 +01:00
committed by Daniel Agar
parent 85b88f723d
commit cc36c8ee37

View File

@@ -497,7 +497,7 @@ MissionFeasibilityChecker::checkDistanceToFirstWaypoint(const mission_s &mission
if (dist_to_1wp < max_distance) {
if (dist_to_1wp > ((max_distance * 3) / 2)) {
if (dist_to_1wp > ((max_distance * 2) / 3)) {
/* allow at 2/3 distance, but warn */
mavlink_log_critical(_navigator->get_mavlink_log_pub(),
"First waypoint far away: %d meters.", (int)dist_to_1wp);
@@ -559,7 +559,7 @@ MissionFeasibilityChecker::checkDistancesBetweenWaypoints(const mission_s &missi
if (dist_between_waypoints < max_distance) {
if (dist_between_waypoints > ((max_distance * 3) / 2)) {
if (dist_between_waypoints > ((max_distance * 2) / 3)) {
/* allow at 2/3 distance, but warn */
mavlink_log_critical(_navigator->get_mavlink_log_pub(),
"Distance between waypoints very far: %d meters.", (int)dist_between_waypoints);