rofunc.utils.datalab.poselib.poselib.core.rotation3d#
1. Module Contents#
1.1. Functions#
quaternion multiplication |
|
make all the real part of the quaternion positive |
|
quaternion norm (unit quaternion represents a 3D rotation, which has norm of 1) |
|
normalized quaternion with norm of 1 |
|
quaternion with its imaginary part negated |
|
real component of the quaternion |
|
imaginary components of the quaternion |
|
verify that a quaternion has norm 1 |
|
Construct 3D rotation from quaternion (the quaternion needs not to be normalized). |
|
Construct 3D rotation from the imaginary component |
|
Construct 3D identity rotation given shape |
|
Create a 3D rotation from angle and axis of rotation. The rotation is counter-clockwise along the axis. |
|
Construct a 3D rotation from a valid 3x3 rotation matrices. Reference can be found here: http://www.cg.info.hiroshima-cu.ac.jp/~miyazaki/knowledge/teche52.html |
|
Combine two set of 3D rotations together using *** operator. The shape needs to be broadcastable |
|
Rotate a 3D vector with the 3D rotation |
|
The inverse of the rotation |
|
Construct identity 3D rotation with the same shape |
|
The (angle, axis) representation of the rotation. The axis is normalized to unit length. The angle is guaranteed to be between [0, pi]. |
|
Yaw rotation (rotation along z-axis) |
|
Construct a transform from a quaternion and 3D translation. Only one of them can be None. |
|
Identity transformation with given shape |
|
Get rotation from transform |
|
Get translation from transform |
|
Inverse transformation |
|
identity transformation with the same shape |
|
Combine two transformation together |
|
Transform a 3D vector |
|
Return the determinant of the 3x3 matrix. The shape of the tensor will be as same as the shape of the matrix |
|
Verify that a rotation matrix has a determinant of one and is orthogonal |
|
Construct rotation matrix from quaternion |
|
Get the rotation matrix on the top-left corner of a Euclidean transformation matrix |
|
Get the translation vector located at the last column of the matrix |
|
Compute the matrix that represents the inverse rotation |
|
Construct a transform from a Euclidean transformation matrix |
1.2. API#
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_mul(a, b)#
quaternion multiplication
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_pos(x)#
make all the real part of the quaternion positive
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_abs(x)#
quaternion norm (unit quaternion represents a 3D rotation, which has norm of 1)
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_unit(x)#
normalized quaternion with norm of 1
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_conjugate(x)#
quaternion with its imaginary part negated
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_real(x)#
real component of the quaternion
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_imaginary(x)#
imaginary components of the quaternion
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_norm_check(x)#
verify that a quaternion has norm 1
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_normalize(q)#
Construct 3D rotation from quaternion (the quaternion needs not to be normalized).
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_from_xyz(xyz)#
Construct 3D rotation from the imaginary component
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_identity(shape: List[int])#
Construct 3D identity rotation given shape
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_from_angle_axis(angle, axis, degree: bool = False)#
Create a 3D rotation from angle and axis of rotation. The rotation is counter-clockwise along the axis.
The rotation can be interpreted as a_R_b where frame “b” is the new frame that gets rotated counter-clockwise along the axis from frame “a”
- Parameters:
angle (Tensor) – angle of rotation
axis (Tensor) – axis of rotation
degree (bool, optional, default=False) – put True here if the angle is given by degree
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_from_rotation_matrix(m)#
Construct a 3D rotation from a valid 3x3 rotation matrices. Reference can be found here: http://www.cg.info.hiroshima-cu.ac.jp/~miyazaki/knowledge/teche52.html
- Parameters:
m (Tensor) – 3x3 orthogonal rotation matrices.
- Return type:
Tensor
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_mul_norm(x, y)#
Combine two set of 3D rotations together using *** operator. The shape needs to be broadcastable
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_rotate(rot, vec)#
Rotate a 3D vector with the 3D rotation
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_inverse(x)#
The inverse of the rotation
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_identity_like(x)#
Construct identity 3D rotation with the same shape
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_angle_axis(x)#
The (angle, axis) representation of the rotation. The axis is normalized to unit length. The angle is guaranteed to be between [0, pi].
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.quat_yaw_rotation(x, z_up: bool = True)#
Yaw rotation (rotation along z-axis)
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.transform_from_rotation_translation(r: Optional[torch.Tensor] = None, t: Optional[torch.Tensor] = None)#
Construct a transform from a quaternion and 3D translation. Only one of them can be None.
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.transform_identity(shape: List[int])#
Identity transformation with given shape
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.transform_rotation(x)#
Get rotation from transform
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.transform_translation(x)#
Get translation from transform
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.transform_inverse(x)#
Inverse transformation
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.transform_identity_like(x)#
identity transformation with the same shape
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.transform_mul(x, y)#
Combine two transformation together
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.transform_apply(rot, vec)#
Transform a 3D vector
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.rot_matrix_det(x)#
Return the determinant of the 3x3 matrix. The shape of the tensor will be as same as the shape of the matrix
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.rot_matrix_integrity_check(x)#
Verify that a rotation matrix has a determinant of one and is orthogonal
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.rot_matrix_from_quaternion(q)#
Construct rotation matrix from quaternion
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.euclidean_to_rotation_matrix(x)#
Get the rotation matrix on the top-left corner of a Euclidean transformation matrix
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.euclidean_integrity_check(x)#
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.euclidean_translation(x)#
Get the translation vector located at the last column of the matrix
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.euclidean_inverse(x)#
Compute the matrix that represents the inverse rotation
- rofunc.utils.datalab.poselib.poselib.core.rotation3d.euclidean_to_transform(transformation_matrix)#
Construct a transform from a Euclidean transformation matrix