Как улучшить значение истинного севера? ⇐ IOS
Как улучшить значение истинного севера?
Currently using both CLLocation's course (CLLocationDirection) property as well as the new heading value provided by func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) to obtain the true north value for a navigation app. Former is useful when the user is mobile whereas the latter is useful when the user is rotating while stationary. However, sometimes I'm getting unpredictable values from new heading value. I've tried enabling locationManagerShouldDisplayHeadingCalibration, filtering out inaccurate headings using newHeading.headingAccuracy and adjusting locationManager.headingFilter, but to no use.
First, is the newHeading value from locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) only accurate if a device is held like a compass? Or do I have to constantly monitor the device's orientation and update locationManager.headingOrientation in order to get the accurate heading value?
Second, is relying on the course property in CLLocation alone reliable enough to obtain the true north heading value if locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) is not used? I understand that it requires distance to obtain an accurate course value, but obtaining such a value while stationary is less of a concern since this is for an automobile's navigation app and a car is less likely to rotate while stationary.
Third, I'm currently using the trueHeading value, but would using the magneticHeading value increase the accuracy when it comes to different orientation of a device?
Источник: https://stackoverflow.com/questions/781 ... orth-value
Currently using both CLLocation's course (CLLocationDirection) property as well as the new heading value provided by func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) to obtain the true north value for a navigation app. Former is useful when the user is mobile whereas the latter is useful when the user is rotating while stationary. However, sometimes I'm getting unpredictable values from new heading value. I've tried enabling locationManagerShouldDisplayHeadingCalibration, filtering out inaccurate headings using newHeading.headingAccuracy and adjusting locationManager.headingFilter, but to no use.
First, is the newHeading value from locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) only accurate if a device is held like a compass? Or do I have to constantly monitor the device's orientation and update locationManager.headingOrientation in order to get the accurate heading value?
Second, is relying on the course property in CLLocation alone reliable enough to obtain the true north heading value if locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) is not used? I understand that it requires distance to obtain an accurate course value, but obtaining such a value while stationary is less of a concern since this is for an automobile's navigation app and a car is less likely to rotate while stationary.
Third, I'm currently using the trueHeading value, but would using the magneticHeading value increase the accuracy when it comes to different orientation of a device?
Источник: https://stackoverflow.com/questions/781 ... orth-value
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение