diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2018-04-24 11:30:38 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2018-06-19 19:11:12 +0300 |
commit | c827ff4d8f2980b6182c32749e9b03d0797a569a (patch) | |
tree | e5801509cf4203f951d56a89e24662b543f785f3 /platform | |
parent | ce3d3c668e78009f4dd32e9934c46b7890ac1bb3 (diff) |
Extrapolation of GPS position.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/location.hpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/platform/location.hpp b/platform/location.hpp index 1fc9ffd8c5..d927d7db21 100644 --- a/platform/location.hpp +++ b/platform/location.hpp @@ -27,6 +27,7 @@ namespace location enum TLocationSource { + EUndefine, EAppleNative, EWindowsNative, EAndroidNative, @@ -41,25 +42,25 @@ namespace location class GpsInfo { public: - GpsInfo() - : m_horizontalAccuracy(100.0), // use as a default accuracy - m_altitude(0.0), m_verticalAccuracy(-1.0), m_bearing(-1.0), m_speed(-1.0) - { - } - - TLocationSource m_source; - double m_timestamp; //!< seconds from 1st Jan 1970 - double m_latitude; //!< degrees - double m_longitude; //!< degrees - double m_horizontalAccuracy; //!< metres - double m_altitude; //!< metres - double m_verticalAccuracy; //!< metres - double m_bearing; //!< positive degrees from the true North - double m_speed; //!< metres per second - - //bool HasAltitude() const { return m_verticalAccuracy >= 0.0; } - bool HasBearing() const { return m_bearing >= 0.0; } - bool HasSpeed() const { return m_speed >= 0.0; } + TLocationSource m_source = EUndefine; + /// \note |m_timestamp| is calculated based on platform methods which don't + /// guarantee that |m_timestamp| is monotonic. |m_monotonicTimeMs| should be added to + /// class |GpsInfo|. This time should be calculated based on Location::getElapsedRealtimeNanos() + /// method in case of Android. How to calculate such time in case of iOS should be + /// investigated. + /// \note For most cases |m_timestamp| is monotonic. + double m_timestamp = 0.0; //!< seconds from 1st Jan 1970 + double m_latitude = 0.0; //!< degrees + double m_longitude = 0.0; //!< degrees + double m_horizontalAccuracy = 100.0; //!< metres + double m_altitude = 0.0; //!< metres + double m_verticalAccuracy = -1.0; //!< metres + double m_bearing = -1.0; //!< positive degrees from the true North + double m_speed = -1.0; //!< metres per second + + bool IsValid() const { return m_source != EUndefine; } + bool HasBearing() const { return m_bearing >= 0.0; } + bool HasSpeed() const { return m_speed >= 0.0; } }; /// GpsTrackInfo struct describes a point for GPS tracking |