Skip to content

My implementation of kalman filter, which is a very powerful tool in self-driving car and robotics

Notifications You must be signed in to change notification settings

accuracy-maker/kalmanFilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Kalman Filter Implementation

This project implements a Kalman Filter to process data from sensors. The Kalman Filter is a powerful tool for estimating the state of a system based on noisy measurements. This implementation demonstrates how to initialize, predict, and update the state estimates using the Kalman Filter.

Table of Contents

Overview

The Kalman Filter is implemented in Python and is designed to handle a state vector of arbitrary dimensions. The filter can be used to process sensor data and provide estimates of the true state of the system.

Requirements

  • Python 3.x
  • NumPy
  • Matplotlib

Setup

  1. Clone the repository:

    git clone https://github.com/your-username/kalman-filter.git
    cd kalman-filter
  2. Install the required packages:

    pip install numpy matplotlib

Usage

  1. Run the kalman_filter.py script to see the Kalman Filter in action:

    python kalman_filter.py
  2. The script will simulate some sensor data, process it using the Kalman Filter, and display the results.

Output

The output will include plots of the measurements and the Kalman Filter predictions for each component of the state vector.

Kalman Filter Output

Explanation

Kalman Filter Class

The KalmanFilter class implements the Kalman Filter algorithm. It includes methods for initialization, prediction, and update.

  • Initialization (__init__): Sets up the state transition matrix F, control matrix B, initial state estimate x, covariance matrix P, process noise covariance Q, measurement noise covariance R, and measurement matrix H.
  • Prediction (predict): Computes the predicted state estimate and covariance matrix based on the state transition matrix and control input.
  • Update (update): Updates the state estimate and covariance matrix using the measurement vector z.

Main Script

The main script demonstrates the usage of the KalmanFilter class by simulating some sensor data and processing it using the filter. It plots the measurements and the filter's predictions for comparison.

  • Simulated Data: The script simulates a true state vector and adds noise to generate measurements.
  • Kalman Filter Processing: The filter processes the measurements to provide estimates of the true state.
  • Plotting Results: The results are plotted to visualize the filter's performance.

References

About

My implementation of kalman filter, which is a very powerful tool in self-driving car and robotics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages