Skip to content

flubbe/filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Filters for C++

Currently only implements the Unscented Kalman Filter: This is an almost line-by-line reimplementation of UnscentedKalmanFilter from FilterPy in C++17. For documentation, please refer to those references (for now, at least).

Dependencies

The runtime dependencies are:

  • Eigen,
  • {fmt} for formatting when throwing exceptions,

If you want to build and run the tests, you also need:

The library uses Conan for package management, which resolves all of the dependencies automatically.

Setup

The build instructions below mainly concern package building and running the tests, since all library code is contained in include/filter.

Installation

  • Manual Installation.

    You can just add include to your project's include directories. Remember to also install the dependencies (i.e., Eigen and {fmt}).

  • Install using Conan.

    The commands below are meant to be executed from the libary's root directory.

    • Normal installation:

      $ conan create . -s compiler.cppstd=17 --build missing
      
    • Editable install:

      Install the dependencies using

      $ conan install .
      

      and then run

      $ conan editable add .
      

      To remove the editable install, use

      $ conan editable remove --refs=filter/0.1
      

Usage

In your C++ file, add

#include "filter/ukf.h"
#include "filter/sigma_points.h"

By default, this uses 64-bit double precision matrices/vectors. For 32-bit single precision matrices/vectors, use

#define FILTER_USE_FP32
#include "filter/ukf.h"
#include "filter/sigma_points.h"

Note: This setting only affects the linear algebra types. Further, some tests will currently fail if they are run with single precision.

The library defines a general namespace filter and the namespace filter::ukf for the Unscented Kalman Filter. See the tests for usage examples.

Building a Conan package

Run

$ conan build .

to build using the build type set in your Conan profile, or

$ conan build . --settings=build_type=BUILD_TYPE

with BUILD_TYPE substituted by your desired build type (e.g. Debug or Release).

Tests

The tests run automatically after building. If the package is already installed, run

$ conan test test filter/0.1

License

The library is licensed under the MIT license.

References

[1] FilterPy

About

Some filters for C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published