From 2efe32e4b164e07b39a7e14a023cee09a3621c5b Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Fri, 5 Apr 2019 15:02:43 +0200 Subject: [PATCH] AP_L1_Control: move get_bearing_cd to Location and rename to get_bearing_to --- libraries/AP_L1_Control/AP_L1_Control.cpp | 4 ++-- libraries/AP_L1_Control/AP_L1_Control.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/AP_L1_Control/AP_L1_Control.cpp b/libraries/AP_L1_Control/AP_L1_Control.cpp index 81c969ff15..fb2c609b9b 100644 --- a/libraries/AP_L1_Control/AP_L1_Control.cpp +++ b/libraries/AP_L1_Control/AP_L1_Control.cpp @@ -224,7 +224,7 @@ void AP_L1_Control::update_waypoint(const struct Location &prev_WP, const struct Vector2f _groundspeed_vector = _ahrs.groundspeed_vector(); // update _target_bearing_cd - _target_bearing_cd = get_bearing_cd(_current_loc, next_WP); + _target_bearing_cd = _current_loc.get_bearing_to(next_WP); //Calculate groundspeed float groundSpeed = _groundspeed_vector.length(); @@ -360,7 +360,7 @@ void AP_L1_Control::update_loiter(const struct Location ¢er_WP, float radius // update _target_bearing_cd - _target_bearing_cd = get_bearing_cd(_current_loc, center_WP); + _target_bearing_cd = _current_loc.get_bearing_to(center_WP); // Calculate time varying control parameters diff --git a/libraries/AP_L1_Control/AP_L1_Control.h b/libraries/AP_L1_Control/AP_L1_Control.h index cd5b4f2ce6..8e85cd97f2 100644 --- a/libraries/AP_L1_Control/AP_L1_Control.h +++ b/libraries/AP_L1_Control/AP_L1_Control.h @@ -18,6 +18,7 @@ #include #include #include +#include class AP_L1_Control : public AP_Navigation { public: