https://github.com/ami-iit/lie-group-controllers

Header-only C++ library containing controllers designed for Lie Groups.

https://github.com/ami-iit/lie-group-controllers

Science Score: 26.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
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.5%) to scientific vocabulary

Keywords

cpp eigen-library header-only lie-groups

Keywords from Contributors

urdf adam-robotics automatic-differentiation casadi jax motion-planning reinforcement-learning rigid-body-dynamics
Last synced: 5 months ago · JSON representation

Repository

Header-only C++ library containing controllers designed for Lie Groups.

Basic Info
Statistics
  • Stars: 71
  • Watchers: 22
  • Forks: 7
  • Open Issues: 1
  • Releases: 5
Topics
cpp eigen-library header-only lie-groups
Created over 5 years ago · Last pushed 7 months ago
Metadata Files
Readme License

README.md

lie-group-controllers

C++ Standard Size Size Size

Header-only C++ library containing controllers designed for Lie Groups

Some theory behind the library

The library aims to contain some controllers designed in lie groups. The library depends only on Eigen and manif.

All the controllers defined in lie-group-controllers have in common that they inherit from a templated base class (CRTP). It allows one to write generic code abstracting the controller details. This follows the structure of manif and Eigen.

The library implements two controllers: 1. Proportional Controller (P controller) 2. Proportional Derivative Controller (PD controller)

The controllers have the following form

| Trivialization | Proportional Controller | Proportional Derivative Controller | | :------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | | Left (default) | $\psi = \psi^d + kp \text{Log}\left(X^d \circ X^{-1}\right)$ | $\dot{\psi} = \dot{\psi}^d + kd \left(\psi^d - \psi \right) + kp \text{Log}\left(X^d \circ X^{-1}\right)$ | | Right | $\psi = \psi^d + kp \text{Log}\left(X^{-1} \circ X^d \right)$ | $\dot{\psi} = \dot{\psi}^d + kd \left(\psi^d - \psi \right) + kp \text{Log}\left(X^{-1}\circ X^d \right)$ |

where X and Xᵈ are elements of a Lie group. is the group operator. ψ represents an element in the Lie algebra of the Lie group whose coordinates are expressed in ℝⁿ.

The controllers support all the groups defined in manif. Namely: - ℝ(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.

Please you can find further information in Modern Robotics: Mechanics, Planning, and Control, Kevin M. Lynch and Frank C. Park, Cambridge University Press, 2017, ISBN 9781107156302

Basic Usage

The library implements proportional and proportional derivative controllers on Lie groups. What follows are two simple snippets that you can follow to build and use such controllers. For sake of simplicity, only controllers in SO(3) are shown. The very same applies to the other Lie groups

Proportional controller SO(3)

```cpp // set random initial state and zero feedforward manif::SO3d desiredState, state; desiredState.setRandom(); state.setRandom(); Eigen::Vector3d feedForward = Eigen::Vector3d::Zero();

// create the controller. ProportionalControllerSO3d controller;

// In case you want to use the right trivialized controller // ProportionalControllerTplSO3dTrivialization::Right controller;

// set the proportional gain const double kp = 10; controller.setGains(kp);

// set the desired state, the feed-forward, and the state controller.setDesiredState(desiredState); controller.setFeedForward(feedForward); controller.setState(state);

// compute the control law controller.computeControlLaw(); const auto& controlOutput = controller.getControl(); ```

Proportional Derivative controller SO(3)

```cpp // set random initial state and zero feedforward manif::SO3d desiredState, state; desiredState.setRandom(); state.setRandom(); manif::SO3d::Tangent stateDerivative = Eigen::Vector3d::Zero(); manif::SO3d::Tangent desiredStateDerivative = Eigen::Vector3d::Zero(); Eigen::Vector3d feedForward = Eigen::Vector3d::Zero();

// create the controller. ProportionalDerivativeControllerSO3d controller;

// In case you want to use the right trivialized controller // ProportionalDerivativeControllerTplSO3dTrivialization::Right controller;

// set the proportional and the derivative gains const double kp = 10; const double kd = 2 * std::sqrt(kp); controller.setGains(kp, kd);

// set the desired state, its derivative, the feed-forward, and the state controller.setDesiredState(desiredState, desiredStateDerivative); controller.setFeedForward(feedForward); controller.setState(state, stateDerivative);

// compute the control law controller.computeControlLaw(); const auto& controlOutput = controller.getControl(); ```

Dependeces

Source installation

console git clone https://github.com/GiulioRomualdi/lie-group-controllers.git cd lie-group-controllers mkdir build && cd build cmake ../ cmake --build . [sudo] cmake --build . --target install If you want to enable tests set the BUILD_TESTING option to ON.

Conda installation

In case you do not need the src file of the library, it is possible to install the library also via conda, using the following command:

console conda install -c conda-forge liblie-group-controllers

Use lie-group-controllers in your project

lie-group-controllers provides native CMake support which allows the library to be easily used in CMake projects. Please add in your CMakeLists.txt

cmake project(foo) find_package(LieGroupControllers REQUIRED) add_executable(${PROJECT_NAME} src/foo.cpp) target_link_libraries(${PROJECT_NAME} LieGroupControllers::LieGroupControllers)

Bug reports and support

All types of issues are welcome.

Note

The original version of the library can be found here.

Owner

  • Name: Artificial and Mechanical Intelligence
  • Login: ami-iit
  • Kind: organization
  • Location: Italy

GitHub Events

Total
  • Release event: 1
  • Watch event: 10
  • Delete event: 3
  • Issue comment event: 2
  • Push event: 11
  • Pull request review event: 3
  • Pull request event: 7
  • Create event: 4
Last Year
  • Release event: 1
  • Watch event: 10
  • Delete event: 3
  • Issue comment event: 2
  • Push event: 11
  • Pull request review event: 3
  • Pull request event: 7
  • Create event: 4

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 59
  • Total Committers: 6
  • Avg Commits per committer: 9.833
  • Development Distribution Score (DDS): 0.203
Past Year
  • Commits: 6
  • Committers: 3
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Giulio Romualdi g****i@g****m 47
Silvio Traversaro s****o@t****t 5
Riccardo r****o@h****m 3
copilot-swe-agent[bot] 1****t 2
Daniele Pucci d****5@g****m 1
Carlotta Sartore 5****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 2
  • Total pull requests: 11
  • Average time to close issues: almost 2 years
  • Average time to close pull requests: 2 days
  • Total issue authors: 1
  • Total pull request authors: 3
  • Average comments per issue: 0.5
  • Average comments per pull request: 1.09
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 9 days
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • GiulioRomualdi (2)
Pull Request Authors
  • GiulioRomualdi (9)
  • traversaro (3)
  • Copilot (1)
  • RiccardoGrieco (1)
Top Labels
Issue Labels
enhancement (1) good first issue (1)
Pull Request Labels
enhancement (2) bug (1) documentation (1)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
conda-forge.org: liblie-group-controllers
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 34.0%
Stargazers count: 40.5%
Average: 43.8%
Forks count: 49.6%
Dependent packages count: 51.2%
Last synced: 6 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions/cache v1 composite
  • actions/checkout master composite
.github/workflows/gh-pages.yml actions
  • JamesIves/github-pages-deploy-action 3.7.1 composite
  • actions/checkout master composite
  • actions/download-artifact v2 composite
  • actions/upload-artifact v2 composite