Code Monkey home page Code Monkey logo

filters's Introduction

Filters

Generalized implementation of some flavours of Bayesian Filters.

This package provides the following filters:

  • Augmented Unscented Kalman Filter (AUKF)
  • Unscented Kalman Filter (UKF)
  • Square Root Unscented Kalman Filter (SRUKF)

Usage

All the filters in this package have a common API:

import numpy as np
import time
from Filters import AUKF
from <YOUR_MODEL> import state_transition, output_transition, postprocessing
from <YOUR_SENSOR> import get_measurement

# Initialization
state_dim = 6  # site of state
output_dim = 3  # size of outputs
noise_dim = 3  # size of process noise state variables
deltaT = 0.1  # step time in seconds

filter = AUKF(state_dim, noise_dim, output_dim)

# initialize transition functions
filter.init_io(state_transition, output_transition, postprocessing)

# initialize state
x0 = np.random.rand(state_dim).T  # initial state mean
C0 = 1e4 * np.eye(state_dim)  # initial state covariance

# initialize augmented state
n0 = np.random.rand(noise_dim).T  # initial process noise mean
Q0 = 1e-4 * np.eye(noise_dim)  # initial process noise covariance

filter.init_state(x0, C0, n0, Q0)

while True:
    t0 = time.time()
    measurement, covariance = get_measurement()
    x_estimate, C_estimate = filter.step(deltaT, measurement, covariance)
    print('Estimate: ', x_estimate)
    sleep(deltaT + t0 - time.time())

filters's People

Contributors

leocencetti avatar

Watchers

 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.