├── .github └── workflows │ └── c-cpp.yml ├── .gitignore ├── .vscode └── launch.json ├── CMakeLists.txt ├── README.md ├── bin ├── cbia.lib.blas.dyn.rel.x64.12.dll ├── cbia.lib.blas.dyn.rel.x86.12.dll ├── cbia.lib.lapack.dyn.rel.x64.12.dll ├── cbia.lib.lapack.dyn.rel.x86.12.dll └── clean.bat ├── docs ├── html │ ├── Kalman_concept1.jpg │ ├── Kalman_concept2.jpg │ ├── _formulas.aux │ ├── _formulas.dvi │ ├── _formulas.log │ ├── _formulas.pdf │ ├── _formulas.tex │ ├── annotated.html │ ├── annotated_dup.js │ ├── bc_s.png │ ├── bdwn.png │ ├── class_e_k_f-members.html │ ├── class_e_k_f.html │ ├── class_e_k_f.js │ ├── class_e_k_f2-members.html │ ├── class_e_k_f2.html │ ├── class_e_k_f2.js │ ├── class_f_x-members.html │ ├── class_f_x.html │ ├── class_f_x.js │ ├── class_k_f-members.html │ ├── class_k_f.html │ ├── class_k_f.js │ ├── class_u_k_f-members.html │ ├── class_u_k_f.html │ ├── class_u_k_f.js │ ├── classes.html │ ├── closed.png │ ├── dir_6f9635d4fbfa321d4c00f29df5cd540c.html │ ├── dir_6f9635d4fbfa321d4c00f29df5cd540c.js │ ├── dir_dc133b73f91f0e3b4287924ed00a2a00.html │ ├── dir_dc133b73f91f0e3b4287924ed00a2a00.js │ ├── doc.png │ ├── doxygen.css │ ├── doxygen.svg │ ├── dynsections.js │ ├── ekf2_8cpp.html │ ├── ekf2_8h.html │ ├── ekf2_8h.js │ ├── ekf2_8h_source.html │ ├── ekf_8cpp.html │ ├── ekf_8h.html │ ├── ekf_8h.js │ ├── ekf_8h_source.html │ ├── ex1.png │ ├── ex10.png │ ├── ex4.png │ ├── ex7.png │ ├── files.html │ ├── files_dup.js │ ├── folderclosed.png │ ├── folderopen.png │ ├── functions.html │ ├── functions_func.html │ ├── functions_vars.html │ ├── fx_8cpp.html │ ├── fx_8h.html │ ├── fx_8h.js │ ├── fx_8h_source.html │ ├── globals.html │ ├── globals_defs.html │ ├── globals_func.html │ ├── index.html │ ├── jquery.js │ ├── kf_8cpp.html │ ├── kf_8h.html │ ├── kf_8h.js │ ├── kf_8h_source.html │ ├── main10_8cpp.html │ ├── main10_8cpp.js │ ├── main11_8cpp.html │ ├── main11_8cpp.js │ ├── main1_8cpp.html │ ├── main1_8cpp.js │ ├── main2_8cpp.html │ ├── main2_8cpp.js │ ├── main3_8cpp.html │ ├── main3_8cpp.js │ ├── main4_8cpp.html │ ├── main4_8cpp.js │ ├── main5_8cpp.html │ ├── main5_8cpp.js │ ├── main6_8cpp.html │ ├── main6_8cpp.js │ ├── main7_8cpp.html │ ├── main7_8cpp.js │ ├── main8_8cpp.html │ ├── main8_8cpp.js │ ├── main9_8cpp.html │ ├── main9_8cpp.js │ ├── mainpage_8dox.html │ ├── menu.js │ ├── menudata.js │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── navtree.css │ ├── navtree.js │ ├── navtreedata.js │ ├── navtreeindex0.js │ ├── open.png │ ├── resize.js │ ├── splitbar.png │ ├── sync_off.png │ ├── sync_on.png │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ ├── tabs.css │ ├── ukf_8cpp.html │ ├── ukf_8h.html │ ├── ukf_8h.js │ └── ukf_8h_source.html └── index.html ├── doxyconfig ├── images ├── Kalman_concept1.jpg ├── Kalman_concept2.jpg ├── ex1.png ├── ex10.png ├── ex2.png ├── ex3.png ├── ex4.png ├── ex5.png ├── ex6_outputs.png ├── ex6_states.png └── ex7.png ├── kalman-cpp.kdev4 ├── kalman ├── ekf.cpp ├── ekf.h ├── ekf2.cpp ├── ekf2.h ├── fx.cpp ├── fx.h ├── kf.cpp ├── kf.h ├── ukf.cpp └── ukf.h ├── m-files ├── plot_data1.m ├── plot_data10.m ├── plot_data11.m ├── plot_data2.m ├── plot_data3.m ├── plot_data4.m ├── plot_data5.m ├── plot_data6.m ├── plot_data7.m └── plot_data8.m ├── mainpage.dox ├── samples ├── main0.cpp ├── main1.cpp ├── main10.cpp ├── main11.cpp ├── main2.cpp ├── main3.cpp ├── main4.cpp ├── main5.cpp ├── main6.cpp ├── main7.cpp ├── main8.cpp └── main9.cpp ├── vs2019 ├── clean.bat ├── demo0.vcxproj ├── demo1.vcxproj ├── demo10.vcxproj ├── demo11.vcxproj ├── demo2.vcxproj ├── demo3.vcxproj ├── demo4.vcxproj ├── demo5.vcxproj ├── demo6.vcxproj ├── demo7.vcxproj ├── demo8.vcxproj ├── demo9.vcxproj ├── kalman-cpp.sln └── kalman-cpp.vcxproj └── windows-libs ├── Extract windows-libs-2019 here.txt ├── clean.bat └── windows-libs-2019.zip /.github/workflows/c-cpp.yml: -------------------------------------------------------------------------------- 1 | name: C/C++ CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: install libarmadillo-dev 17 | run: sudo apt-get update && sudo apt-get install -yq libarmadillo-dev 18 | - name: run cmake 19 | run: cmake . 20 | - name: run make 21 | run: make 22 | 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .kdev4/ 2 | build/CMakeFiles/ 3 | cmake_install.cmake 4 | CMakeCache.txt 5 | log*.* 6 | Makefile 7 | simple_kalman 8 | *.a 9 | *.lib 10 | *.exp 11 | *.user 12 | *.suo 13 | *.ncb 14 | vs2015/kalman-cpp.sdf 15 | vs2019/.vs 16 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": 4 | [ 5 | { 6 | "name": "(Windows) Launch", 7 | "type": "cppvsdbg", 8 | "request": "launch", 9 | "program": "${workspaceFolder}/bin/debug/demo1.exe", 10 | "args": [], 11 | "stopAtEntry": false, 12 | "cwd": "${workspaceFolder}/bin/", 13 | "environment": [], 14 | "console": "externalTerminal" 15 | } 16 | ] 17 | } 18 | 19 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | project(kalman-cpp) 4 | 5 | if (CMAKE_GENERATOR MATCHES "Visual Studio") 6 | # Do Visual Studio specific stuff 7 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ../bin) 8 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ../bin) 9 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ../bin) 10 | 11 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 12 | 13 | set(CMAKE_BUILD_TYPE Debug) 14 | 15 | link_directories(${CMAKE_SOURCE_DIR}/windows-libs) 16 | add_library (kalman-cpp ./kalman/kf.cpp ./kalman/ekf.cpp ./kalman/ekf2.cpp ./kalman/ukf.cpp ./kalman/fx.cpp) 17 | 18 | target_include_directories (kalman-cpp PUBLIC ./kalman ./windows-libs/armadillo/include) 19 | 20 | add_executable(demo1 ./samples/main1.cpp) 21 | add_executable(demo2 ./samples/main2.cpp) 22 | add_executable(demo3 ./samples/main3.cpp) 23 | add_executable(demo4 ./samples/main4.cpp) 24 | add_executable(demo5 ./samples/main5.cpp) 25 | add_executable(demo6 ./samples/main6.cpp) 26 | add_executable(demo7 ./samples/main7.cpp) 27 | add_executable(demo8 ./samples/main8.cpp) 28 | add_executable(demo9 ./samples/main9.cpp) 29 | add_executable(demo10 ./samples/main10.cpp) 30 | add_executable(demo11 ./samples/main11.cpp) 31 | 32 | install(TARGETS demo1 RUNTIME DESTINATION ../bin) 33 | install(TARGETS demo2 RUNTIME DESTINATION ../bin) 34 | install(TARGETS demo3 RUNTIME DESTINATION ../bin) 35 | install(TARGETS demo4 RUNTIME DESTINATION ../bin) 36 | install(TARGETS demo5 RUNTIME DESTINATION ../bin) 37 | install(TARGETS demo6 RUNTIME DESTINATION ../bin) 38 | install(TARGETS demo7 RUNTIME DESTINATION ../bin) 39 | install(TARGETS demo8 RUNTIME DESTINATION ../bin) 40 | install(TARGETS demo9 RUNTIME DESTINATION ../bin) 41 | install(TARGETS demo10 RUNTIME DESTINATION ../bin) 42 | install(TARGETS demo11 RUNTIME DESTINATION ../bin) 43 | 44 | target_link_libraries (demo1 LINK_PUBLIC kalman-cpp cbia.lib.lapack.dyn.rel.x64.12 cbia.lib.blas.dyn.rel.x64.12) 45 | target_link_libraries (demo2 LINK_PUBLIC kalman-cpp cbia.lib.lapack.dyn.rel.x64.12 cbia.lib.blas.dyn.rel.x64.12) 46 | target_link_libraries (demo3 LINK_PUBLIC kalman-cpp cbia.lib.lapack.dyn.rel.x64.12 cbia.lib.blas.dyn.rel.x64.12) 47 | target_link_libraries (demo4 LINK_PUBLIC kalman-cpp cbia.lib.lapack.dyn.rel.x64.12 cbia.lib.blas.dyn.rel.x64.12) 48 | target_link_libraries (demo5 LINK_PUBLIC kalman-cpp cbia.lib.lapack.dyn.rel.x64.12 cbia.lib.blas.dyn.rel.x64.12) 49 | target_link_libraries (demo6 LINK_PUBLIC kalman-cpp cbia.lib.lapack.dyn.rel.x64.12 cbia.lib.blas.dyn.rel.x64.12) 50 | target_link_libraries (demo7 LINK_PUBLIC kalman-cpp cbia.lib.lapack.dyn.rel.x64.12 cbia.lib.blas.dyn.rel.x64.12) 51 | target_link_libraries (demo8 LINK_PUBLIC kalman-cpp cbia.lib.lapack.dyn.rel.x64.12 cbia.lib.blas.dyn.rel.x64.12) 52 | target_link_libraries (demo9 LINK_PUBLIC kalman-cpp cbia.lib.lapack.dyn.rel.x64.12 cbia.lib.blas.dyn.rel.x64.12) 53 | target_link_libraries (demo10 LINK_PUBLIC kalman-cpp cbia.lib.lapack.dyn.rel.x64.12 cbia.lib.blas.dyn.rel.x64.12) 54 | target_link_libraries (demo11 LINK_PUBLIC kalman-cpp cbia.lib.lapack.dyn.rel.x64.12 cbia.lib.blas.dyn.rel.x64.12) 55 | 56 | else() 57 | # Other stuff 58 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ../bin) 59 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ../bin) 60 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ../bin) 61 | 62 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 63 | 64 | set(CMAKE_BUILD_TYPE Debug) 65 | 66 | add_library (kalman-cpp ./kalman/kf.cpp ./kalman/ekf.cpp ./kalman/ekf2.cpp ./kalman/ukf.cpp ./kalman/fx.cpp) 67 | 68 | target_include_directories (kalman-cpp PUBLIC ./kalman) 69 | 70 | add_executable(demo1 ./samples/main1.cpp) 71 | add_executable(demo2 ./samples/main2.cpp) 72 | add_executable(demo3 ./samples/main3.cpp) 73 | add_executable(demo4 ./samples/main4.cpp) 74 | add_executable(demo5 ./samples/main5.cpp) 75 | add_executable(demo6 ./samples/main6.cpp) 76 | add_executable(demo7 ./samples/main7.cpp) 77 | add_executable(demo8 ./samples/main8.cpp) 78 | add_executable(demo9 ./samples/main9.cpp) 79 | add_executable(demo10 ./samples/main10.cpp) 80 | add_executable(demo11 ./samples/main11.cpp) 81 | 82 | install(TARGETS demo1 RUNTIME DESTINATION ../bin) 83 | install(TARGETS demo2 RUNTIME DESTINATION ../bin) 84 | install(TARGETS demo3 RUNTIME DESTINATION ../bin) 85 | install(TARGETS demo4 RUNTIME DESTINATION ../bin) 86 | install(TARGETS demo5 RUNTIME DESTINATION ../bin) 87 | install(TARGETS demo6 RUNTIME DESTINATION ../bin) 88 | install(TARGETS demo7 RUNTIME DESTINATION ../bin) 89 | install(TARGETS demo8 RUNTIME DESTINATION ../bin) 90 | install(TARGETS demo9 RUNTIME DESTINATION ../bin) 91 | install(TARGETS demo10 RUNTIME DESTINATION ../bin) 92 | install(TARGETS demo11 RUNTIME DESTINATION ../bin) 93 | 94 | target_link_libraries (demo1 LINK_PUBLIC kalman-cpp armadillo) 95 | target_link_libraries (demo2 LINK_PUBLIC kalman-cpp armadillo) 96 | target_link_libraries (demo3 LINK_PUBLIC kalman-cpp armadillo) 97 | target_link_libraries (demo4 LINK_PUBLIC kalman-cpp armadillo) 98 | target_link_libraries (demo5 LINK_PUBLIC kalman-cpp armadillo) 99 | target_link_libraries (demo6 LINK_PUBLIC kalman-cpp armadillo) 100 | target_link_libraries (demo7 LINK_PUBLIC kalman-cpp armadillo) 101 | target_link_libraries (demo8 LINK_PUBLIC kalman-cpp armadillo) 102 | target_link_libraries (demo9 LINK_PUBLIC kalman-cpp armadillo) 103 | target_link_libraries (demo10 LINK_PUBLIC kalman-cpp armadillo) 104 | target_link_libraries (demo11 LINK_PUBLIC kalman-cpp armadillo) 105 | 106 | endif() 107 | 108 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kalman-cpp 2 | 3 | [](https://github.com/auralius/kalman-cpp/actions/workflows/c-cpp.yml) 4 | 5 | ## Kalman filter and extended Kalman filter implementation in C++ 6 | 7 | Implemented filters so far: 8 | * Kalman filter 9 | * Extended Kalman filter 10 | * Second-order extended Kalman filter 11 | * Unscented Kalman filter 12 | 13 | Please use cmake to build all the codes. 14 | 15 | The steps to compile are: 16 | 17 | ``` 18 | mkdir build 19 | cd build 20 | cmake .. 21 | make 22 | ``` 23 | 24 | ## Windows System 25 | 26 | In a Windows system, a Visual Studio solution file (VS 2019) is provided. 27 | 28 | ## Dependencies 29 | 30 | This library utilizes [Armadillo](http://arma.sourceforge.net). 31 | In Windows system, the armadillo library is provided in "windows-libs" folder. 32 | **The contents of windows-libs.zip need to be first extracted.** 33 | Armadillo itself is very easy to use. 34 | More information on the Armadillo can be found [here](http://arma.sourceforge.net/docs.html). 35 | 36 | ## blas and lapack 37 | By default, now kalman-cpp uses blas and lapack. For Windows machine, working with blas and lapack is a messy stuff. Thus, we will use the precompiled blas and lapack from: https://www.fi.muni.cz/~xsvobod2/misc/lapack/. 38 | 39 | The precompiled blas and lapack libraries are included in **windows-libs.zip**. There are four LIB files. Additionally, in "bin" folder, there are four corresponding DLL files as well. There are four files because two files are for the 32-bit platform, and the other two files are for the 64-bit platform. 40 | 41 | **The compiled binary must always be located in the same folder as these DLL files.** 42 | 43 | 44 | 45 | ## MATLAB m-files for plotting 46 | 47 | MATLAB m-files for each example are provided in 'm-files' folder. Octave can also be used instead of MATLAB. 48 | 49 | ## Documentation 50 | 51 | https://auralius.github.io/kalman-cpp/ 52 | -------------------------------------------------------------------------------- /bin/cbia.lib.blas.dyn.rel.x64.12.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auralius/kalman-cpp/c46e4edeab3a726ce1d16b7ea1e582d05fdbb950/bin/cbia.lib.blas.dyn.rel.x64.12.dll -------------------------------------------------------------------------------- /bin/cbia.lib.blas.dyn.rel.x86.12.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auralius/kalman-cpp/c46e4edeab3a726ce1d16b7ea1e582d05fdbb950/bin/cbia.lib.blas.dyn.rel.x86.12.dll -------------------------------------------------------------------------------- /bin/cbia.lib.lapack.dyn.rel.x64.12.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auralius/kalman-cpp/c46e4edeab3a726ce1d16b7ea1e582d05fdbb950/bin/cbia.lib.lapack.dyn.rel.x64.12.dll -------------------------------------------------------------------------------- /bin/cbia.lib.lapack.dyn.rel.x86.12.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auralius/kalman-cpp/c46e4edeab3a726ce1d16b7ea1e582d05fdbb950/bin/cbia.lib.lapack.dyn.rel.x86.12.dll -------------------------------------------------------------------------------- /bin/clean.bat: -------------------------------------------------------------------------------- 1 | del *.exe 2 | del *.user 3 | del *.ncb 4 | del *.pdb 5 | del *.lib 6 | del *.ilk 7 | del *.txt 8 | del *.exp 9 | del *.suo -------------------------------------------------------------------------------- /docs/html/Kalman_concept1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auralius/kalman-cpp/c46e4edeab3a726ce1d16b7ea1e582d05fdbb950/docs/html/Kalman_concept1.jpg -------------------------------------------------------------------------------- /docs/html/Kalman_concept2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auralius/kalman-cpp/c46e4edeab3a726ce1d16b7ea1e582d05fdbb950/docs/html/Kalman_concept2.jpg -------------------------------------------------------------------------------- /docs/html/_formulas.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | -------------------------------------------------------------------------------- /docs/html/_formulas.dvi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auralius/kalman-cpp/c46e4edeab3a726ce1d16b7ea1e582d05fdbb950/docs/html/_formulas.dvi -------------------------------------------------------------------------------- /docs/html/_formulas.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auralius/kalman-cpp/c46e4edeab3a726ce1d16b7ea1e582d05fdbb950/docs/html/_formulas.pdf -------------------------------------------------------------------------------- /docs/html/_formulas.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{ifthen} 3 | \usepackage{epsfig} 4 | \usepackage[utf8]{inputenc} 5 | % Packages requested by user 6 | \usepackage{amsmath} 7 | 8 | \usepackage{newunicodechar} 9 | \newunicodechar{⁻}{${}^{-}$}% Superscript minus 10 | \newunicodechar{²}{${}^{2}$}% Superscript two 11 | \newunicodechar{³}{${}^{3}$}% Superscript three 12 | 13 | \pagestyle{empty} 14 | \begin{document} 15 | $x$ 16 | \pagebreak 17 | 18 | $y$ 19 | \pagebreak 20 | 21 | $\dot{x}$ 22 | \pagebreak 23 | 24 | $\dot{y}$ 25 | \pagebreak 26 | 27 | \[x_k = f(x_{k-1}, u_{k-1}) + v_{k-1}\] 28 | \pagebreak 29 | 30 | \[z_k = h(x_k) + w_k\] 31 | \pagebreak 32 | 33 | $f$ 34 | \pagebreak 35 | 36 | $h$ 37 | \pagebreak 38 | 39 | $v$ 40 | \pagebreak 41 | 42 | $w$ 43 | \pagebreak 44 | 45 | $z$ 46 | \pagebreak 47 | 48 | $u$ 49 | \pagebreak 50 | 51 | $x_k$ 52 | \pagebreak 53 | 54 | $z_k$ 55 | \pagebreak 56 | 57 | $\hat{x}_k$ 58 | \pagebreak 59 | 60 | $\hat{z}_k$ 61 | \pagebreak 62 | 63 | \[y = \begin{bmatrix} f_1(x_1,x_2,x_3) \\ f_2(x_1,x_2,x_3) \end{bmatrix} \] 64 | \pagebreak 65 | 66 | \[Jac(y)=\begin{bmatrix} \frac{\partial f_1}{\partial x_1} \frac{\partial f_1}{\partial x_2} \frac{\partial f_1}{\partial x_3} \\ \frac{\partial f_2}{\partial x_1} \frac{\partial f_2}{\partial x_2} \frac{\partial f_2}{\partial x_3} \end{bmatrix} \] 67 | \pagebreak 68 | 69 | \[Hess(y(1)) =\begin{bmatrix} \frac{\partial^2 f_1}{\partial x_1^2} \frac{\partial^2 f_1}{\partial x_1 \partial x_2} \frac{\partial^2 f_1}{\partial x_1 \partial x_3} \\ \frac{\partial^2 f_1}{\partial x_2 \partial x_1} \frac{\partial^2 f_1}{\partial x_2^2} \frac{\partial^2 f_1}{\partial x_2 \partial x_3} \\ \frac{\partial^2 f_1}{\partial x_3 \partial x_1} \frac{\partial^2 f_1}{\partial x_3 \partial x_2} \frac{\partial^2 f_1}{\partial x_3^2} \end{bmatrix} \] 70 | \pagebreak 71 | 72 | \[Hess(y(2)) =\begin{bmatrix} \frac{\partial^2 f_2}{\partial x_1^2} \frac{\partial^2 f_2}{\partial x_1 \partial x_2} \frac{\partial^2 f_2}{\partial x_1 \partial x_3} \\ \frac{\partial^2 f_2}{\partial x_2 \partial x_1} \frac{\partial^2 f_2}{\partial x_2^2} \frac{\partial^2 f_2}{\partial x_2 \partial x_3} \\ \frac{\partial^2 f_2}{\partial x_3 \partial x_1} \frac{\partial^2 f_2}{\partial x_3 \partial x_2} \frac{\partial^2 f_2}{\partial x_3^2} \end{bmatrix} \] 73 | \pagebreak 74 | 75 | \[x_k = Ax_{k-1} + Bu_{k-1} + v_{k-1}\] 76 | \pagebreak 77 | 78 | \[z_k = Hx_k + w_k\] 79 | \pagebreak 80 | 81 | $A$ 82 | \pagebreak 83 | 84 | $B$ 85 | \pagebreak 86 | 87 | $H$ 88 | \pagebreak 89 | 90 | \[Q = Q^T\] 91 | \pagebreak 92 | 93 | \[R = R^T\] 94 | \pagebreak 95 | 96 | \[x_k = 12 + v_{k-1}\] 97 | \pagebreak 98 | 99 | \[z_k = x_k + w_ḳ\] 100 | \pagebreak 101 | 102 | $A = 0$ 103 | \pagebreak 104 | 105 | $B = 1$ 106 | \pagebreak 107 | 108 | $H = 1$ 109 | \pagebreak 110 | 111 | $u = 12$ 112 | \pagebreak 113 | 114 | $x_0 = 12$ 115 | \pagebreak 116 | 117 | $Q=4$ 118 | \pagebreak 119 | 120 | $R=4$ 121 | \pagebreak 122 | 123 | $Q$ 124 | \pagebreak 125 | 126 | $R$ 127 | \pagebreak 128 | 129 | \[ f = \begin{bmatrix} \sin(x_2(k-1))(k-1) \\ x_2(k-1) \end{bmatrix} \] 130 | \pagebreak 131 | 132 | \[ h = \begin{bmatrix} x_1(k) \\ x_2(k) \end{bmatrix} \] 133 | \pagebreak 134 | 135 | \[ x_0 = \begin{bmatrix} 0 \\ \frac{1 \pi}{500} \end{bmatrix}\] 136 | \pagebreak 137 | 138 | \[ f = \begin{bmatrix} x_2(k) \\ x_3(k) \\ 0.005 \, x_1(k) \bigg(x_2(k) + x_3(k) \bigg) \end{bmatrix} \] 139 | \pagebreak 140 | 141 | \[ h = \begin{bmatrix} x_1(k) \end{bmatrix} \] 142 | \pagebreak 143 | 144 | \[ x_0 = \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}\] 145 | \pagebreak 146 | 147 | $x_1$ 148 | \pagebreak 149 | 150 | $x_2$ 151 | \pagebreak 152 | 153 | $x_3$ 154 | \pagebreak 155 | 156 | $u_k$ 157 | \pagebreak 158 | 159 | \[x_k = x_{k-1} + v_{k-1}\] 160 | \pagebreak 161 | 162 | \end{document} 163 | -------------------------------------------------------------------------------- /docs/html/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
CEKF | Implemetation of the extended Kalman filter. This class needs to be derived |
CEKF2 | Implemetation of the extended Kalman filter. This class needs to be derived |
CFX | |
CKF | Kalman filter implementation, for a linear system |
CUKF | Implemetation of the Unscented Kalman filter. This class needs to be derived |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
This is the complete list of members for FX, including all inherited members.
75 |FX(colvec(*f)(colvec &x, colvec &some_constants)) | FX | |
HessianAt(colvec &x, colvec &some_constants, int i) | FX | |
JacobianAt(colvec &x, colvec &some_constants) | FX | |
SetEpsilon(double epsilon) | FX | |
SolveAt(colvec &x, colvec &some_constants) | FX | |
~FX() | FX |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
This is the complete list of members for KF, including all inherited members.
75 |GetCurrentEstimatedOutput() | KF | |
GetCurrentEstimatedState() | KF | |
GetCurrentOutput() | KF | |
GetCurrentState() | KF | |
InitStateCovariance(const mat &P0) | KF | |
InitSystem(const mat &A, const mat &B, const mat &H, const mat &Q, const mat &R) | KF | |
InitSystemState(const colvec &x0) | KF | |
Kalmanf(const colvec &u) | KF | |
Kalmanf(const colvec &z, const colvec &u) | KF | |
KF() | KF | |
~KF() | KF |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
An example for an Unscented Kalman filter. 77 | More...
78 |82 | Functions | |
int | main (int argc, char **argv) |
An example for an Unscented Kalman filter.
88 | 89 |This example is taken from here, section 3.2: "Tracking a random sine signal".
93 |int main | 102 |( | 103 |int | 104 |argc, | 105 |
108 | | 109 | | char ** | 110 |argv | 111 |
114 | | ) | 115 |116 | |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
Example for the Kalman filter. 77 | More...
78 |82 | Functions | |
int | main (int argc, char **argv) |
Example for the Kalman filter.
88 | 89 |A kinematic system, with position and velocity as the states. Measured output is position.
93 |int main | 102 |( | 103 |int | 104 |argc, | 105 |
108 | | 109 | | char ** | 110 |argv | 111 |
114 | | ) | 115 |116 | |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
Example for the Kalman filter. 77 | More...
78 |82 | Functions | |
int | main (int argc, char **argv) |
Example for the Kalman filter.
88 | 89 |A system in x-y plane, a kinematic system, with position and velocity as the states. The system has 4 input states ( \(x\), \(y\), \(\dot{x}\), \(\dot{y}\)). and 2 output states ( \(x\), \(y\)).
93 |int main | 102 |( | 103 |int | 104 |argc, | 105 |
108 | | 109 | | char ** | 110 |argv | 111 |
114 | | ) | 115 |116 | |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
Example for the extended Kalman filter. 77 | More...
78 |82 | Functions | |
int | main (int argc, char **argv) |
Example for the extended Kalman filter.
88 | 89 |This example is taken from here.
93 |int main | 102 |( | 103 |int | 104 |argc, | 105 |
108 | | 109 | | char ** | 110 |argv | 111 |
114 | | ) | 115 |116 | |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
Example for the extended Kalman filter. 77 | More...
78 |82 | Functions | |
int | main (int argc, char **argv) |
Example for the extended Kalman filter.
88 | 89 |This example is taken from here, section 3.2: "Tracking a random sine signal".
93 |int main | 102 |( | 103 |int | 104 |argc, | 105 |
108 | | 109 | | char ** | 110 |argv | 111 |
114 | | ) | 115 |116 | |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |
32 | kalman-cpp
33 |
34 | Implementation of Kalman Filter in C++
35 | |
36 |