rlabbe / filterpy

Python Kalman filtering and optimal estimation library. Implements Kalman filter, particle filter, Extended Kalman filter, Unscented Kalman filter, g-h (alpha-beta), least squares, H Infinity, smoothers, and more. Has companion book 'Kalman and Bayesian Filters in Python'.
MIT License
3.31k stars 617 forks source link

EKF: state and measurement functions dose not accept variables other than x #211

Closed DeepakIngole closed 3 years ago

DeepakIngole commented 4 years ago

Hi,

I would like to use EKF for nonlinear system which has state function H_of(x, u, T, t) and measurement function h(x, u, tau). I am referring to the test_ekf.py file. I have defined these function and trying to call in rk.update(asarray([z]), H_of, hx, R=hx(rk.x)*proccess_error) but it throws error as TypeError: H_of() missing 3 required positional argument: 'u', T', and 't'. I also tried rk.update(asarray([z]), H_of(rk.x,u,T,t), hx, R=hx(rk.x,u,tau)*proccess_error) but this is also not working and getting error as H = HJacobian(self.x, *args) TypeError: 'numpy.ndarray' object is not callable.

Would you please help me to use EKF for the above system. Thanks.

rlabbe commented 3 years ago

I can't help without seeing source code. But I think you should look at the optional parameter hx_args, which lets you pass in extra parameters to your Hx function.

rlabbe commented 3 years ago

Closing due to no further response.