From fa0ecc157b5689984319b7f72f1e97d6f2461e8a Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Mon, 12 Feb 2018 08:58:01 +0100 Subject: [PATCH] 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. --- src/modules/navigator/mission_feasibility_checker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/navigator/mission_feasibility_checker.cpp b/src/modules/navigator/mission_feasibility_checker.cpp index 4cd29ea7ab90..e9364c118a3b 100644 --- a/src/modules/navigator/mission_feasibility_checker.cpp +++ b/src/modules/navigator/mission_feasibility_checker.cpp @@ -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);