|
|
|
@ -5,7 +5,7 @@
@@ -5,7 +5,7 @@
|
|
|
|
|
//**************************************************************** |
|
|
|
|
static byte navigate() |
|
|
|
|
{ |
|
|
|
|
// waypoint distance from plane in meters |
|
|
|
|
// waypoint distance from plane in cm |
|
|
|
|
// --------------------------------------- |
|
|
|
|
wp_distance = get_distance(¤t_loc, &next_WP); |
|
|
|
|
home_distance = get_distance(¤t_loc, &home); |
|
|
|
@ -32,7 +32,7 @@ static bool check_missed_wp()
@@ -32,7 +32,7 @@ static bool check_missed_wp()
|
|
|
|
|
int32_t temp; |
|
|
|
|
temp = target_bearing - original_target_bearing; |
|
|
|
|
temp = wrap_180(temp); |
|
|
|
|
return (abs(temp) > 10000); //we pased the waypoint by 10 ° |
|
|
|
|
return (abs(temp) > 10000); // we passed the waypoint by 100 degrees |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ------------------------------ |
|
|
|
@ -529,7 +529,7 @@ static int32_t wrap_180(int32_t error)
@@ -529,7 +529,7 @@ static int32_t wrap_180(int32_t error)
|
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
// distance is returned in meters |
|
|
|
|
// distance is returned in cm |
|
|
|
|
static int32_t get_distance(struct Location *loc1, struct Location *loc2) |
|
|
|
|
{ |
|
|
|
|
float dlat = (float)(loc2->lat - loc1->lat); |
|
|
|
|