Giter Club home page Giter Club logo

simplekalman's Introduction

SimpleKalman

SimpleKalman is a very simple 1-dimensional Kalman filter that is written as clearly as possible as a soft introduction.


Here's the setup: You have a very simple robot on a track that has two (noisy) sensors:

  • An odometry sensor that tells you how far your robot has moved since the last timestep
  • An absolute sensor that tells you the actual position of the robot. Also, this sensor can only be read every 20 timesteps.

Remember, both of these sensors are noisy, and won't give particularly precise readings. Note, however, that the sensors have different characteristics that we would like to take advantage of:

  • The odometry sensor can be read very quickly, and so we can use it to update our estimated position on every timestep. Unfortunately, because it only tells us the distance it thinks we've traveled since the last timestep, relying on this sensor alone will cause us to drift! Check out the green circles in the plot to see what happens when we just integrate our velocity.
  • The measurement sensor can only be read slowly, and has larger noise than the odometry, however it's noisy readings are always centered around the true position of the robot. This means that the readings from the measurement sensor will never drift off to Mars.

The point of a Kalman filter is to "optimally" integrate these two kinds of sensors, trying to take advantage of their best characteristics. It does this by keeping track of the current amount of noise in the system, and then mixing in measurements according to how much noise they will introduce.

Running

Running SimpleKalman is easy - just fire up MATLAB or Octave, cd to the directory of this repo, and type "SimpleKalman".

A plot window should pop up, showing the robot's actual trajectory in blue.

As the simulation runs, you should see:

  • Green circles showing what our prediction would look like if we just integrated the odometry (pretty bad, right? Check out that drift!)
  • Red stars showing the occasional measurements. Notice how they're usually pretty inaccurate.
  • Black dots showing the Kalman filtered prediction.

Try messing around with the variables processNoise and measurementNoise in SimpleKalman.m, and note what effect they have on our filter's output.

Learn More!

simplekalman's People

Contributors

randvoorhies avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.