navigator: Decide feasibility of mission based on current position, not home

This commit is contained in:
Lorenz Meier 2015-06-05 22:44:00 +02:00
parent bd3fbd5fa2
commit a0f2075d5a
1 changed files with 2 additions and 2 deletions

View File

@ -297,10 +297,10 @@ Mission::check_dist_1wp()
mission_item.nav_cmd == NAV_CMD_TAKEOFF || mission_item.nav_cmd == NAV_CMD_TAKEOFF ||
mission_item.nav_cmd == NAV_CMD_PATHPLANNING) { 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( float dist_to_1wp = get_distance_to_next_waypoint(
mission_item.lat, mission_item.lon, 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()) { if (dist_to_1wp < _param_dist_1wp.get()) {
_dist_1wp_ok = true; _dist_1wp_ok = true;