Comments (6)
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.
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.
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.
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.
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.
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)
- "Satelites" should be spelled "satellites" HOT 3
- Using with gpsd HOT 1
- Serial port closes after some time and gps.js randomly throws errors HOT 5
- Types are missing on npm release HOT 1
- Invalid GGA Fix For new GPS HOT 3
- zed-f9P ardusimple compatibility HOT 64
- Invalid GLL length HOT 2
- solution for make the weft more reliable ? HOT 9
- Invalid GGA length HOT 1
- Consider using your own Fraction.js as a dependency HOT 13
- GPS.DISTANCE returns distance in km rather than meters as specified in the function protoype. HOT 2
- can you add altitude to kalman filter? HOT 1
- Error: Invalid RMC length HOT 6
- TS typo HOT 1
- GSV merge is inconsistent, "blinking" satsVisible / it disappears and reappears. HOT 28
- regarding previous Issue on kalman filter HOT 5
- Issue parsing BDGSV HOT 1
- GDOP and Hv HOT 9
- Adding state['heading'] for $GPHDT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gps.js.