https://github.com/ami-iit/liecasadi
Rigid transform using Lie groups and Dual Quaternions, written in CasADi!
Science Score: 23.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
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.8%) to scientific vocabulary
Keywords
Repository
Rigid transform using Lie groups and Dual Quaternions, written in CasADi!
Basic Info
Statistics
- Stars: 81
- Watchers: 19
- Forks: 8
- Open Issues: 0
- Releases: 7
Topics
Metadata Files
README.md
liecasadi
liecasadi implements Lie groups operation written in CasADi, mainly directed to optimization problem formulation.
Inspired by A micro Lie theory for state estimation in robotics and the library Manif.
🐍 Install
Conda
Create a conda environment
conda create -n liecasadienv
and install the library
conda install liecasadi
Pip
Create a virtual environment, if you prefer. For example:
bash
pip install virtualenv
python3 -m venv your_virtual_env
source your_virtual_env/bin/activate
Inside the virtual environment, install the library from pip:
bash
pip install liecasadi
If you want the last version:
bash
pip install "liecasadi @ git+https://github.com/ami-iit/lie-casadi.git"
Implemented Groups
| Group | Description | | --------- | ------------------ | | SO3 | 3D Rotations | | SE3 | 3D Rigid Transform | | S1 | Circle (1D angle) |
🚀 Operations
Being:
$X, Y \in SO3, \ SE3, \ S1$
$w \in \text{SO3Tangent}, \ \text{SE3Tangent}, \ \text{S1Tangent}$
$v \in \mathbb{R}^3$
| Operation | | Code |
| :------------------ | :-----------------------------------: | :-----------: |
| Inverse | $X^{-1}$ | X.inverse() |
| Composition | $X \circ Y$ | X*Y |
| Exponential | $\text{exp}(w)$ | phi.exp() |
| Act on vector | $X \circ v$ | X.act(v) |
| Logarithm | $\text{log}(X)$ | X.log() |
| Manifold right plus | $X \oplus w = X \circ \text{exp}(w)$ | X + phi |
| Manifold left plus | $w \oplus X = \text{exp}(w) \circ X$ | phi + X |
| Manifold minus | $X-Y = \text{log}(Y^{-1} \circ X)$ | X-Y |
🦸♂️ Example
```python from liecasadi import SE3, SO3, SE3Tangent, SO3Tangent
Random quaternion + normalization
quat = (np.random.rand(4) - 0.5) * 5 quat = quat / np.linalg.norm(quat)
Random vector
vector3d = (np.random.rand(3) - 0.5) * 2 * np.pi
Create SO3 object
rotation = SO3(quat)
Create Identity
identity = SO3.Identity()
Create SO3Tangent object
tangent = SO3Tangent(vector3d)
Random translation vector
pos = (np.random.rand(3) - 0.5) * 5
Create SE3 object
transform = SE3(pos=pos, xyzw=quat)
Random vector
vector6d = (np.random.rand(3) - 0.5) * 5
Create SE3Tangent object
tangent = SO3Tangent(vector6d) ```
Dual Quaternion example
```python from liecasadi import SE3, DualQuaternion from numpy import np
orientation quaternion generation
quat1 = (np.random.rand(4) - 0.5) * 5 quat1 = quat1 / np.linalg.norm(quat1) quat2 = (np.random.rand(4) - 0.5) * 5 quat2 = quat2 / np.linalg.norm(quat2)
translation vector generation
pos1 = (np.random.rand(3) - 0.5) * 5 pos2 = (np.random.rand(3) - 0.5) * 5
dualquaternion1 = DualQuaternion(quat1, pos1) dualquaternion2 = DualQuaternion(quat2, pos2)
from a homogenous matrix
(using liecasadi.SE3 to generate the corresponding homogenous matrix)
H = SE3.frompositionquaternion(pos, quat).asmatrix() dualquaternion1 = DualQuaternion.from_matrix(H)
Concatenation of rigid transforms
q1xq2 = dualquaternion1 * dualquaternion2
to homogeneous matrix
print(q1xq2.as_matrix())
obtain translation
print(q1xq2.translation())
obtain rotation
print(q1xq2.rotation().as_matrix())
transform a point
point = np.random.randn(3,1) transformedpoint = dualquaternion1.transform_point(point)
create an identity dual quaternion
I = DualQuaternion.Identity() ```
🦸♂️ Contributing
liecasadi is an open-source project. Contributions are very welcome!
Open an issue with your feature request or if you spot a bug. Then, you can also proceed with a Pull-requests! :rocket:
Owner
- Name: Artificial and Mechanical Intelligence
- Login: ami-iit
- Kind: organization
- Location: Italy
- Website: https://ami.iit.it/
- Repositories: 111
- Profile: https://github.com/ami-iit
GitHub Events
Total
- Create event: 5
- Release event: 1
- Issues event: 1
- Watch event: 22
- Delete event: 3
- Issue comment event: 4
- Push event: 8
- Pull request review comment event: 8
- Pull request review event: 15
- Pull request event: 9
- Fork event: 1
Last Year
- Create event: 5
- Release event: 1
- Issues event: 1
- Watch event: 22
- Delete event: 3
- Issue comment event: 4
- Push event: 8
- Pull request review comment event: 8
- Pull request review event: 15
- Pull request event: 9
- Fork event: 1
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| giulero | g****o@g****m | 104 |
| Daniele Pucci | d****5@g****m | 1 |
| Fabio | f****i@g****m | 1 |
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- misofey (1)
Pull Request Authors
- Giulero (4)
- FabioBergonti (1)
- edxmorgan (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 913 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 6
- Total maintainers: 1
pypi.org: liecasadi
Rigid transform using Lie groups, written in CasADi!
- Documentation: https://liecasadi.readthedocs.io/
- License: BSD 3-Clause License Copyright (c) 2022, Artificial and Mechanical Intelligence All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
Latest release: 0.0.7
published 12 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout master composite
- actions/download-artifact v2 composite
- actions/setup-python v2 composite
- actions/upload-artifact v2 composite
- pypa/gh-action-pypi-publish master composite
- actions/checkout v2 composite
- conda-incubator/setup-miniconda v2 composite