infusion / Kalman.js

A JavaScript Kalman filter library
31 stars 7 forks source link

three dimensions #2

Open vinnitu opened 5 years ago

vinnitu commented 5 years ago

Hello!

This example filters use only longitude and latitude, but not altitude

image

Can you help me to modify function?

Thanks

infusion commented 5 years ago

As I said, the GPS signal is not so useful for altitude measure. It is okay, but only with enough satellites in view. Best is to add another sensor and fuse it into the GPS signal using the KF. And yes I can help on that. I can also add altitude to the GPS example and you can test the result if you want.

vinnitu commented 5 years ago

it would be great! Thanks! I will test it

vinnitu commented 5 years ago

still nothing or I something missing?

infusion commented 5 years ago

I wanted to finish work on it today. Hope I can manage that schedule, latest tomorrow

useronym commented 3 years ago

I can't see where that initial example with 2D data was located, is it in a separate repository? And has there been any update on an example with fusing data from multiple sensors?

infusion commented 3 years ago

The original 2D example is from my gps.js package: https://github.com/infusion/GPS.js/blob/master/examples/maps/server.js

KF should be well studied to use it for sensor fusion. You must model the noise characteristics of the sensors well, you either need to model a physical system to fuse to, or you introduce a second "complementary" sensor (like fusing an accel and a gyro). The GPS example is pretty naive and only serves as a basic example to suppress too much jumps on the map.

useronym commented 3 years ago

Right, that makes sense. I'm trying to stabilise positioning data (1) coming in from one very noisy sensor with observation of change of position (2) from another, much more precise sensor. I know I could predict the new position (1) given the change (2) using the state transition matrix, but how can I express that if observed position change (2) was very small, then the noise from (1) should be "smoothed out" very strongly?

infusion commented 3 years ago

Basically, you can weight the accuracy by the variances of the sensors. Put the sensors flat on the table, measure the data over some time and calculate the variances which you put in Q and R (on the diagonal). This way less weight is put on the sensor with more noise. But all begins with a solid dynamics model which you put in A and B. Write down the equations and linearize it to fit your needs