Skip to main content

Module spatial

Module spatial 

Source
Expand description

Spatial math: rotations, Lie groups, and spatial-algebra types.

  • Quaternion — unit-quaternion rotations.
  • SO2 / SO3 / SE2 / SE3 — 2D/3D rotation and rigid-transform Lie groups.
  • Twist / Wrench — spatial velocity and force in [v; ω] / [force; torque] ordering.
  • SpatialInertia — a body’s mass, centre of mass, and rotational inertia.
  • FreeJointState — the pose and velocity of a body free to move in all six directions.

Structs§

FreeJointState
Where a freely moving body is and how it is moving.
Quaternion
A quaternion w + x·i + y·j + z·k, stored scalar-first.
SE2
A 2D rigid-body transform: a rotation and a translation. The tangent is [vx, vy, ω].
SE3
A 3D rigid-body transform: a rotation and a translation. The tangent is [vx, vy, vz, ωx, ωy, ωz].
SO2
A 2D rotation, stored as a unit complex number (cosθ, sinθ). Composition is a complex product, so it takes no trigonometry. The group is abelian; exp/log are exact and need no fallback.
SO3
A 3D rotation. Wraps a unit Quaternion and carries the unit-rotation invariant. Composition uses the Hamilton product; call SO3::normalized to remove drift after long chains. The tangent is a rotation vector φ = θ·n̂ in radians, and the retract is R · exp(φ).
SpatialInertia
How a rigid body’s mass is spread out: how much there is, where it balances, and how hard it is to spin.
Twist
A spatial velocity (twist), stored linear-first in the crate-wide [v; ω] ordering.
Wrench
A spatial force (wrench), stored force-first in the [force; torque] ordering — reciprocal to a Twist, so the two line up component-for-component.