Giter Club home page Giter Club logo

kalmanif's Introduction

kalmanif

A small collection of Kalman Filters on Lie groups

GHA

GitHub

Package Summary

kalmanif is a Kalman filter(s) on Lie groups library for state-estimation targeted at robotics applications. It is developed as a header-only C++17 library based on manif.

At the moment, it implements:

  • Extended Kalman Filter (EKF)
  • Square Root Extended Kalman Filter (SEKF)
  • Invariant Extended Kalman Filter (IEKF)
  • Unscented Kalman Filter on manifolds (UKFM)
  • Rauch-Tung-Striebel Smoother*

(*the RTS Smoother is compatible with all filters - ERTS / SERTS / IERTS/ URTS-M)

Together with a few system and measurement models mostly for demo purpose. Other filters/models can and will be added, contributions are welcome.

kalmanif started has a rework of the excellent kalman library by Markus Herb to turn the filtering-based examples in manif into reusable code. The main difference from the kalman library is its integration with the manif library to handle the Lie theory aspects. There are also numerous implementation details that differ and which can't be summarized here.

kalmanif is distributed under the same permissive license as it's inspirational model.

โ— kalmanif is very much a work in progress. As such, do not expect it to work out of the box, nor support your application. Do expect its API to change. Headache possible. โ—

Details

Quick Start

Checkout the installation guide over here.

Note

Both the IEKF and UKFM filters are implemented in their 'right invariant' flavor. However they are able to handle both 'right' and 'left' measurements.

Tutorials and application demos

We provide some self-contained and self-explained executables implementing some real problems. Their source code is located in kalmanif/examples/. These demos are:

  • demo_se2.cpp: 2D robot localization based on fixed landmarks using SE2 as robot poses. This implements the example V.A in SOLA-18-Lie.
  • demo_se3.cpp: 3D robot localization based on fixed landmarks using SE3 as robot poses. This re-implements the example above but in 3D.
  • demo_se_2_3.cpp: 3D robot localization and linear velocity estimation based on strap-down IMU model and fixed beacons.

Check out the documentation to see how to build them and what are their options.

References

kalmanif is based on several publications, some of which are referenced here.

Contributing

Want to contribute? Great! Check out our contribution guidelines.

kalmanif's People

Contributors

artivis 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kalmanif's Issues

Test and examples building and running problems.

If BUILD_TESTS = ON, I get this

CMake Error at test/CMakeLists.txt:35 (add_dependencies):
  The dependency target "gtest" of target "gtest_demo_se2" does not exist.
Call Stack (most recent call first):
  test/CMakeLists.txt:55 (kalmanif_add_gtest)


CMake Error at test/CMakeLists.txt:35 (add_dependencies):
  The dependency target "gtest" of target "gtest_demo_se3" does not exist.
Call Stack (most recent call first):
  test/CMakeLists.txt:56 (kalmanif_add_gtest)


CMake Error at test/CMakeLists.txt:35 (add_dependencies):
  The dependency target "gtest" of target "gtest_demo_se_2_3" does not exist.
Call Stack (most recent call first):
  test/CMakeLists.txt:57 (kalmanif_add_gtest)

If I switch them OFF, the errors disappear. However, I have no examples being compiled:

cd examples
ls

CMakeFiles  cmake_install.cmake  Makefile

How long is the demo?

Running demo_se3 for a while... seems to never end!

Maybe add a time line t =t_current / t_final, just to the right of the ------ separation line

Clarification needed. Left box plus used in Right Invariance filter.

Dear, @joansola and @artivis

I'm looking into the implementation of the UKF on manifold from this repo.
I've just noticed, that in the case of the Right Invariance sigmas and increments are added to the current state using the left box plus operator. In which frame P (covariance) is expressed then? Local tangent space at X, or global at the group origin?
I expected that with Right Invariance increments and covariance are expressed in the local tangent space at X and thus right box plus operator shall be used.

