symforce.geo.rot3 module¶
- class Rot3(q=None)[source]¶
Bases:
LieGroup
Group of three-dimensional orthogonal matrices with determinant
+1
, representing rotations in 3D space. Backed by a quaternion with (x, y, z, w) storage.- Parameters:
q (T.Optional[Quaternion]) –
- to_storage()[source]¶
Flat list representation of the underlying storage, length of
storage_dim()
. This is used purely for plumbing, it is NOT like a tangent space.
- classmethod from_storage(vec)[source]¶
Construct from a flat list representation. Opposite of
to_storage()
.
- classmethod symbolic(name, **kwargs)[source]¶
Construct a symbolic element with the given name prefix. Kwargs are forwarded to
sf.Symbol
(for example, sympy assumptions).
- classmethod from_tangent(v, epsilon=0.0)[source]¶
Mapping from the tangent space vector about identity into a group element.
- to_tangent(epsilon=0.0)[source]¶
Mapping from this element to the tangent space vector about identity.
- storage_D_tangent()[source]¶
Note: generated from
symforce/notebooks/storage_D_tangent.ipynb
- Return type:
- tangent_D_storage()[source]¶
Note: generated from
symforce/notebooks/tangent_D_storage.ipynb
- Return type:
- to_tangent_norm(epsilon=0.0)[source]¶
Returns the norm of the tangent vector corresponding to this rotation
This is equal to the angle that should be rotated through to get this Rot3, in radians. Using this function directly is usually more efficient than computing the norm of the tangent vector, both in symbolic and generated code; by default, symbolic APIs will not automatically simplify to this
- to_yaw_pitch_roll(epsilon=0.0)[source]¶
Compute the yaw, pitch, and roll Euler angles in radians of this rotation
Euler angles are subject to gimbal lock: https://en.wikipedia.org/wiki/Gimbal_lock
This means that when the pitch is close to +/- pi/2, the yaw and roll angles are not uniquely defined, so the returned values are not unique in this case.
- classmethod from_yaw_pitch_roll(yaw=0, pitch=0, roll=0)[source]¶
Construct from yaw, pitch, and roll Euler angles in radians
- classmethod from_angle_axis(angle, axis)[source]¶
Construct from an angle in radians and a (normalized) axis as a 3-vector.
- classmethod from_two_unit_vectors(a, b, epsilon=0.0)[source]¶
Return a rotation that transforms a to b. Both inputs are three-vectors that are expected to be normalized.