From d6277390f48d49e96de0cd03f522599571172b96 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Mon, 8 Apr 2019 15:16:19 +0200 Subject: [PATCH] AP_Beacon: use get_distance_NE instead of location_diff --- libraries/AP_Beacon/AP_Beacon_SITL.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Beacon/AP_Beacon_SITL.cpp b/libraries/AP_Beacon/AP_Beacon_SITL.cpp index 6af3de91f4..2aa0af5b67 100644 --- a/libraries/AP_Beacon/AP_Beacon_SITL.cpp +++ b/libraries/AP_Beacon/AP_Beacon_SITL.cpp @@ -97,8 +97,8 @@ void AP_Beacon_SITL::update(void) break; } - Vector2f beac_diff = location_diff(beacon_origin, beacon_loc); - Vector2f veh_diff = location_diff(beacon_origin, current_loc); + const Vector2f beac_diff = beacon_origin.get_distance_NE(beacon_loc); + const Vector2f veh_diff = beacon_origin.get_distance_NE(current_loc); Vector3f veh_pos3d(veh_diff.x, veh_diff.y, (current_loc.alt - beacon_origin.alt)*1.0e-2f); Vector3f beac_pos3d(beac_diff.x, beac_diff.y, (beacon_origin.alt - beacon_loc.alt)*1.0e-2f);