Giter Club home page Giter Club logo

Comments (6)

infusion avatar infusion commented on May 29, 2024 1

Hey,
I am glad you find it useful! It is an interesting use case, what receiver are you using? Or are you trying to merge 4 receivers at 10Hz?

The thing is, that the state object should serve as a small layer on top of each NMEA sentence to help in the average case, which makes the idea of multiline message passing a bit of an overkill to add.

Furthermore, the question is, if averaging is the natural thing to do. It does not take the deviation in each update step into account, and if you do, you naturally come to Kalman Filters instead of averaging. I was thinking a lot to add a Kalman Filter to clean the state object, but decided to add it only as an example to the map example since in the general case you can't assume a constant timing of the sentences (like in your case) and the more important part: The KF would be too simple, to just filter the noise instead of using a proper model.

All in all, I would suggest to ignore the state object for your use case, subscribe to the data event and create an own state object, maybe in a similar fashion like the library itself does.

Robert

from gps.js.

infusion avatar infusion commented on May 29, 2024 1

Kalman Filters are in a way an overkill, and it is also true that Kalman Filters are hard to grasp. I said it leads naturally to Kalman Filters, since an "average filter" that you would implement by averaging is one assumption about what to do with deviating data. Such a filter is good if you want the result converge to a value, like calibrating a scale. An alternative would be a low pass filter, where you say

pos = prev_pos * alpha + (1 - alpha) * new_pos

The Kalman Filter now can be seen in a similar way, that alpha, which is constant in low pass filters, depends on the variance. So yes, you can use Kalman Filters to filter against a model (and therefore fuse information from different input) or you treat it only in the basic form of filtering with a varable alpha. It is still a lot of tuning, and at such a high rate a low pass filter could be enough (with a manually tuned alpha between 0 and 1), but the best way would be a KF, as you operate in a dynamic environment.

from gps.js.

micaminoff avatar micaminoff commented on May 29, 2024

Hey,

Thanks for taking the time not only to comment on the idea but providing me with suggestions for how to handle my case. Unfortunately I don't have the specs of the receiver, I just receive a package with sentences over websocket so some processing has already been done.

I agree with your assessment that the addition of noise filtering and collection support is probably not needed in the library itself.
Thanks for the hints, I'll look into Kalman Filters more closely.

from gps.js.

micaminoff avatar micaminoff commented on May 29, 2024

Hmm, Kalman filters might be a bit overkill for my case as well, the implementation and examples I can find seem to deal with predicting the next location and correcting based on the prediction and the input (and some other stuff). What I really need is a good enough and fast enough calculation of the "correct" location based on the data in each package.

I'm still thinking averaging because with 10 sentences any reasonable outliers' effect will be mitigated. I'll probably still need a way to filter significant outliers.

from gps.js.

infusion avatar infusion commented on May 29, 2024

If you want an reference implementation of a KF, have a look at the maps example that is shipped with gps.js

from gps.js.

micaminoff avatar micaminoff commented on May 29, 2024

Thanks again for going out of your way to help me out! I guess I just have to bite the bullet and learn KF if I want accurate data.

from gps.js.

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.