diff --git a/libraries/AP_Common/Location.cpp b/libraries/AP_Common/Location.cpp index e48759feb2..e7c31636f0 100644 --- a/libraries/AP_Common/Location.cpp +++ b/libraries/AP_Common/Location.cpp @@ -234,7 +234,7 @@ bool Location::get_vector_from_origin_NEU(Vector3f &vec_neu) const } // return horizontal distance in meters between two locations -ftype Location::get_distance(const struct Location &loc2) const +ftype Location::get_distance(const Location &loc2) const { ftype dlat = (ftype)(loc2.lat - lat); ftype dlng = ((ftype)diff_longitude(loc2.lng,lng)) * longitude_scale((lat+loc2.lat)/2); @@ -242,7 +242,7 @@ ftype Location::get_distance(const struct Location &loc2) const } // return the altitude difference in meters taking into account alt frame. -bool Location::get_alt_distance(const struct Location &loc2, ftype &distance) const +bool Location::get_alt_distance(const Location &loc2, ftype &distance) const { int32_t alt1, alt2; if (!get_alt_cm(AltFrame::ABSOLUTE, alt1) || !loc2.get_alt_cm(AltFrame::ABSOLUTE, alt2)) { @@ -374,7 +374,7 @@ assert_storage_size _assert_storage_size_Location; // return bearing in radians from location to loc2, return is 0 to 2*Pi -ftype Location::get_bearing(const struct Location &loc2) const +ftype Location::get_bearing(const Location &loc2) const { const int32_t off_x = diff_longitude(loc2.lng,lng); const int32_t off_y = (loc2.lat - lat) / loc2.longitude_scale((lat+loc2.lat)/2); diff --git a/libraries/AP_Common/Location.h b/libraries/AP_Common/Location.h index f3eb1b9a3c..e294cef2fb 100644 --- a/libraries/AP_Common/Location.h +++ b/libraries/AP_Common/Location.h @@ -61,10 +61,10 @@ public: bool get_vector_from_origin_NEU(Vector3f &vec_neu) const WARN_IF_UNUSED; // return horizontal distance in meters between two locations - ftype get_distance(const struct Location &loc2) const; + ftype get_distance(const Location &loc2) const; // return the altitude difference in meters taking into account alt frame. - bool get_alt_distance(const struct Location &loc2, ftype &distance) const WARN_IF_UNUSED; + bool get_alt_distance(const Location &loc2, ftype &distance) const WARN_IF_UNUSED; // return the distance in meters in North/East/Down plane as a N/E/D vector to loc2 // NOT CONSIDERING ALT FRAME! @@ -97,10 +97,10 @@ public: void zero(void); // return the bearing in radians, from 0 to 2*Pi - ftype get_bearing(const struct Location &loc2) const; + ftype get_bearing(const Location &loc2) const; // return bearing in centi-degrees from location to loc2, return is 0 to 35999 - int32_t get_bearing_to(const struct Location &loc2) const { + int32_t get_bearing_to(const Location &loc2) const { return int32_t(get_bearing(loc2) * DEGX100 + 0.5); } @@ -110,7 +110,7 @@ public: /* * convert invalid waypoint with useful data. return true if location changed */ - bool sanitize(const struct Location &defaultLoc); + bool sanitize(const Location &defaultLoc); // return true when lat and lng are within range bool check_latlng() const;