Functions for the Lie Algebra group SE(2) and SE(3)
where:
- (
$\mathbf{R} \in SO(2) $ ) is the rotation matrix. - (
$\mathbf{t} \in \mathbb{R}^2 $ ) is the translation vector.
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.
To install the library run: pip install lie_groups_py
- Install Poetry
make init
to create the virtual environment and install dependenciesmake format
to format the code and check for errorsmake test
to run the test suitemake clean
to delete the temporary files and directoriespoetry publish --build
to build and publish to https://pypi.org/project/lie_groups_py/
"""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()