bundles / scipy 1.18.0 / scipy / spatial / transform / _rigid_transform / RigidTransform / from_dual_quat
staticmethod
scipy.spatial.transform._rigid_transform:RigidTransform.from_dual_quat
Signature
def from_dual_quat(dual_quat: ArrayLike, *, scalar_first: bool = False) → RigidTransformSummary
Initialize from a unit dual quaternion.
Extended Summary
Unit dual quaternions encode orientation in a real unit quaternion and translation in a dual quaternion. There is a double cover, i.e., the unit dual quaternions q and -q represent the same transform.
Unit dual quaternions must have a real quaternion with unit norm and a dual quaternion that is orthogonal to the real quaternion to satisfy the unit norm constraint. This function will enforce both properties through normalization.
Parameters
dual_quat: array_like, shape (..., 8)Unit dual quaternions. Each dual_quat[..., :] represents a unit dual quaternion. The real part is stored in the first four components and the dual part in the last four components.
scalar_first: bool, optionalWhether the scalar component goes first or last in the two individual quaternions that represent the real and the dual part. Default is False, i.e. the scalar-last order is used.
Returns
transform: `RigidTransform` instanceRigid transform objects with the same leading dimensions as the input.
Examples
from scipy.spatial.transform import RigidTransform as Tf import numpy as np✓
tf = Tf.from_dual_quat([ 0.0617101, -0.06483886, 0.31432811, 0.94508498, 0.04985168, -0.26119618, 0.1691491, -0.07743254])✓
tf.as_matrix()
✗array([[ 0.79399, -0.60214, -0.08376, 0.24605],
[ 0.58613, 0.79478, -0.1574 , -0.49328],
[ 0.16135, 0.07588, 0.98398, 0.34263],
[ 0. , 0. , 0. , 1. ]])
tf.single
✓True
Aliases
scipy.spatial.transform.RigidTransform.from_dual_quat