• Stars
    star
    214
  • Rank 184,678 (Top 4 %)
  • Language
    C++
  • License
    Other
  • Created about 1 year ago
  • Updated 3 months ago

Reviews

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

Repository Details

A C++ header-only Eigen-based Library for Lie group operations

Lie++

License

Lie-plusplus logo

Maintainer: Alessandro Fornasier

Description

Lie++ is a header-only C++ library based on Eigen for Lie groups. It provides a set of classes and functions for working with common Lie groups encountered in robotics application.

Base groups Applications
SO(3) Rotation
SE(3) Pose
SE2(3) Extended pose
SEn(3) SLAM
SOT(3) Rotation and scaling
TG(3) Inertial navigation with IMU bias
SDB(3) Inertial navigation with IMU bias

Installation

This is a header-only C++ library meant to be used within other projects. Either copy the content of include folder within the external project's include folder or use cmake's FetchContent_Declare as follows

FetchContent_Declare(
    LiePlusPlus
    GIT_REPOSITORY  
    GIT_TAG         main
    GIT_SHALLOW     TRUE
    GIT_PROGRESS    TRUE
)
list(APPEND external LiePlusPlus) 
list(APPEND include_dirs ${LIEPLUSPLUS_INCLUDE_DIR})
list(APPEND libs LiePlusPlus Eigen3::Eigen)

Usage

Two mini examples on how to use the base groups of the library and how to compose them to create new groups. For usage of Lie++ in the context of filter design have a look at MSCEqF

Base groups usage

#include <groups/SEn.hpp>

int main(int argc, char **argv)
{
  using SO3d = group::SO3<double>;
  using SE23d = group::SEn3<double, 2>;
  using Vector3d = Eigen::Matrix<double, 3, 1>;
  using Vector9d = Eigen::Matrix<double, 9, 1>;
  using Matrix9d = Eigen::Matrix<double, 9, 9>;
  
  # Define random extended pose X via exponential map
  Vector9d x = Vector9d::Random();
  SE23d X = SE23d::exp(x);
  
  # Define Extended pose Y with identity rotation, and given velocity and position
  Vector3d p = Vector3d(1, 2, 3);
  Vector3d v = Vector3d(0.1, 0.1, 0.3);
  SO3d R = SO3d();
  SE23d Y = SE23d(R, {v, p});
  
  # Get extended pose composition Z = XY
  SE23d Z = X*Y;
  
  # print Z as matrix
  std::cout << Z.asMatrix() << std::endl;
  
  # print Rotational component of Z as quaternion, position and velocity
  std::cout << Z.q() << '\n' << Z.p() << '\n'<< Z.v() << '\n' std::endl;
  
  # get Adjoint matrix of SE23
  Matrix9d AdZ = Z.Adjoint();
}

Composition of groups

#include <groups/SEn.hpp>

/**
 * @brief Composition of SO(3) and SE(3) via direct product
 */
template <typename FPType>
class ComposedGroup
{
  public:
    using SO3 = group::SO3<FPType>;
    using SE3 = group::SEn3<FPType, 1>;
    using Vector3 = Eigen::Matrix<FPType, 3, 1>;
    using Vector6 = Eigen::Matrix<FPType, 6, 1>;
    using Vector9 = Eigen::Matrix<FPType, 9, 1>;
  
    ComposedGroup() : C_(), P_() {};
    
    ComposedGroup(const SO3& C, const SE3& P) : C_(C), P_(P) {};
    
    // other constructors ...
    
    [[nodiscard]] static const ComposedGroup exp(const Vector9& u)
    {
      return ComposedGroup(SO3::exp(u.template block<3, 1>(0, 0)), SE3::exp(u.template block<6, 1>(3, 0)));
    }

    [[nodiscard]] static const Vector9 log(const ComposedGroup& X)
    {
      Vector6 u = Vector9::Zero();
      u.template block<3, 1>(0, 0) = SO3::log(X.C_);
      u.template block<6, 1>(3, 0) = SE3::log(X.P_);
      return u;
    }
    
    [[nodiscard]] const ComposedGroup operator*(const ComposedGroup& other) const
    {
      return ComposedGroup(C_ * other.C_, P_ * other.P_);
    }
    
    // other methods ...
    
  private:
    SO3 C_;
    SE3 P_;
    
}

Credit

This code was written within the Control of Networked System (CNS), University of Klagenfurt.

License

This software is made available to the public to use (source-available), licensed under the terms of the BSD-2-Clause-License with no commercial use allowed, the full terms of which are made available in the LICENSE file. No license in patents is granted.

Usage for academic purposes

If you use this software in an academic research setting, please cite the corresponding paper.

@article{fornasier2023equivariant,
  title={Equivariant Symmetries for Inertial Navigation Systems},
  author={Fornasier, Alessandro and Ge, Yixiao and van Goor, Pieter and Mahony, Robert and Weiss, Stephan},
  journal={arXiv preprint arXiv:2309.03765},
  year={2023}
}

@article{fornasier2023msceqf,
  title={MSCEqF: A Multi State Constraint Equivariant Filter for Vision-aided Inertial Navigation},
  author={Fornasier, Alessandro and van Goor, Pieter and Allak, Eren and Mahony, Robert and Weiss, Stephan},
  journal={arXiv preprint arXiv:2311.11649},
  year={2023}
}

More Repositories

1

mars_lib

MaRS: A Modular and Robust Sensor-Fusion Framework
C++
258
star
2

MSCEqF

A Multi State Constraint Equivariant Filter for Vision-aided Inertial Navigation
C++
84
star
3

mars_ros

A ROS wrapper for the MaRS Library
C++
52
star
4

ABC-EqF

Equivariant Filter implementation for attitude, gyroscope bias and calibration estimation. From "Overcoming Bias: Equivariant Filter Design for Biased Attitude Estimation with Online Calibration"
Python
44
star
5

vins_eval

VINS Eval ROS1 Workspace
Shell
37
star
6

insane_dataset_tools

Tools to process data from the INSANE data set
MATLAB
16
star
7

flight_stack

The CNS Flight Stack: A Flight Stack for Reproducible and Customizable Autonomy Applications in Research and Industry
Shell
13
star
8

uwb_init

UWB anchors initialization procedure C++ Library and ROS1 wrapper
C++
5
star
9

mars_ros2

A ROS2 wrapper for the MaRS Library
C++
4
star
10

cnspy_rosbag2csv

A python3 package to convert different ROS1 messages for POSES into CSV files.
Python
4
star
11

cnspy_trajectory_evaluation

A python3 package for evaluating trajectories for different error metrics.
Python
4
star
12

autonomy_engine

CNS Flight Stack: Autonomy Engine
C++
3
star
13

scampi_ks_mars_fusion

This repository holds the Ceres implementation of the kinematic solver for suspended cable robots considering cable sag and its corresponding ROS nodes for fusing it with an onboard IMU
Jupyter Notebook
2
star
14

flight_stack_env

Shell
2
star
15

mission_sequencer

CNS Flight Stack: Mission Sequencer
C++
2
star
16

vins_eval_tools

Python
1
star
17

flight_setup_manual

Description on how a UAV with a Pixhawk flight computer is setup at the Control of Networked Systems Group (CNS) at the University of Klagenfurt
1
star
18

ikf_lib

Isolated Kalman Filtering C++ library
C++
1
star
19

poet

PoET: Pose Estimation Transformer for Single-View, Multi-Object 6D Pose Estimation
1
star