• Stars
    star
    1,455
  • Rank 32,325 (Top 0.7 %)
  • Language
    C++
  • License
    MIT License
  • Created over 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.
  • 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 provides a thorough introduction to Lie theory, in a simplified way so as to make the entrance to Lie theory easy for the average roboticist who is interested in designing rigorous and elegant state estimation algorithms.

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.

It 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 \mathbf\Phi^{-1} X.inverse()
Composition \mathbf\mathcal{X}\circ\mathbf\mathcal{Y} X * Y
X.compose(Y)
Hat \varphi^\wedge w.hat()
Act on vector \mathbf\mathcal{X}\circ\mathbf v X.act(v)
Retract to group element \exp(\mathbf\varphi^\wedge w.exp()
Lift to tangent space \log(\mathbf\mathcal{X})^\vee X.log()
Manifold Adjoint \operatorname{Adj}(\mathbf\mathcal{X}) X.adj()
Tangent adjoint \operatorname{adj}(\mathbf\varphi^\wedge w.smallAdj()
Composed Operation
Manifold right plus \mathbf\mathcal{X}\circ\exp(\mathbf\varphi^\wedge) X + w
X.plus(w)
X.rplus(w)
Manifold left plus \exp(\mathbf\varphi^\wedge)\circ\mathbf\mathcal{X} w + X
w.plus(X)
w.lplus(X)
Manifold right minus \log(\mathbf\mathcal{Y}^{-1}\circ\mathbf\mathcal{X})^\vee X - Y
X.minus(Y)
X.rminus(Y)
Manifold left minus \log(\mathbf\mathcal{X}\circ\mathbf\mathcal{Y}^{-1})^\vee X.lminus(Y)
Between \mathbf\mathcal{X}^{-1}\circ\mathbf\mathcal{Y} X.between(Y)
Inner Product \langle\varphi,\tau\rangle w.inner(t)
Norm \left\lVert\varphi\right\rVert w.weightedNorm()
w.squaredWeightedNorm()

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

Jacobians

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

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

\frac{\delta f(\mathbf\mathcal{X})}{\delta\mathbf\mathcal{X}}

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

in C++,

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

  SE3d::Jacobian J_o_x, J_o_w;

  auto X_plus_w = X.plus(w, J_o_x, J_o_w);

in Python,

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

  J_o_x = np.zeros((SE3.DoF, SE3.DoF))
  J_o_w = np.zeros((SE3.DoF, SE3.DoF))

  X_plus_w = X.plus(w, J_o_x, J_o_w)

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.

More Repositories

1

kalmanif

A small collection of Kalman Filters on Lie groups
C++
337
star
2

laser_odometry

A pluginlib-based package for laser-odometry
C++
67
star
3

distance_map

A ROS package for converting OccupancyGrid/Costmap2D to 2D distance map.
C++
59
star
4

pointcloud_to_rangeimage

[ROS][C++] Convert a pointcloud to rangeimage and back to pointcloud
C++
58
star
5

MOSSE_tracker

C++ implementation of the MOSSE tracker
C++
32
star
6

epnp

Catkinization of epnp
C++
27
star
7

ros2_best_practices

23
star
8

rpipress-downloader

Download Raspberry Pi Press issues
Python
16
star
9

carmen_publisher

[python][ROS] convert CARMEN log files to ROS msgs
Python
15
star
10

boost_serialization_helper

C++
8
star
11

laser_odometry_csm

A laser_odometry wrapper for csm.
C++
6
star
12

metacol

A collection of meta-programming tools & tricks
C++
6
star
13

calibration_2_relative_pose

Calibration of a SpheriCam (2 fisheye cameras back-to-back) *Matlab*
MATLAB
5
star
14

mico_ros

A micro-ROS on Raspberry Pi Pico playground.
C
5
star
15

lspdlog

Lazy spdlog
CMake
5
star
16

build-catkin-tools

catkin_tools build system for Atom
JavaScript
4
star
17

ros2hellocli

A minimal plugin example for ROS 2 command line tools.
Python
4
star
18

ros_imresize

[ROS] Resize an image and update its camera info
C++
4
star
19

soft20

my catkinization of SOFT package 2.0
C
4
star
20

laser_odometry_libpointmatcher

A laser_odometry wrapper for libpointmatcher.
C++
4
star
21

ansible-role-ros

An Ansible role to set up a ROS environment
3
star
22

laser_odometry_rf2o

A laser_odometry wrapper for rf2o.
Python
2
star
23

laser_odometry_polar

A laser_odometry wrapper for the polar scan matcher.
C++
2
star
24

ros_fuse_point_cloud

[ROS] provide node to subscribe to multiple point cloud and fuse them into a single one
C++
2
star
25

benchmark_2d_laser_odom

C++
2
star
26

laser_odometry_srf

A laser_odometry wrapper for srf.
C++
1
star
27

omnidirectional_rig

C++
1
star
28

dotfiles

Because there is no place like $HOME
Vim Script
1
star
29

laser_odometry-release

Release track for laser_odometry package
1
star
30

ros_msgs_sync

[ROS] synchronises msgs
C++
1
star
31

ros2_playground

C++
1
star
32

lambt

a simple time profiler utility
C++
1
star