Lie#
This module provides a Lie group interface for rigid-body transforms, delegating to
MuJoCo’s quaternion and rotation-matrix routines where possible (e.g.,
from_matrix() calls mujoco.mju_mat2Quat).
This library is heavily ported from jaxlie, swapping out JAX for Numpy and adding a few additional features.
MatrixLieGroup#
- class mink.lie.base.MatrixLieGroup#
Interface definition for matrix Lie groups.
- matrix_dim#
Dimension of square matrix output.
- Type:
int
- parameters_dim#
Dimension of underlying parameters.
- Type:
int
- tangent_dim#
Dimension of tangent space.
- Type:
int
- space_dim#
Dimension of coordinates that can be transformed.
- Type:
int
- abstract classmethod identity() Self#
Returns identity element.
- Return type:
Self
- abstract classmethod from_matrix(matrix: ndarray) Self#
Get group member from matrix representation.
- Parameters:
matrix (ndarray)
- Return type:
Self
- abstract classmethod sample_uniform() Self#
Draw a uniform sample from the group.
- Return type:
Self
- abstract as_matrix() ndarray#
Get transformation as a matrix.
- Return type:
ndarray
- abstract parameters() ndarray#
Get underlying representation.
- Return type:
ndarray
- abstract apply(target: ndarray) ndarray#
Applies group action to a point.
- Parameters:
target (ndarray)
- Return type:
ndarray
- abstract multiply(other: Self) Self#
Composes this transformation with another.
- Parameters:
other (Self)
- Return type:
Self
- abstract classmethod exp(tangent: ndarray) Self#
Computes expm(wedge(tangent)).
- Parameters:
tangent (ndarray)
- Return type:
Self
- abstract log() ndarray#
Computes vee(logm(transformation matrix)).
- Return type:
ndarray
- abstract adjoint() ndarray#
Computes the adjoint.
- Return type:
ndarray
- abstract inverse() Self#
Computes the inverse of the transform.
- Return type:
Self
- abstract normalize() Self#
Normalize/projects values and returns.
- Return type:
Self
- interpolate(other: Self, alpha: float = 0.5) Self#
Interpolate between two matrix Lie groups.
- Parameters:
other (Self) – The other Lie group, which serves as the end point of interpolation.
alpha (float) – The fraction of interpolation between [self, other]. This must be within [0.0, 1.0]. 0.0 = self, 1.0 = other.
- Returns:
The interpolated matrix Lie group.
- Return type:
Self
- plus(other: ndarray) Self#
Alias for rplus.
- Parameters:
other (ndarray)
- Return type:
Self
- minus(other: Self) ndarray#
Alias for rminus.
- Parameters:
other (Self)
- Return type:
ndarray
SO3#
- class mink.lie.so3.SO3#
Bases:
MatrixLieGroupSpecial orthogonal group for 3D rotations.
Internal parameterization is (qw, qx, qy, qz). Tangent parameterization is (omega_x, omega_y, omega_z).
- parameters() ndarray#
Get underlying representation.
- Return type:
ndarray
- classmethod from_matrix(matrix: ndarray) SO3#
Get group member from matrix representation.
- Parameters:
matrix (ndarray)
- Return type:
- as_matrix() ndarray#
Get transformation as a matrix.
- Return type:
ndarray
- apply(target: ndarray) ndarray#
Applies group action to a point.
- Parameters:
target (ndarray)
- Return type:
ndarray
- classmethod exp(tangent: ndarray) SO3#
Computes expm(wedge(tangent)).
- Parameters:
tangent (ndarray)
- Return type:
- log() ndarray#
Computes vee(logm(transformation matrix)).
- Return type:
ndarray
- adjoint() ndarray#
Computes the adjoint.
- Return type:
ndarray
- clamp(roll_radians: tuple[float, float] = (-inf, inf), pitch_radians: tuple[float, float] = (-inf, inf), yaw_radians: tuple[float, float] = (-inf, inf)) SO3#
Clamp a SO3 within RPY limits.
- Parameters:
roll_radians (tuple[float, float]) – The (lower, upper) limits for the roll.
pitch_radians (tuple[float, float]) – The (lower, upper) limits for the pitch.
yaw_radians (tuple[float, float]) – The (lower, upper) limits for the yaw.
- Returns:
A SO3 within the RPY limits.
- Return type:
SE3#
- class mink.lie.se3.SE3#
Bases:
MatrixLieGroupSpecial Euclidean group for proper rigid transforms in 3D.
Internal parameterization is (qw, qx, qy, qz, x, y, z). Tangent parameterization is (vx, vy, vz, omega_x, omega_y, omega_z).
- parameters() ndarray#
Get underlying representation.
- Return type:
ndarray
- classmethod from_matrix(matrix: ndarray) SE3#
Get group member from matrix representation.
- Parameters:
matrix (ndarray)
- Return type:
- as_matrix() ndarray#
Get transformation as a matrix.
- Return type:
ndarray
- classmethod exp(tangent: ndarray) SE3#
Computes expm(wedge(tangent)).
- Parameters:
tangent (ndarray)
- Return type:
- apply(target: ndarray) ndarray#
Applies group action to a point.
- Parameters:
target (ndarray)
- Return type:
ndarray
- log() ndarray#
Computes vee(logm(transformation matrix)).
- Return type:
ndarray
- adjoint() ndarray#
Computes the adjoint.
- Return type:
ndarray
- clamp(x_translation: tuple[float, float] = (-inf, inf), y_translation: tuple[float, float] = (-inf, inf), z_translation: tuple[float, float] = (-inf, inf), roll_radians: tuple[float, float] = (-inf, inf), pitch_radians: tuple[float, float] = (-inf, inf), yaw_radians: tuple[float, float] = (-inf, inf)) SE3#
Clamp a SE3 within translation and RPY limits.
- Parameters:
x_translation (tuple[float, float]) – The (lower, upper) limits for translation along the x axis.
y_translation (tuple[float, float]) – The (lower, upper) limits for translation along the y axis.
z_translation (tuple[float, float]) – The (lower, upper) limits for translation along the z axis.
roll_radians (tuple[float, float]) – The (lower, upper) limits for the roll.
pitch_radians (tuple[float, float]) – The (lower, upper) limits for the pitch.
yaw_radians (tuple[float, float]) – The (lower, upper) limits for the yaw.
- Returns:
A SE3 within the translation and RPY limits.
- Return type: