Coder Social home page Coder Social logo

Comments (17)

pmwisdom avatar pmwisdom commented on June 10, 2024

I don't have any control over which GPS points get sent back via the Native API's. GPS inaccuracies can be caused by a bunch of different things, including your location.

Can you elaborate on what you mean by "track isnt smooth".

What platform are you using (Android / iOS) ?
What are the accuracy readings that you get back in the location passed back through the location update callback?

from cordova-background-geolocation-services.

Stepo45 avatar Stepo45 commented on June 10, 2024

Hi, below is a screenshot of my previous tracking. I think you see whats going on. (I was driving accross the "yellow" road (Hodoninska) towards the blue marker, and this is how my route got tracked.
Tested on Android (on more devices with same, or similar unaccurate results).

Accuracy readings coming in a while.

screenshot_2016-06-14-19-32-54

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

If its device agnostic I'd like to say its probably that your hitting an area with bad GPS, but the accuracy readings will tell us if its the plugins problem or the GPS's problem.

from cordova-background-geolocation-services.

Stepo45 avatar Stepo45 commented on June 10, 2024

Accuracy: unfortunately, I didn't store accuracy in this tracking. But currently, while moving around the building, I'm getting various numbers from 5 to 95. Maybe I should give it a try once again, and make a few kilometer driving to check it. I'm in a location with standard GPS signal, other applications are tracking my movement well.

from cordova-background-geolocation-services.

Stepo45 avatar Stepo45 commented on June 10, 2024

OK, I made a test drive around a block, which gave me a bit better (but still not accurate) results, and the accuracy was like 6 (average). The highest number I received was 109.43, lowest was 5.

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

The other applications your using might also be throwing away GPS positions with low accuracy (higher accuracy numbers mean less accurate). If you get coordinates back over 70 accuracy I would throw them away.

On android especially, the coordinates you get passed back are out of my hands, that is up to the device and android Location libraries, the configuration you have is the most accurate you can go on android.

The most important being :

desiredAccuracy: 0

Which translates to give me the most accurate results and put all the power you can into the GPS.

from cordova-background-geolocation-services.

Stepo45 avatar Stepo45 commented on June 10, 2024

Yes, that's good idea to throw the inaccurate coordinates away. I'll try this right away and post you the results.

from cordova-background-geolocation-services.

Stepo45 avatar Stepo45 commented on June 10, 2024

OK, I was able to get better results, by some tweaking of result coordinates data set. I'm not displaying inaccurate results, and moreover, I'm checking the distance between two adjacent coordinates. If they're too far away, I will not display the second one.
Haven't you thought about implementing "Location.distanceBetween()" inside the plugin?
(you'll not send coordinate, which is too far away from the previous one).

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

I'm glad you were able to get better results!

There isn't really a reason to implement that in the native code since you can do so just as easily via JavaScript and everyone has different requirements from the plugin. I want to leave the plugin as open and broad as possible.

I would implement it if there was a good enough reason of why it couldn't / would be harder to do via JavaScript.

from cordova-background-geolocation-services.

sepideh68 avatar sepideh68 commented on June 10, 2024

Hi pmwisdom and Stepo45 , I have the same problem when tracking, specially with android. Stepo45 can you show how you are checking the distance between two adjacent coordinates?
The program that I am developing is Cordova base and it should support all the functionality same for both iOS and Android.
With iOS sometimes is it good and sometimes it is not working good. I have attached the same track with different result on iOS. here is my configure:
desiredAccuracy: 0, distanceFilter: 3, debug: true, interval: 1000, fastestInterval: 1000, useActivityDetection: true

sample2

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

@sepideh68 Its very simple. You can use the formula in this stack overflow.

http://stackoverflow.com/questions/27928/calculate-distance-between-two-latitude-longitude-points-haversine-formula

from cordova-background-geolocation-services.

sepideh68 avatar sepideh68 commented on June 10, 2024

@pmwisdom I am receiving almost accurate coordinates on iOS but it is not working on android.
Is it because of config I am using?! If so why it is working good on iOS?! I am developing my app with ionic. here is the code I have put on ionic.Platform.ready function:

 ionic.Platform.ready(function(){
 cordova.plugins.backgroundMode.enable();
cordova.plugins.backgroundMode.onactivate = function () {
bgLocationServices.start();
$scope.isBackground = true;
           }
     cordova.plugins.backgroundMode.ondeactivate = function () {
    bgLocationServices.stop();  
    $scope.isBackground = false;
            }
    navigator.geolocation.getCurrentPosition(function(p){}); // it is required
    bgLocationServices =  window.plugins.backgroundLocationServices;

    //Congfigure Plugin
    bgLocationServices.configure({
               //Both
                 desiredAccuracy:      0, 
                 distanceFilter:       0, 
                 debug:                false, 
                 interval:             2000, 
                 fastestInterval:      1000, 
                 useActivityDetection: false,
                 notificationTitle: '', // customize the title of the notification
                 notificationText: '', //customize the text of the notification     
            });

    bgLocationServices.registerForLocationUpdates(function(location) {
        if($scope.started){
        var position = encapsulateLocation(location);
        showPosition2(position);
            }
      }

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

@sepideh68 Please fix your styling and be more specific. Show me some coordinates on android vs iOS.

Also why are you using the cordova backgroundMode plugin? It might be unwise to do so with this plugin since it starts another service in the background.

from cordova-background-geolocation-services.

sepideh68 avatar sepideh68 commented on June 10, 2024

@pmwisdom I am using cordova backgroundMode plugin to enable tracking when background is activate and user started the geolocation. Does it have conflict with your plugin?! BTW I want to collect Gyro and Accelerometer data even if user is on backgroundMode. Here is the result of same route:

randroid
riphone

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

@sepideh68 My plugin has the effect of keeping your app alive for however long you are tracking with it, so you don't need the background mode plugin. I don't know if its causing conflict but I would remove it.

Also, try starting the background plugin before you transition to the background, and before the will resign callback.

from cordova-background-geolocation-services.

srsarcasmo avatar srsarcasmo commented on June 10, 2024

@pmwisdom
Because ios does not compile the app when I add the plugin to work?

help me.. @sepideh68

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

@srsarcasmo This is a completely unrelated issue. Please do not spam the other issues.

from cordova-background-geolocation-services.

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.