udaan.manif.SO3 module¶
- class udaan.manif.SO3.SO3[source]¶
Bases:
objectRotation matrix on the Special Orthogonal group SO(3).
- Wraps a 3x3 rotation matrix. Supports:
R1 @ R2 -> SO3 (group composition, if both SO3) R @ v -> ndarray (rotate a vector) R1 - R2 -> TSO3 (configuration error in the Lie algebra) R + w -> SO3 (exponential map step, w is a TSO3) R.T -> SO3 (transpose, preserves type)
- config_error(other)[source]¶
Scalar configuration error: 0.5 * tr(I - other^T @ self).
Returns 0 when self == other, approaches 2 for 180-degree error.
- Return type:
- static from_angle_axis(eta)[source]¶
Construct SO3 from an angle-axis vector via the exponential map.
- static from_two_vectors(b3, b1)[source]¶
Construct SO3 from a primary axis (b3) and a heading hint (b1).
Builds an orthonormal frame [b1’, b2, b3] where b3 is preserved exactly, b1’ is the closest vector to b1 orthogonal to b3, and b2 = b3 x b1’. Handles the singularity when b3 is parallel to b1.
This is the standard construction for desired attitude from thrust direction (b3) and heading direction (b1).
- Return type:
- class udaan.manif.SO3.TSO3[source]¶
Bases:
objectElement of the Lie algebra so(3) — tangent vector to SO(3).
Wraps a 3-vector representing angular velocity or rotation error. Supports:
w1 - w2 -> TSO3 (tangent vector difference) w1 + w2 -> TSO3 (tangent vector sum) w * s -> TSO3 (scalar multiplication) w.hat() -> 3x3 (skew-symmetric matrix in so(3)) w.transport(R_from, R_to) -> TSO3 (frame transport)