https://github.com/tsmorz/lie_groups
Functions for the Lie Algebra goups SO(2), SE(2), SO(3), are SE(3) that are commonly used in robotics and computer vision.
https://github.com/tsmorz/lie_groups
computer-vision estimation lie-algebra lie-groups robotics
Last synced: 6 months ago
JSON representation
Functions for the Lie Algebra goups SO(2), SE(2), SO(3), are SE(3) that are commonly used in robotics and computer vision.
- Host: GitHub
- URL: https://github.com/tsmorz/lie_groups
- Owner: Tsmorz
- License: bsd-3-clause
- Created: 2025-03-30T17:22:26.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-02T01:10:59.000Z (about 1 year ago)
- Last Synced: 2025-09-21T06:21:14.749Z (7 months ago)
- Topics: computer-vision, estimation, lie-algebra, lie-groups, robotics
- Language: Python
- Homepage: https://www.geometrictools.com/Documentation/InterpolationRigidMotions.pdf
- Size: 120 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LieGroupsPy
Functions for the Lie Algebra group SE(2) and SE(3)
$$ SE(2) =
\begin{bmatrix}
R_{11} & R_{12} & t_1 \\
R_{21} & R_{22} & t_2 \\
0 & 0 & 1
\end{bmatrix} $$
where:
- \( $\mathbf{R} \in SO(2) $\) is the **rotation matrix**.
- \( $\mathbf{t} \in \mathbb{R}^2 $\) is the **translation vector**.
$$ SE(3) =
\begin{bmatrix}
R_{11} & R_{12} & R_{13} & t_1 \\
R_{21} & R_{22} & R_{23} & t_2 \\
R_{31} & R_{32} & R_{33} & t_3 \\
0 & 0 & 0 & 1
\end{bmatrix} $$
where:
- \( $\mathbf{R} \in SO(3) $\) is the **rotation matrix**.
- \( $\mathbf{t} \in \mathbb{R}^3 $\) is the **translation vector**.
This representation is commonly used in **robotics and computer vision** for rigid body transformations.
## Install
To install the library run: `pip install lie_groups_py`
## Development
0. Install [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer)
1. `make init` to create the virtual environment and install dependencies
2. `make format` to format the code and check for errors
3. `make test` to run the test suite
4. `make clean` to delete the temporary files and directories
5. `poetry publish --build` to build and publish to https://pypi.org/project/lie_groups_py/
## Usage
```
"""Basic docstring for my module."""
import matplotlib.pyplot as plt
import numpy as np
from loguru import logger
from lie_groups_py.se3 import SE3, interpolate_se3
def main() -> None:
"""Run a simple demonstration."""
pose_0 = SE3(
xyz=np.array([0.0, 0.0, 0.0]),
rot=np.eye(3),
)
logger.info(pose_0)
pose_1 = SE3(
xyz=np.array([[2.0], [2.0], [8.0]]),
yaw_pitch_roll=(np.pi / 2, np.pi / 4, np.pi / 8),
)
pose_interp = interpolate_se3(pose_0, pose_1, t=0.5)
# plot the results
fig = plt.figure()
ax = fig.add_subplot(111, projection="3d")
pose_0.plot(ax)
pose_1.plot(ax)
pose_interp.plot(ax)
plt.axis("equal")
ax.set_xlabel("x-axis")
ax.set_ylabel("y-axis")
ax.set_zlabel("z-axis")
plt.tight_layout()
plt.show()
if __name__ == "__main__":
main()
```