GithubHelp home page GithubHelp logo

ivo-georgiev / ukflib Goto Github PK

View Code? Open in Web Editor NEW
56.0 5.0 25.0 9.85 MB

Unscented Kalman Filter (UKF)

License: MIT License

C 89.18% MATLAB 10.66% CMake 0.11% Makefile 0.05%
ukf kalman s-function sigma-point-kalman-filter c estimation simulink matlab

ukflib's Introduction

ukfLib: Unscented Kalman filter C library

Посвещавам тази работа на моите любими деца! Приятно пътуване във времето, когато бяхте съвсем мънички! Нека искрата на живота разпали във вас огън от любознателност, старателност, решителност и доброта. Учете се от всеки който може и иска да сподели с вас знание. Обичайте се и се доверявайте най-вече на себе си! Обичам ви толкова много, Тати!

The idea of the library is to deliver free open source C implementation on UKF with different examples, documentation and GUI for easy filter configuration. Currently there are two available examples. They show how to use code and how to import and test it as s-function in Simulink(optional). My wish is to extend and test UKF library with more examples from different areas in order to be useful for more people. Any ideas, feedback and help are welcome.

What is included:

  • mtxLib.c, mtxLib.h : Library with some basic matrix functions required for UKF implementation(cholesky decomposition, matrix inversion, matrix operation, i.e).
  • ukfLib.c, ukfLib.h : Unscented Kalman filter implementation.
  • ukfCfg.c,ukfCfg.h : These files contain UKF matrix and mathematical state space models/equation(state and measurement equations).They are specific for every different nonlinear filtering problem. In current project these files adress the issue from Matthew B Rhudy tutorial(Understanding Nonlinear Kalman Filters, Part II:An Implementation Guide): https://yugu.faculty.wvu.edu/files/d/2cbb566f-9936-4033-bb1c-6d887c30d45a/irl_wvu_online_ukf_implementation_v1-0_06_28_2013.pdf
  • ukfCfg1.c,ukfCfg1.h : This configuration is used for estimation of angle and angular speed of free pendulum.
  • ukfCfg2.c,ukfCfg2.h : nonlinear state estimation for the Van der Pol oscillator.
  • test2.c : file is used for both simulation and unit testing. It also show how filter should be initialized and used in practice.
  • Matlab model(R2013b) with s-fun for simulation and verification of each configuration(cfg1,cfg2,..,cfgN) in Simulink enviroment.This model use files listed above to build and simulate s-function.
  • Matlab GUI tool for easy filter configuration and automatic file generation(ukfCfgN.c ukfCfgN.h)

Why this project is useful:

  • There is not any specific external dependency. All needed sources are available in repository.
  • Implementation could be easy adapted for every different nonlinear filtering problem only by creation of own ukfCfgN.c,ukfCfgN.h files.
  • Implementation follow the prety good Matthew Rhudy tutorial step by step and solve the same example. Users could easy compare the difference between matlab and C implementation.
  • The project contain simulink model(R2013b) which show how s-function could be created(s-function builder) and simulated from given set of source files. There is two steps needed to simulate UKF filter in Simulink. First step is to load data in WS by running of ukf.m. The second step is to build s-fun and run simulink model. Filter behavior could be checked at every simulation step and compared with expected data generated from m-script implementation(applied also in tutorial).

For more information please see UKF wiki page: https://github.com/ivo-georgiev/ukfLib/wiki

View ivo-georgiev/ukfLib on File Exchange

ukflib's People

Contributors

ivand58 avatar ivo-georgiev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ukflib's Issues

UKF filter calculation diverge after 93.5 sec of s-fun simulation

How to reproduce the issue:

  1. Extend simulation time range in ukf.m till 160sec (N=1600)
  2. Set simulation time in Simulink model at 150sec.
  3. Run model and view scope with expected and observed states:
  • Expected result: During simulation expected and observed curves for system states should match each other with minimal deviation.
  • Observed result: First ~93.5 sec of simulation expected and observed curves are the same. After that time stamp significant deviation is observed, which soon lead to numerical filter diverge.

Note: It is strange that with different input stimulus and noise diverge always starts at 93.5 sec from simulation.

[30-Aug-2017] It seems like simulation issue. Simulation not change input signals(meas) on time stamp 93.5 i.e meas is the same for 93.4 and 93.5sec. Proposal to fix is rounding of time vector in ukf.m

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.