rofunc.utils.datalab.poselib.poselib.core.rotation3d#

1.  Module Contents#

1.1.  Functions#

quat_mul

quaternion multiplication

quat_pos

make all the real part of the quaternion positive

quat_abs

quaternion norm (unit quaternion represents a 3D rotation, which has norm of 1)

quat_unit

normalized quaternion with norm of 1

quat_conjugate

quaternion with its imaginary part negated

quat_real

real component of the quaternion

quat_imaginary

imaginary components of the quaternion

quat_norm_check

verify that a quaternion has norm 1

quat_normalize

Construct 3D rotation from quaternion (the quaternion needs not to be normalized).

quat_from_xyz

Construct 3D rotation from the imaginary component

quat_identity

Construct 3D identity rotation given shape

quat_from_angle_axis

Create a 3D rotation from angle and axis of rotation. The rotation is counter-clockwise along the axis.

quat_from_rotation_matrix

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

quat_mul_norm

Combine two set of 3D rotations together using *** operator. The shape needs to be broadcastable

quat_rotate

Rotate a 3D vector with the 3D rotation

quat_inverse

The inverse of the rotation

quat_identity_like

Construct identity 3D rotation with the same shape

quat_angle_axis

The (angle, axis) representation of the rotation. The axis is normalized to unit length. The angle is guaranteed to be between [0, pi].

quat_yaw_rotation

Yaw rotation (rotation along z-axis)

transform_from_rotation_translation

Construct a transform from a quaternion and 3D translation. Only one of them can be None.

transform_identity

Identity transformation with given shape

transform_rotation

Get rotation from transform

transform_translation

Get translation from transform

transform_inverse

Inverse transformation

transform_identity_like

identity transformation with the same shape

transform_mul

Combine two transformation together

transform_apply

Transform a 3D vector

rot_matrix_det

Return the determinant of the 3x3 matrix. The shape of the tensor will be as same as the shape of the matrix

rot_matrix_integrity_check

Verify that a rotation matrix has a determinant of one and is orthogonal

rot_matrix_from_quaternion

Construct rotation matrix from quaternion

euclidean_to_rotation_matrix

Get the rotation matrix on the top-left corner of a Euclidean transformation matrix

euclidean_integrity_check

euclidean_translation

Get the translation vector located at the last column of the matrix

euclidean_inverse

Compute the matrix that represents the inverse rotation

euclidean_to_transform

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