PF: a library for fast particle filtering!
This is a template library for particle filtering. Templated abstract base classes for different particle filters are provided (e.g. the Bootstrap Filter, the SISR filter, the Auxiliary Particle Filter, the Rao-Blackwellized particle filter), as well as non-abstract (but indeed templated) base classes for closed-form filtering algorithms (e.g. Kalman Filter, Hidden Markov Model filter, etc.).
Once you have a certain model in mind, all you have to do is make it into a class that inherits from the filter you want to use.
This code makes use of the following libraries:
Also, your compiler must enable C++17.
Option 1: Install with
git clone this Github repostory,
cd into the directory where everything is saved, then run the following commands:
mkdir build && cd build/ cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr/local sudo cmake --build . --config Release --target install --parallel
You may subsitute another directory for
/usr/local, if you wish. This will also build unit tests that can be run with the following command (assuming you're still in
Note: for this to method work, you will need to install Catch2 "system wide" so that its
*.cmake files are installed as well. To do this, click here.
Option 2: Drag-and-drop
This is a header-only library, so there will be no extra building necessary. If you just want to copy the desired header files from
include/pf into your own project, and build that project by itself, that's totally fine. There is no linking necessary, either. If you go this route, though, make sure to compile with C++17 enabled. Note, also, that this code all makes use of Eigen v3.3 and Boost v1.65.1. Unit tests use the Catch2 v2.9.2 library.
Don't know how to use this? No problem. Check out the
examples sub-directory. This is a stand-alone cmake project, so you can just copy this sub-directory anywhere you like, and start editing.
For example, copy to
Desktop and have at it:
cp -r ~/pf/examples/ ~/Desktop/ cd Desktop/examples/ mkdir build && cd build cmake .. make
If there are no error messages, you will have an executable named
pf_example in that same directory. Running it without command line arguments will prompt you for arguments and tell you how it can be used.
Want to contribute to this project? Great! Click here for details on how to do that.
Click the "DOI" link above. Or, if you're impatient, click 'here' for a Bibtex citation.