Kalman Filter Implementation

Nov 14, 2003 4 Replies

Hi All,



I am looking to use a kalman filter to predict the motion of a throw ball. I was wondering if anybody knew of a java implementation of the broad outline of the equations involved in kalman filters, or any specific examples of a java app / set of classes that have a kalman filter.



I am new to this field so don't be too harsh if I say something stupid. I know that obviously the filter is specific to the system modelled, but I don't want to waste time and effort reinventing the wheel of the broader setup that kalman filter follow.



Secondly, does anybody want to suggest the probable matrices I require for the physics part of this task, with the ball moving under gravity and air resistance.



Adam


To the best of my knowledge a Kalman filter relies on regular updates of various instrumentation readings during movement to do a best estimate. If you are merely trying to project the trajectory of a ball based on parameters at the time of the balls release, and no updates during the flight of the ball, then I don't think a Kalman filter is of any benefit.

TC

Hi There,

I have done some further reading, and now have some idea of what is required. And yes it is easy to implement it in a programming language, now that I know the controlling equations.

My question now is, that I have created a simple setup, with the ball just travelling at a constant velocity in the 3 directions. I am for the moment ignoring air resistance, gravity etc.

What I need now to do is calculate / state the initial values in the Q,P and R matrices. What do I do for this, pick some values that a reasonable? OR is there a better way? For Instance, I don't know the measured error for the initial point(s), only that say the error isn't going to metres wrong, more like a few cm.

You need to know some physics.

formatting link
Here you will find more than you ever wanted to know about trajectories.

formatting link

People often complain that Kalman filters have a large start up cost associated with them. What they are saying is that the it takes time for the Q, P and R matrices take a number of iterations to converge to somewhat constant values. The number of iterations is proportional to how poor your intitial estimates are.

You may also wish to look at a alpha-beta-gamma filter, which is like a Kalman filter but with constant gains. This works well if you have an accurate model of the dynamics.

-paul

Paul Oh Boondog Automation

formatting link

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required