Rigid transform using Lie groups, written in CasADi!
Project description
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
Create a virtual environment, if you prefer. For example:
pip install virtualenv
python3 -m venv your_virtual_env
source your_virtual_env/bin/activate
Inside the virtual environment, install the library from pip:
pip install liecasadi
If you want the last version:
pip install "liecasadi @ git+https://github.com/ami-iit/lie-casadi.git"
Implemented Groups
Group | Description |
---|---|
SO3 | 3D Rotations |
SE3 | 3D Rigid Transform |
🚀 Operations
Being:
-
$X, Y \in SO3, \ SE3$
-
$w \in \text{SO3Tangent}, \ \text{SE3Tangent}$
-
$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
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)
🦸♂️ 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:
⚠️ Work in progress
- Dual Quaternion class
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for liecasadi-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3cbe98ed746b6c66fdce5a606caedae101fe0cc723d80cde60b1fe42360f42b |
|
MD5 | fe8e39cb81af5c75baa8c73385c00404 |
|
BLAKE2b-256 | 5f099ce3ed8d0bacc269f2935288f9f56b9c3020dd321f5d7562bb5762ad22b7 |