pyrobopath.toolpath.path.transform.Rotation#
- class pyrobopath.toolpath.path.transform.Rotation(orient: List[float] | Tuple[float, float, float, float] | ndarray[Tuple[Literal[4]], dtype[floating]] | quaternion | None = None)[source]#
Bases:
objectA rotation class that implements spatial rotations on members of the group SO3 (Special Orthogonal)
This class internally represents a rotation as a numpy-quaternion. The aim is to make interpolation as fast as possible – as this is used a lot throughout pyrobopath
Class method constructors facilitate constructing rotations with common SO3 parameterizations (i.e. axis rotations, quaternions, homogeneous transformations, Euler angles.)
- Parameters:
orient (Quat) – The rotational component as {w, x, y, z} (default: [1, 0, 0, 0])
Methods
Construct a new SO(3) rotation instance from Quaternion
Construct a new SO(3) rotation from X-axis rotation
Construct a new SO(3) rotation from Y-axis rotation
Construct a new SO(3) rotation from Z-axis rotation
almost_equalcopyInterpolate between SO(3) instances
Find the inverse transformation of the SE(3) instance
Attributes
- classmethod Quaternion(w: float, x: float, y: float, z: float) Rotation[source]#
Construct a new SO(3) rotation instance from Quaternion
q = [w, x, y, z]
- Parameters:
w (float) – the real component
x (float) – the x component of the imaginary vector
y (float) – the y component of the imaginary vector
z (float) – the z component of the imaginary vector
- Returns:
SE(3) rotation
- Return type:
Pose instance
- classmethod Rx(theta: float) Rotation[source]#
Construct a new SO(3) rotation from X-axis rotation
- Parameters:
θ (float or array_like) – rotation angle about the X-axis
- Returns:
SE(3) rotation
- Return type:
SE3 instance
- classmethod Ry(theta: float) Rotation[source]#
Construct a new SO(3) rotation from Y-axis rotation
- Parameters:
θ (float or array_like) – rotation angle about the Y-axis
- Returns:
SE(3) rotation
- Return type:
SE3 instance
- classmethod Rz(theta: float) Rotation[source]#
Construct a new SO(3) rotation from Z-axis rotation
- Parameters:
θ (float or array_like) – rotation angle about the Z-axis
- Returns:
SE(3) rotation
- Return type:
SE3 instance
- interp(other: Rotation, s: float) Rotation[source]#
Interpolate between SO(3) instances
- Parameters:
other (SO3) – the ending orientation at s = 1.0
s (float) – the interpolation variable s in [0, 1]
- Returns:
the SO(3) instances interpolated at value s
- Return type:
SO(3)
- inv() Rotation[source]#
Find the inverse transformation of the SE(3) instance
- Returns:
SE(3) inverse
- Return type:
SE3
- property matrix: ndarray[Tuple[Literal[3], Literal[3]], dtype[floating]]#
The 3x3 rotation matrix
- Returns:
An array view of the 3x3 rotation matrix
- Return type:
R3x3
- property quat: quaternion#
Get the rotation as a quaternion
- Returns:
The rotation as a quaternion
- Return type:
quat.quaternion