skbot.transform.QuaternionRotation¶
- class skbot.transform.QuaternionRotation(quaternion, *, sequence='xyzw', axis=- 1)[source]¶
Rotation based on Quaternions in 3D.
- Parameters
- quaternionArrayLike
A (possibly non-unit norm) quaternion in
sequence
format. It will be normalized to unit norm.- sequencestr
Specifies the order of parameters in the quaternion. Possible values are
"xyzw"
(default), i.e., scalar-last, or “wxyz”, i.e., scalar-first.- axisint
The axis along which to to compute. Default: -1.
Notes
The current implementation uses scipy’s rotation class. As such you are limited to a single batch dimension. If this is to little, please open an issue.
Attributes
affine_matrix
The transformation matrix mapping the parent to the child frame.
angle
The magnitude of the rotation (in radians).
Method Summary
__call__
(parent[, child, add_inverse])Add this link to the parent frame.
invert
()Return a new Link that is the inverse of this link.
transform
(x)Expresses the vector x (assumed to be given in the parent's frame) in the child's frame.
Transform x (given in the child frame) into the parent frame.
Methods
- __call__(parent, child=None, *, add_inverse=True)¶
Add this link to the parent frame.
- Parameters
- parentFrame
The Frame from which vectors originate.
- childFrame
The Frame in which vectors are expressed after they were mapped by this link’s transform. If None, a new child will be created.
- add_inversebool
Also add the inverse link to the child if this Link is invertible. Defaults to
True
.
- Returns
- childFrame
The Frame in which vectors are expressed after they were mapped by this link’s transform.
- Return type
- transform(x)¶
Expresses the vector x (assumed to be given in the parent’s frame) in the child’s frame.
- Parameters
- xArrayLike
The vector expressed in the parent’s frame
- Returns
- yArrayLike
The vector expressed in the child’s frame
- Return type
ndarray
- __inverse_transform__(x)¶
Transform x (given in the child frame) into the parent frame.
- Parameters
- xArrayLike
The vector expressed in the childs’s frame
- Returns
- yArrayLike
The vector expressed in the parents’s frame
- Return type
ndarray