Skip to content

Simple KF examples with simplified dynamics and noise + error, good for reference, teaching, and as a template for more software.

Notifications You must be signed in to change notification settings

Natsoulas/Kalman_Filter_Examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Kalman_Filter_Example ---------------------------------

Simple KF example with simplified dynamics and noise + error, good for reference, teaching, and as a template. Models for Kalman Filter and Extended Kalman Filter

Proof these examples demonstrate working KF algorithm implementations:

Kalman Filter for Position and Velocity Tracking

Figure_2

^Actual velocity is 60 m/s but initial estimate is set to 20. Clearly, it rises towars and sustains an estimate velocity near 60 m/s after only a few updates.

Figure_4

^Kalman Gains move towards a steady state as estimation process starts to converge, Velocity is only a little in favor of the estimate since it is 0.5 and close to an even weight of estimate and measurement whereas the position is significantly more favoring of the estimate due to the lower gain.

Figure_3

^Shows general filtering of measurement position error noise.

Extended Kalman Figure Example ----------------------------

Figure_3

^Actual velocity in x direction was set to be around 20 m/s with some added noise. Initial estimate was 0 m/s so it does approach that. What makes this an EKF example is that the state to measurement matrix is not linear. It is jacobian of polar to cartesian conversion. This would be a good example of a radar (polar sensor) being a the sensor that would update the filter. (y direction actual velocity set to around zero.

Figure_4

Figure_5

^these show that position error is mostly contained within 3-sigma (standard devations) for this example. Didn't spend time tuning Q matrix etc since this is just an example. However this code should be relatively easy to digest.

Credit is due to Franklin's Book: A Kalman Filter Made Easy, highly recommend the read for those who want to learn how to use and have intution for using a KF in relativley little time.

About

Simple KF examples with simplified dynamics and noise + error, good for reference, teaching, and as a template for more software.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages