Skip to content
Some Python Implementations of the Kalman Filter
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.ipynb_checkpoints GPS Trigger fix Oct 23, 2017
Formulas EKF Attitude Mar 12, 2014
2014-02-14-002-Data.csv
2014-03-26-000-Data.csv
2016-08-09-Motorbike.csv
2016-09-12-Leaning.csv
2016-09-12-Leaning2.csv
Adaptive-Kalman-Filter-CV.ipynb IPython 4.0 and Sympy 1.0 Update May 9, 2016
Adaptive-Kalman-Filter-CV.py IPython 4.0 and Sympy 1.0 Update May 9, 2016
CTRV-Model.png
Extended-Kalman-Filter-CHCV-Position.png
Extended-Kalman-Filter-CHCV-State-Estimates.png
Extended-Kalman-Filter-CHCV.ipynb
Extended-Kalman-Filter-CHCV.kmz
Extended-Kalman-Filter-CHCV.pdf CHCV Rendered and PDF Mar 12, 2018
Extended-Kalman-Filter-CHCV.py
Extended-Kalman-Filter-CTRA-State-Estimates.png
Extended-Kalman-Filter-CTRA.ipynb
Extended-Kalman-Filter-CTRA.kmz
Extended-Kalman-Filter-CTRA.py
Extended-Kalman-Filter-CTRV-State-Estimates.png
Extended-Kalman-Filter-CTRV.ipynb
Extended-Kalman-Filter-CTRV.kmz GPS Trigger fix Oct 23, 2017
Extended-Kalman-Filter-CTRV.py GPS Trigger fix Oct 23, 2017
Extended-Kalman-Filter-CTRV.slides.html
Extended-Kalman-Filter-CTRV2.ipynb Constant Heading and Constant Velocity EKF Feb 21, 2018
Extended-Kalman-Filter-CTRV2.py
Extended-Kalman-Filter-Step.png
Kalman-Filter-Bike-Lean-Angle.ipynb
Kalman-Filter-Bike-Lean-Angle.py
Kalman-Filter-CA-2.ipynb Jupyter Notebook Slideshow ready May 11, 2017
Kalman-Filter-CA-2.py Jupyter Notebook Slideshow ready May 11, 2017
Kalman-Filter-CA-2.slides.html Jupyter Notebook Slideshow ready May 11, 2017
Kalman-Filter-CA-Ball-StateEstimated.png IPython 4.0 and Sympy 1.0 Update May 9, 2016
Kalman-Filter-CA-Ball-Trajectory.png IPython 4.0 and Sympy 1.0 Update May 9, 2016
Kalman-Filter-CA-Ball.ipynb IPython 4.0 and Sympy 1.0 Update May 9, 2016
Kalman-Filter-CA-Ball.py IPython 4.0 and Sympy 1.0 Update May 9, 2016
Kalman-Filter-CA-CovarianceMatrix.png
Kalman-Filter-CA-Measurements.png
Kalman-Filter-CA-Position.png Jupyter Notebook Slideshow ready May 11, 2017
Kalman-Filter-CA-RealMeasurements.py
Kalman-Filter-CA-StateEstimated.png Jupyter Notebook Slideshow ready May 11, 2017
Kalman-Filter-CA.ipynb
Kalman-Filter-CA.py
Kalman-Filter-CV.ipynb
Kalman-Filter-CV.py
Kalman-Filter-CV.slides.html
Kalman-Filter-Step.png
README.md
car-model.dae

README.md

Multidimensional Kalman-Filter

See Vimeo for some Explanations. Or if you want to start with the basics, you might want to take a look at these Blogposts:

Some Python Implementations of the Kalman Filter

Kalman Filter Step

Kalman Filter with Constant Velocity Model

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 ~ See Vimeo

Kalman Filter with Constant Acceleration Model

in 2D

Situation covered: You have an acceleration sensor (in 2D: $\ddot 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 ~ See Vimeo

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 ~ See Vimeo

in 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.

Kalman 3D

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

Kalman Filter for Motorbike Lean Angle Estimation

Also know as the Gimbal Stabilization problem: You can measure the rotationrate, but need some validation for the correct lean angle from time to time, because simply an integration of the rotationrate adds up a lot of noise. There comes the vertical acceleration, which is a pretty good estimator for the angle in static situations. This Kalman Filter implementation fuses both together with some adaptive components.

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.

State Vector

View IPython Notebook ~ See Vimeo

Extended Kalman Filter with Constant Heading and Constant Velocity (CHCV) Model

Situation covered: You have the position (x & y) from a GPS sensor and extimating the heading direction (ψ) and the velocity (v).

View IPython Notebook

Extended Kalman Filter with Constant Turn Rate and Acceleration (CTRA) Model

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

View IPython Notebook

License

CC-BY-SA2.0 Lizenz

You can’t perform that action at this time.