From a0f2075d5ab3322192fde9729b038e835453af6e Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 5 Jun 2015 22:44:00 +0200 Subject: [PATCH] navigator: Decide feasibility of mission based on current position, not home --- src/modules/navigator/mission.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/navigator/mission.cpp b/src/modules/navigator/mission.cpp index a68f4de012..e36e3fa386 100644 --- a/src/modules/navigator/mission.cpp +++ b/src/modules/navigator/mission.cpp @@ -297,10 +297,10 @@ Mission::check_dist_1wp() mission_item.nav_cmd == NAV_CMD_TAKEOFF || mission_item.nav_cmd == NAV_CMD_PATHPLANNING) { - /* check distance from home to item */ + /* check distance from current position to item */ float dist_to_1wp = get_distance_to_next_waypoint( mission_item.lat, mission_item.lon, - _navigator->get_home_position()->lat, _navigator->get_home_position()->lon); + _navigator->get_global_position()->lat, _navigator->get_global_position()->lon); if (dist_to_1wp < _param_dist_1wp.get()) { _dist_1wp_ok = true;