Manif

Manif: A micro Lie theory library for state estimation in robotics applications - Published in JOSS (2020)

https://github.com/artivis/manif

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: arxiv.org, joss.theoj.org
  • Committers with academic emails
    3 of 14 committers (21.4%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

2d 3d c-plus-plus computer-vision cpp11 geometry header-only lie-groups lie-theory python3 robotics slam state-estimation
Last synced: 4 months ago · JSON representation

Repository

A small C++11 header-only library for Lie theory.

Basic Info
Statistics
  • Stars: 1,658
  • Watchers: 45
  • Forks: 261
  • Open Issues: 30
  • Releases: 3
Topics
2d 3d c-plus-plus computer-vision cpp11 geometry header-only lie-groups lie-theory python3 robotics slam state-estimation
Created over 7 years ago · Last pushed 7 months ago
Metadata Files
Readme Contributing License

README.md

manif

A small header-only library for Lie theory

GHA appveyor Documentation codecov GitHub JOSS

Package Summary

manif is a Lie theory library for state-estimation targeted at robotics applications. It is developed as a header-only C++11 library with Python 3 wrappers.

At the moment, it provides the groups:

  • ℝ(n): Euclidean space with addition.
  • SO(2): rotations in the plane.
  • SE(2): rigid motion (rotation and translation) in the plane.
  • SO(3): rotations in 3D space.
  • SE(3): rigid motion (rotation and translation) in 3D space.
  • SE_2(3): extended pose (rotation, translation and velocity) in 3D space, introduced (to the best of knowledge) in this paper. NOTE: The implementation here differs slightly from the developments in the paper.
  • SGal(3): The Special Galilean group (rotation, translation, velocity and time) in 3D space, described in these papers [1] & [2].
  • Bundle<>: allows manipulating a manifold bundle as a single Lie group. Referred to as a composite manifold in Section IV of the reference paper.

Other Lie groups can and will be added, contributions are welcome.

manif is based on the mathematical presentation of the Lie theory available in this paper. We recommend every user of manif to read the paper (17 pages) before starting to use the library. The paper offers a comprehensive yet accessible introduction to Lie theory, tailored specifically for roboticists. By presenting the material in a simplified manner, it lowers the barrier to entry for those interested in developing rigorous and elegant algorithms for state estimation, control, learning, and possibly more. This approach ensures that even readers without an advanced mathematical background can grasp the foundational concepts and apply them effectively in robotics.

You may also find the following video online, 'Lie theory for the roboticist', a lecture given at IRI-UPC.

In a rush? Check out our Lie group cheat sheet.

manif provides analytic computation of Jacobians for all the operations listed below.

Details

Quick Start

Get quickly started with manif following our 'quick start' guides for both C++ and Python.

Features

Available Operations

| Operation | | Code | | :--- | :---: | :---: | | | Base Operation | | | Inverse | $\bf\mathcal{X}^{-1}$ | X.inverse() | | Composition | $\bf\mathcal{X}\circ\bf\mathcal{Y}$ | X * Y
X.compose(Y) | | Hat | $\boldsymbol\varphi^\wedge$ | w.hat() | | Act on vector | $\bf\mathcal{X}\circ{\bf v}$ | X.act(v) | | Retract to group element | $\exp(\boldsymbol\varphi^\wedge)$ | w.exp() | | Lift to tangent space | $\log(\bf\mathcal{X})^\vee$ | X.log() | | Manifold Adjoint | $\mathrm{Adj}(\bf\mathcal{X})$ | X.adj() | | Tangent adjoint | $\mathrm{adj}(\boldsymbol\varphi^\wedge)$ | w.smallAdj() | | | Composed Operation | | | Manifold right plus | ${\bf\mathcal{X}}\circ\exp(\boldsymbol\varphi^\wedge)$ | X + w
X.plus(w)
X.rplus(w) | | Manifold left plus | $\exp(\boldsymbol\varphi^\wedge)\circ\bf\mathcal{X}$ | w + X
w.plus(X)
w.lplus(X) | | Manifold right minus | $\log(\bf\mathcal{Y}^{-1}\circ\bf\mathcal{X})^\vee$ | X - Y
X.minus(Y)
X.rminus(Y) | | Manifold left minus | $\log(\bf\mathcal{X}\circ\bf\mathcal{Y}^{-1})^\vee$ | X.lminus(Y) | | Between | ${\bf\mathcal{X}^{-1}}\circ{\bf\mathcal{Y}}$ | X.between(Y) | | Inner Product | $\langle\boldsymbol\varphi,\boldsymbol\tau\rangle$ | w.inner(t) | | Norm | $\left\lVert\boldsymbol\varphi\right\rVert$ | w.weightedNorm()
w.squaredWeightedNorm() |

Above, ${\bf\mathcal{X}}$ & ${\bf\mathcal{Y}}$ (X & Y) represent group elements, ${\boldsymbol\varphi^\wedge}$ & ${\boldsymbol\tau^\wedge}$ represent elements in the Lie algebra of the Lie group, ${\boldsymbol\varphi}$ & ${\boldsymbol\tau}$ (w & t) represent the same elements of the tangent space but expressed in Cartesian coordinates in $\mathbb{R}^n$, and $\mathbf{v}$ (v) represents any element of $\mathbb{R}^n$.

Tangent spaces

manif favors Cartesian representations of the tangent spaces. This means that the tangent elements are regular vectors in $\mathbb{R}^n$, 'n' being the dimension of the Lie group.

The ordering of the elements in such vectors matters to correctly interpret them. It impacts the form of all Jacobian matrices and covariances matrices that will be defined on those tangent spaces.

As a reference, this is the way tangent spaces are defined in manif

| group | dimension | group elements | tangent elements (in order) | relation to velocity | | ---- | ---- | ---- | ---- | ---- | | Rn | n | $\bf p$ | $\bf p$ | ${\bf p} = {\bf v}\cdot dt$ | | SO(2) | 1 | $\bf R$ | $\theta$ | $\theta = \omega\cdot dt$ | | SO(3) | 3 | $\bf R$ | $\boldsymbol\theta$ | $\boldsymbol\theta = \boldsymbol\omega\cdot dt$ | | SE(2) | 3 | $\bf p$, $\bf R$ | $\boldsymbol\rho$, $\theta$ | $\boldsymbol\rho = {\bf v}\cdot dt$
$\theta = \omega\cdot dt$ | | SE(3) | 6 | $\bf p$, $\bf R$ | $\boldsymbol\rho$, $\boldsymbol\theta$ | $\boldsymbol\rho = {\bf v}\cdot dt$
$\boldsymbol\theta = \boldsymbol\omega\cdot dt$ | | SE_2(3) | 9 | $\bf p$, $\bf R$, $\bf v$ | $\boldsymbol\rho$, $\boldsymbol\theta$, $\boldsymbol\nu$ | $\boldsymbol\rho = {\bf v}\cdot dt$
$\boldsymbol\nu = {\bf a}\cdot dt$
$\boldsymbol\theta = {\boldsymbol\omega}\cdot dt$ | | SGal(3) | 10 | $\bf p$, $\bf R$, $\bf v$, $t$ | $\boldsymbol\rho$, $\boldsymbol\nu$, $\boldsymbol\theta$, $s$ | $\boldsymbol\rho = {\bf v}\cdot dt$
$\boldsymbol\nu = {\bf a}\cdot dt$
$\boldsymbol\theta = {\boldsymbol\omega}\cdot dt$
$s = dt$ |

As an example, in SE_2(3) the tangent vector ${\boldsymbol\tau}$ is defined by

$$ {\boldsymbol\tau} = \begin{bmatrix} {\boldsymbol\rho} \ {\boldsymbol\theta} \ {\boldsymbol\nu} \end{bmatrix} \in \mathbb{R}^9 $$

where $\boldsymbol\rho$, $\boldsymbol\theta$ and $\boldsymbol\nu$ are $\in \mathbb{R}^3$ and typically correspond respectively to changes in position, orientation and velocity.

A covariances matrix $\bf Q$ of an element of SE_2(3) can be block-partitioned as follows

$$ {\bf Q} = \begin{bmatrix} {\bf Q}_ {\boldsymbol\rho\boldsymbol\rho} & {\bf Q}_ {\boldsymbol\rho\boldsymbol\theta} & {\bf Q}_ {\boldsymbol\rho\boldsymbol\nu} \ {\bf Q}_ {\boldsymbol\theta\boldsymbol\rho} & {\bf Q}_ {\boldsymbol\theta\boldsymbol\theta} & {\bf Q}_ {\boldsymbol\theta\boldsymbol\nu} \ {\bf Q}_ {\boldsymbol\nu\boldsymbol\rho} & {\bf Q}_ {\boldsymbol\nu\boldsymbol\theta} & {\bf Q}_ {\boldsymbol\nu\boldsymbol\nu} \end{bmatrix} \in \mathbb{R}^{9\times 9} $$

All blocks ${\bf Q}_{\bf ij}$ are $3\times3$ and ${\bf Q}$ is $9\times9$.

Jacobians

All operations come with their respective analytical Jacobian matrices. Throughout manif, Jacobians are differentiated with respect to a perturbation on the local tangent space. These Jacobians map tangent spaces, as described in this paper. Please consider the order of elements in the tangent spaces when manipulating Jacobians.

Currently, manif implements the right Jacobian, whose definition reads:

$$ \frac{\delta f(\bf\mathcal{X})}{\delta\bf\mathcal{X}}\triangleq \lim{\boldsymbol\varphi\to\bf0}\frac{f(\bf\mathcal{X}\oplus\boldsymbol\varphi)\ominus f(\bf\mathcal{X})}{\boldsymbol\varphi}\triangleq \lim{\boldsymbol\varphi\to\bf0}\frac{\log(f({\bf\mathcal{X}})^{-1} f({\bf\mathcal{X}}\exp(\boldsymbol\varphi^\wedge)))^\vee}{\boldsymbol\varphi} $$

The Jacobians of any of the aforementioned operations can then be evaluated:

in C++,

```cpp SE3d X = SE3d::Random(); SE3Tangentd w = SE3Tangentd::Random();

SE3d::Jacobian Jox, Jow;

auto Xplusw = X.plus(w, Jox, Jow); ```

in Python,

```python X = SE3.Random() w = SE3Tangentd.Random()

Jox = np.zeros((SE3.DoF, SE3.DoF)) Jow = np.zeros((SE3.DoF, SE3.DoF))

Xplusw = X.plus(w, Jox, Jow) ```

Note

While Jacobians in manif are differentiated with respect to a local perturbation on the tangent space, many non-linear solvers (e.g. Ceres) expect functions to be differentiated with respect to the underlying representation vector of the group element (e.g. with respect to quaternion vector for SO3).

For this reason, manif is compliant with the auto-differentiation libraries ceres::Jet, autodiff::Dual & autodiff::Real.

Documentation

The documentation is available online at the accompanying website. Both the C++ and the Python APIs are documented.

Do you want to build it locally? Find out how on the dedicated page.

Note: throughout the code documentation we refer to 'the paper' which you can find on the dedicated page.

Tutorials and application demos

We provide some self-contained and self-explained C++ examples to help you get started.

You prefer Python? The same examples are also available in Python.

Publications

Check out our related publications and how to cite them.

They use manif

Find out who's already using manif.

Contributing

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

Owner

  • Name: Jeremie Deray
  • Login: artivis
  • Kind: user
  • Location: France
  • Company: @CanonicalLtd

Roboticist / Software Developer, ROS(2) / C++ enthusiast.

JOSS Publication

Manif: A micro Lie theory library for state estimation in robotics applications
Published
February 18, 2020
Volume 5, Issue 46, Page 1371
Authors
Jérémie Deray ORCID
Institut de Robòtica i Informàtica Industrial, CSIC-UPC, Llorens Artigas 4-6, 08028, Barcelona, Spain.
Joan Solà ORCID
Institut de Robòtica i Informàtica Industrial, CSIC-UPC, Llorens Artigas 4-6, 08028, Barcelona, Spain.
Editor
Jack Poulson ORCID
Tags
Lie group Lie algebra State Estimation Robotics

GitHub Events

Total
  • Issues event: 12
  • Watch event: 156
  • Delete event: 6
  • Issue comment event: 68
  • Push event: 50
  • Pull request review comment event: 1
  • Pull request review event: 6
  • Pull request event: 17
  • Fork event: 17
  • Create event: 8
Last Year
  • Issues event: 12
  • Watch event: 156
  • Delete event: 6
  • Issue comment event: 68
  • Push event: 50
  • Pull request review comment event: 1
  • Pull request review event: 6
  • Pull request event: 17
  • Fork event: 17
  • Create event: 8

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 691
  • Total Committers: 14
  • Avg Commits per committer: 49.357
  • Development Distribution Score (DDS): 0.344
Past Year
  • Commits: 9
  • Committers: 3
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
artivis d****e@g****m 453
Jeremie Deray j****y@p****m 126
Joan Solà j****a@i****u 51
Giulio Romualdi g****i@g****m 18
Diego Ferigo d****o@i****t 12
Silvio Traversaro s****o@i****t 10
Petter Nilsson p****i@u****u 7
Matt Alvarado m****o@c****m 5
Daniel S. Katz d****z@i****g 3
Marshall Vielmetti m****i@o****m 2
Henry LeCompte h****y@l****m 1
Prashanth Ramadoss p****s@g****m 1
Qiang Qiu q****1@1****m 1
William Talbot w****7@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 80
  • Total pull requests: 89
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 42
  • Total pull request authors: 13
  • Average comments per issue: 4.13
  • Average comments per pull request: 4.25
  • Merged pull requests: 69
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 10
  • Pull requests: 20
  • Average time to close issues: 16 days
  • Average time to close pull requests: about 1 month
  • Issue authors: 9
  • Pull request authors: 6
  • Average comments per issue: 3.3
  • Average comments per pull request: 4.5
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • joansola (10)
  • artivis (8)
  • GiulioRomualdi (5)
  • lianbin (4)
  • willat343 (4)
  • barracuda156 (3)
  • slovak194 (3)
  • traversaro (3)
  • yangzhen1031 (3)
  • knightshrub (2)
  • stefangachter (2)
  • markusgft (2)
  • narutojxl (1)
  • w-hc (1)
  • ojura (1)
Pull Request Authors
  • artivis (66)
  • traversaro (9)
  • Chris7462 (4)
  • joansola (4)
  • GiulioRomualdi (3)
  • MarshallVielmetti (2)
  • mattalvarado (2)
  • HenryLeC (2)
  • pettni (2)
  • willat343 (1)
  • diegoferigo (1)
  • dependabot[bot] (1)
  • barracuda156 (1)
Top Labels
Issue Labels
question (13) enhancement (13) bug (11) API (4) Documentation (4) help wanted (3) duplicate (1) good first issue (1)
Pull Request Labels
enhancement (32) bug (19) Documentation (12) API (7) help wanted (2) dependencies (1)

Packages

  • Total packages: 2
  • Total downloads: unknown
  • Total dependent packages: 3
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 3
conda-forge.org: manif
  • Versions: 2
  • Dependent Packages: 2
  • Dependent Repositories: 0
Rankings
Stargazers count: 11.5%
Forks count: 12.2%
Average: 19.3%
Dependent packages count: 19.5%
Dependent repos count: 34.0%
Last synced: 4 months ago
conda-forge.org: manifpy
  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Stargazers count: 11.5%
Forks count: 12.2%
Average: 21.6%
Dependent packages count: 28.8%
Dependent repos count: 34.0%
Last synced: 4 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • actions/checkout v3 composite
  • actions/setup-python v2 composite
.github/workflows/docs.yml actions
  • JamesIves/github-pages-deploy-action 3.7.1 composite
  • actions/checkout v3 composite
  • actions/checkout v2 composite
  • actions/download-artifact v2 composite
  • actions/setup-python v2 composite
  • actions/upload-artifact v2 composite
.github/workflows/release.yml actions
  • actions/checkout v2 composite
  • actions/download-artifact v2 composite
  • actions/setup-python v2 composite
  • actions/upload-artifact v2 composite