Coder Social home page Coder Social logo

Comments (12)

vincentneo avatar vincentneo commented on May 16, 2024 1

Hi all,

I have created a branch (trial/ActivityType), which should make testing activity type easier.
Activity type can be changed via preferences.

from ios-open-gpx-tracker.

merlos avatar merlos commented on May 16, 2024

Hi @jkristinsson, you are right, this is something that was reported by another user and I also noticed. I think that has started to happen lately.

My guts say that it may be something related with how the OS provides the location I reviewed the application code and Apple Developer docs, and my guess is that it may be related with activity type setting. I use the default one (other) which I understand it should not stick to the road... but more test and research is required.

A couple of links for future reference:
https://developer.apple.com/documentation/corelocation/cllocationmanager/1620567-activitytype

https://developer.apple.com/documentation/corelocation/clactivitytype?language=swift

The default value of this property is CLActivityType.other. Note that when the value of activityType is CLActivityType.fitness, indoor positioning is disabled.

Thanks, best, Juan.

from ios-open-gpx-tracker.

jkristinsson avatar jkristinsson commented on May 16, 2024

Yeah, I was also thinking it could be the desiredAccuracy, but you seems to be using kCLLocationAccuracyBest and not kCLLocationAccuracyBestForNavigation which I would expect that behavior from.

https://developer.apple.com/documentation/corelocation/cllocationaccuracy

from ios-open-gpx-tracker.

merlos avatar merlos commented on May 16, 2024

Revisiting this issue, and after a couple of tests with current implementation which uses CLActivityType.other. My guesses are the following:

  • Other seems to have some kind of logic to set one of the other statuses (fitness, automotiveNavigation, airborne)
  • Some attributes that it uses are:
    • Closeness to a way (road, railway).
    • Type of road (roads have more "attraction" than railways).
    • Speed (while running or walking does not seem to snap).
    • Railways neither.
      IMG_3563

My current guess is that fitness mode may be the most close to user GPS real position, but tests within a car vs walking are required.

If the previous assumption is true. The solution may be to add a switch preference to allow user to change from other to fitness.

from ios-open-gpx-tracker.

vincentneo avatar vincentneo commented on May 16, 2024

Considering that the activity type is now user changeable from #113, I assume its ok to close this issue now.

from ios-open-gpx-tracker.

atorger avatar atorger commented on May 16, 2024

Just a question from a fellow developer, did you ever get this to work? I have problems with map matching / road snapping in my own app happening regardless of activity type used. I don't have any modern hardware to test on though, only iOS 10 and 11. Very hard to find information about this issue.

from ios-open-gpx-tracker.

wgrand avatar wgrand commented on May 16, 2024

There are some helpful insights on this blog: http://regex.info/blog/2015-12-03/2651, http://regex.info/blog/2016-01-19/2666.

from ios-open-gpx-tracker.

atorger avatar atorger commented on May 16, 2024

There are some helpful insights on this blog: http://regex.info/blog/2015-12-03/2651, http://regex.info/blog/2016-01-19/2666.

Thanks. I had actually found those blog posts before but they are from 2015-2016 and there have been a bunch of iOS versions since. I've searched the Internet quite thoroughly on this issue, and this is why I found this github issue which is one of the most recent references.

There are rather few mentions out there and I'm a bit surprised that it would not turn up more often if iOS location service is this quirky. I haven't found any official response from Apple either, ie official method to disable map matching / road snapping. I'll try to get hold of someone that has a recent iPhone so I can test with that. I suspect that maybe this problem has gone away with newer versions of the iOS (and that's why there are quite few mentions), but I haven't found any confirmation on that either.

from ios-open-gpx-tracker.

wgrand avatar wgrand commented on May 16, 2024

At the company where I work, we record driving trips for usage-based insurance. This snap behavior is alive and well on iOS 13, and it has not changed. And yes, information about it is incredibly sparse! I can't find anything either.

Furthermore, we recently observed that the GPS speed will snap to 0 when the device moves at around 1mps and when CoreMotion reports that it detects the automotive activity type. This took us by surprise because we made the assumption that CoreLocation and CoreMotion were independent services, but they appear to work together under the hood.

from ios-open-gpx-tracker.

atorger avatar atorger commented on May 16, 2024

Thanks, very interesting... well, I guess if I as an app developer can't make it work in any different way, I just have to live with that the app works better on Android and make a note in the manual or something. I have made the app cross-platform using Cordova and I noted this behavior when I made a test bicycle ride with both an Android and iOS device. The Android followed the actual path (with the expected accuracy limitations), while the iOS device took some "creative" paths by following bigger nearby roads here and there and then jumping back to the actual location when getting far enough away from the big road.

I'm just a hobbyist, not much I can do to convince Apple to adjust their APIs. I wonder what the big players in fitness apps have done, like Strava, if they have the same problem in their app or if they've found some way around it. Dedicated GPS devices (Garmin, Wahoo etc) for fitness activities are very popular today though so maybe that's why there's not much mention about the phone not working well for that.

from ios-open-gpx-tracker.

jkristinsson avatar jkristinsson commented on May 16, 2024

from ios-open-gpx-tracker.

atorger avatar atorger commented on May 16, 2024

Hello again,

I found out the problem I had in my app. The Cordova plugin I was using had a bug, meaning that regardless of activityType setting it reset it to AutomotiveNavigation when calling Core Location, no wonder it snapped to roads.

With that fixed, Fitness seems to work without road snapping, at least from my brief testing. I'll report the bug upstream to the plugin maintainer. Sorry for messing about here, I should have debugged the plugin properly first...

from ios-open-gpx-tracker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.