// sigma points on manifold
State s_j_p, s_j_m;
Eigen::Matrix<Scalar, StateSize, StateSize*2> xis_new;
for (int i = 0; i < StateSize; ++i) {
if constexpr (Iv == Invariance::Right) {
s_j_p = MapTangent(xis.col(i).data()) + x;
s_j_m = Tangent(-xis.col(i)) + x;

At the same time, in the example from manif repo, the description matches the operator used to add sigma increments to the state.

*  The estimation error dx and its covariance P are expressed
*  in the tangent space at X.

https://github.com/artivis/manif/blob/805a0b2adf9435dd658fdad5606c342db4d889e8/examples/se2_localization_ukfm.cpp#L311

        // sigma points on manifold
        for (int i = 0; i < DoF; ++i)
        {
          s_j_p = X + manif::SE2Tangentd( xis.col(i));
          s_j_m = X + manif::SE2Tangentd(-xis.col(i));

          xis_new.col(i) = (X_new.lminus(s_j_p + u_est)).coeffs();
          xis_new.col(i + DoF) = (X_new.lminus(s_j_m + u_est)).coeffs();
        }

Thank you in advance for your answer!

Best regards,
Alex

Handle measurement models which return group, but not the Eigen vector.

Dear @artivis ,

I follow your code here:

yj.col(i) = h( MapTangent(xis.col(i).data()) + x );

I see so far that the result from the measurement model is expected to be a vector. Are there any thoughts regarding the support of measurement models which return group?
Particularly, when UEKF is used to fuse several high level sources of orientation expressed as SO3 members.

Here are my thoughts so far:

  1. Use a container to store sigma points instead of columns in the matrix (std vector should be fine).
  2. Use proper averaging and weighting methods to compute mean and covariance on manifold (average_biinvariant?).

I think I'll be able to contribute with a little help from your side.

Best regards,
Alex

Request for an example.

First of all, I would to thank you for such a great contribution to the open-source community.

I am new to state estimation formulation using Lie Theory. I saw your paper describing the Lie Theory with such great examples and the repo manif.

I request to please add an example related to IEKF for IMU, and GPS fusion.

If you feel it is not relevant to add an example, I request to please share some resources by which I could implement IMU/GPS fusion using the library.

Question: manif Bundle<> or other ways to support composite/compound state.

Dear, @artivis

I followed your discussion here regarding the need for composite/compound state support. I also see that in the manif repo, there is a way to do so with the Bundle<>. But there is no example in this repository of how to do that. Are there any impediments invisible to me that prevent using composite states?

The idea is to use manif/kalmanif for a practical application with a heterogeneous state:
SE(3) - robot pose().
SO(3), SE(3) - sensor locations, orientations.
1D vectors, or scalars - sensor biases.
(Optionally) 2D matrix - more complex sensor calibrations, homography, maybe members of other groups such as SIM(3).

Looking forward to your answer!

Best regards,
Alex

observation model: non constant covariance

I have quickly checked out the se2 example. I wonder whether the obs models accept non-constant covariances, that is, something that allows the following update

ekf.update(gps_measurement_model, y_gps, R_gps);

Handle SE(3) measurement by invariant EKF

Hello doctor @artivis,
I learned invariant EKF has some advantages, e.g. consistent and guaranteed convergence etc, over traditional EKF recently in paper [The Invariant Extended Kalman filter as a stable observer, Axel Barrau, Silvere Bonnabel]. But the measurement model must is Left-invariant observations, zt = x * d or Right-invariant observations, zt = x.inv * d. I want to loosely couple imu with a lio(lidar-inertial-odometry) system, which can give SE(3) measurement. But it seems that lio measurement can not statisfy invariant EKF measurement, right ?
From your experience, In kalmanif lib , Square Root Extended Kalman Filter (SEKF) or Unscented Kalman Filter on manifolds (UKFM), which one should i to try in terms of accuracy and stability? Thanks for your help and time a lot!

Best regards
narutojxl

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.