sym.rot3 module#
- class Rot3(q=None)[source]#
Bases:
object
Autogenerated Python implementation of
symforce.geo.rot3.Rot3
.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.Union[T.Sequence[float], numpy.ndarray, None]) –
- compose_with_point(right)[source]#
Left-multiplication. Either rotation concatenation or point transform.
- to_tangent_norm(epsilon)[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
- static random_from_uniform_samples(u1, u2, u3)[source]#
Generate a random element of SO3 from three variables uniformly sampled in [0, 1].
- to_yaw_pitch_roll()[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.
- Returns:
Scalar – Yaw angle [radians]
Scalar – Pitch angle [radians]
Scalar – Roll angle [radians]
- Return type:
- static from_yaw_pitch_roll(yaw, pitch, roll)[source]#
Construct from yaw, pitch, and roll Euler angles in radians
- static from_angle_axis(angle, axis)[source]#
Construct from an angle in radians and a (normalized) axis as a 3-vector.
- static from_two_unit_vectors(a, b, epsilon)[source]#
Return a rotation that transforms a to b. Both inputs are three-vectors that are expected to be normalized.