|
|
|
@ -60,7 +60,7 @@ static void navigate()
@@ -60,7 +60,7 @@ static void navigate()
|
|
|
|
|
|
|
|
|
|
// waypoint distance from plane |
|
|
|
|
// ---------------------------- |
|
|
|
|
wp_distance = get_distance(¤t_loc, &next_WP); |
|
|
|
|
wp_distance = get_distance(current_loc, next_WP); |
|
|
|
|
|
|
|
|
|
if (wp_distance < 0) { |
|
|
|
|
gcs_send_text_P(SEVERITY_HIGH,PSTR("WP error - distance < 0")); |
|
|
|
@ -186,9 +186,9 @@ static void update_cruise()
@@ -186,9 +186,9 @@ static void update_cruise()
|
|
|
|
|
if (cruise_state.locked_heading) { |
|
|
|
|
next_WP = prev_WP; |
|
|
|
|
// always look 1km ahead |
|
|
|
|
location_update(&next_WP, |
|
|
|
|
location_update(next_WP, |
|
|
|
|
cruise_state.locked_heading_cd*0.01f, |
|
|
|
|
get_distance(&prev_WP, ¤t_loc) + 1000); |
|
|
|
|
get_distance(prev_WP, current_loc) + 1000); |
|
|
|
|
nav_controller->update_waypoint(prev_WP, next_WP); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -233,7 +233,7 @@ static void setup_glide_slope(void)
@@ -233,7 +233,7 @@ static void setup_glide_slope(void)
|
|
|
|
|
{ |
|
|
|
|
// establish the distance we are travelling to the next waypoint, |
|
|
|
|
// for calculating out rate of change of altitude |
|
|
|
|
wp_totalDistance = get_distance(¤t_loc, &next_WP); |
|
|
|
|
wp_totalDistance = get_distance(current_loc, next_WP); |
|
|
|
|
wp_distance = wp_totalDistance; |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|