Skip to content
/ Kalman Public
forked from balzer82/Kalman

Some Python Implementations of the Kalman Filter

Notifications You must be signed in to change notification settings

mahowik/Kalman

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multidimensional Kalman-Filter

Some Python Implementations of the Kalman Filter

####See Vimeo for some Explanations.

Kalman Filter Step

Kalman Filter with Constant Velocity Model

State Vector

Situation covered: You drive with your car in a tunnel and the GPS signal is lost. Now the car has to determine, where it is in the tunnel. The only information it has, is the velocity in driving direction. The x and y component of the velocity (x˙ and y˙) can be calculated from the absolute velocity (revolutions of the wheels) and the heading of the vehicle (yaw rate sensor).

####View IPython Notebook

Kalman Filter with Constant Acceleration Model

2D

State Vector

Situation covered: You have an acceleration sensor (in 2D: x¨ and y¨) and try to calculate velocity (x˙ and y˙) as well as position (x and y) of a person holding a smartphone in his/her hand.

####View IPython Notebook

Second example is the same dynamic model but this time you measure the position as well as the acceleration. Both values have to be fused together with the Kalman Filter. Situation covered: You have an acceleration sensor (in 2D: x¨ and y¨) and a Position Sensor (e.g. GPS) and try to calculate velocity (x˙ and y˙) as well as position (x and y) of a person holding a smartphone in his/her hand.

####View IPython Notebook

3D

Third example is in 3D space, so the state vector is 9D. This model is for ball tracking or something else in 3D space.

State Vector

####View IPython Notebook

Adaptive Kalman Filter with Constant Velocity Model

Here the Measurement Covariance Matrix R is calculated dynamically via the maximum likelihood of the acutal standard deviation of the last measurements.

####View IPython Notebook

Extended Kalman Filter

EKF Filter Step

Extended Kalman Filter with Constant Turn Rate and Velocity (CTRV) Model

Situation covered: You have an velocity sensor which measures the vehicle speed (v) in heading direction (ψ) and a yaw rate sensor (ψ˙) which both have to fused with the position (x & y) from a GPS sensor.

CTRV Model State Vector

####View IPython Notebook

Adaptive Extended Kalman Filter with Constant Turn Rate and Velocity (CTRV) Model

Situation covered: You have an velocity sensor which measures the vehicle speed (v) in heading direction (ψ) and a yaw rate sensor (ψ˙) which both have to fused with the position (x & y) from a GPS sensor.

Because of poor GPS signal quality, the position measurement is pretty inaccurate. Especially, when the car is standing still, the position error is high. Therefore, an Adaptive Extended Kalman Filter is used here. It calculates the measurement noise covariance R in every filterstep depending on the speed and EPE (Estimated Position Error from GPS).

Adaptively calculated R

The trajectory is exportet to a .kmz, which can best viewed with Google Earth.

####View IPython Notebook

Adaptive Extended Kalman Filter with Constant Turn Rate and Velocity (CTRV) Model and Attitude Estimation

State

Roll and pitch are estimated as well.

####View IPython Notebook

About

Some Python Implementations of the Kalman Filter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published