Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to update only certain values of Z? #150

Closed
joaqo opened this issue Jul 24, 2018 · 2 comments
Closed

Is there a way to update only certain values of Z? #150

joaqo opened this issue Jul 24, 2018 · 2 comments
Labels

Comments

@joaqo
Copy link

joaqo commented Jul 24, 2018

Hey, just started using the library and I'm finding it super useful. There's just one thing I haven't been able to figure out. I am using a kalman filter which has a Z that agglomerates several sensors, but they are not all updated at the same time, some are updated more frequently than others.

I want to know if I can update only some on each update step. I tried setting the ones I dont wan't to update to nan but I don't think thats working correctly.

Thanks!

@rlabbe
Copy link
Owner

rlabbe commented Jul 24, 2018

You have to think it through based on what you are trying to do. Predict just predicts via your plant model, update incorporates a measurement by comparing the error to the prediction at that same time step. You may, for example, need to alter F in the input to predict() to account for the different time steps between measurements, and you may need to alter H on every call to update based on which sensor you are using. In pseudo code it might read

#get sensor 1
F = compute_f(dt)
kf.predict()
kf.update(z1, R=R1, H=H1)

#get sensor 2
F = compute_f(dt)
kf.predict()
kf.update(z2, R=R2, H=H2)

#get sensor 2 again
F = compute_f(dt)
kf.predict()
kf.update(z2, R=R2, H=H2)

and so on.

@joaqo
Copy link
Author

joaqo commented Jul 24, 2018

That makes a lot of sense! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants