Utilities¶
Rotation Conversions¶
rot_utils
¶
Rotation utility functions for conversions between representations.
quaternion_to_matrix(quat: np.ndarray) -> np.ndarray
¶
Convert quaternion to 3x3 rotation matrix.
Input
quat: Quaternion in (w, x, y, z) format, shape (4,)
Output: rotation matrix, shape (3, 3)
Source code in autolife_planning/utils/rot_utils.py
matrix_to_quaternion(rot: np.ndarray) -> np.ndarray
¶
Convert 3x3 rotation matrix to quaternion.
Input
rot: Rotation matrix, shape (3, 3)
Output: quaternion in (w, x, y, z) format, shape (4,)
Source code in autolife_planning/utils/rot_utils.py
rpy_to_matrix(roll: float, pitch: float, yaw: float) -> np.ndarray
¶
Convert roll-pitch-yaw (XYZ Euler angles) to rotation matrix.
Input
roll: Rotation around X axis (radians) pitch: Rotation around Y axis (radians) yaw: Rotation around Z axis (radians)
Output: rotation matrix, shape (3, 3)
Source code in autolife_planning/utils/rot_utils.py
matrix_to_rpy(rot: np.ndarray) -> tuple[float, float, float]
¶
Convert rotation matrix to roll-pitch-yaw (XYZ Euler angles).
Input
rot: Rotation matrix, shape (3, 3)
Output: (roll, pitch, yaw) in radians
Source code in autolife_planning/utils/rot_utils.py
axis_angle_to_matrix(axis: np.ndarray, angle: float) -> np.ndarray
¶
Convert axis-angle representation to rotation matrix (Rodrigues formula).
Input
axis: Unit vector representing rotation axis, shape (3,) angle: Rotation angle in radians
Output: rotation matrix, shape (3, 3)
Source code in autolife_planning/utils/rot_utils.py
matrix_to_axis_angle(rot: np.ndarray) -> tuple[np.ndarray, float]
¶
Convert rotation matrix to axis-angle representation.
Input
rot: Rotation matrix, shape (3, 3)
Output: (axis, angle) where axis is unit vector shape (3,), angle in radians