mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
ACM: Switched to filtered_loc for distance calcs
This commit is contained in:
parent
cbd4661b96
commit
5d64942f01
@ -139,7 +139,7 @@ static void set_next_WP(struct Location *wp)
|
|||||||
if (next_WP.lat == 0 || command_nav_index <= 1){
|
if (next_WP.lat == 0 || command_nav_index <= 1){
|
||||||
prev_WP = current_loc;
|
prev_WP = current_loc;
|
||||||
}else{
|
}else{
|
||||||
if (get_distance_cm(¤t_loc, &next_WP) < 500)
|
if (get_distance_cm(&filtered_loc, &next_WP) < 500)
|
||||||
prev_WP = next_WP;
|
prev_WP = next_WP;
|
||||||
else
|
else
|
||||||
prev_WP = current_loc;
|
prev_WP = current_loc;
|
||||||
@ -167,7 +167,7 @@ static void set_next_WP(struct Location *wp)
|
|||||||
|
|
||||||
// this is handy for the groundstation
|
// this is handy for the groundstation
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
wp_distance = get_distance_cm(¤t_loc, &next_WP);
|
wp_distance = get_distance_cm(&filtered_loc, &next_WP);
|
||||||
target_bearing = get_bearing_cd(&prev_WP, &next_WP);
|
target_bearing = get_bearing_cd(&prev_WP, &next_WP);
|
||||||
|
|
||||||
// calc the location error:
|
// calc the location error:
|
||||||
|
Loading…
Reference in New Issue
Block a user