Python API¶
- class spatial_casadi.Rotation(quat, normalize=True, scalar_first=False)¶
3D rotations. NumPy batches use rows; CasADi batches use columns.
- classmethod from_quat(quat, seq=None, *, scalar_first=False)¶
Construct from nonzero quaternions; normalize each quaternion.
- classmethod from_matrix(matrix)¶
Construct from proper rotation matrices (no orthogonal projection).
- classmethod from_rotvec(rotvec, degrees=False)¶
Construct from axis-angle vectors, including zero.
- classmethod from_mrp(mrp)¶
Construct from modified Rodrigues parameters.
- classmethod from_euler(seq, angles, degrees=False)¶
Construct from intrinsic XYZ or extrinsic xyz sequences.
- as_quat(seq=None, *, canonical=False, scalar_first=False)¶
Return quaternion columns; the default order is xyzw.
- as_matrix()¶
Return a 3 x (3*N) matrix of horizontal rotation blocks.
- as_rotvec(degrees=False)¶
Return principal rotation vectors as 3 x N columns.
- as_mrp()¶
Return modified Rodrigues parameters as 3 x N columns.
- as_euler(seq, degrees=False, *, suppress_warnings=False)¶
Return three Euler angles per column; third angle is zero at gimbal lock.
- __mul__(other)¶
- inv()¶
Return the inverse rotation.
- __pow__(n, modulus=None)¶
- apply(vectors, inverse=False)¶
Rotate vectors, broadcasting singleton batches.
- magnitude()¶
Return principal angles in radians as a 1 x N row.
- approx_equal(other, atol=1e-08, degrees=False)¶
Return CasADi comparisons of relative rotation angles.
- rotation_angle(other)¶
- classmethod identity(num=None)¶
- classmethod random(num=None, rng=None, *, random_state=None)¶
Sample uniform rotations using a NumPy generator or seed.
- classmethod symbolic(name='quat', kind='SX')¶
Create a raw unit-quaternion variable; constrain its norm to one.
- classmethod concatenate(rotations)¶
- __getitem__(index)¶
- property single¶
- property x¶
- property y¶
- property z¶
- property w¶
- class spatial_casadi.RigidTransform(matrix)¶
A rotation followed by a translation; use the from_* constructors.
- classmethod from_matrix(matrix)¶
Construct from proper homogeneous matrices.
- classmethod from_components(translation, rotation)¶
Construct from translation and Rotation, in that order.
- classmethod from_rotation(rotation)¶
- classmethod from_translation(translation)¶
- classmethod from_exp_coords(exp_coords)¶
Construct from columns [rotation vector; translational velocity].
- classmethod from_dual_quat(dual_quat, *, scalar_first=False)¶
Construct from real and dual quaternion pairs; normalize the pair.
- classmethod identity(num=None)¶
- classmethod concatenate(transforms)¶
- property rotation¶
- property translation¶
- property single¶
- as_components()¶
- as_matrix()¶
Return a 4 x (4*N) matrix of horizontal transform blocks.
- as_exp_coords()¶
Return principal exponential coordinates as 6 x N columns.
- as_dual_quat(*, scalar_first=False)¶
- __mul__(other)¶
- inv()¶
- __pow__(n, modulus=None)¶
- apply(vector, inverse=False)¶
- __getitem__(index)¶
- class spatial_casadi.Slerp(times, rotations)¶
Shortest-path interpolation at fixed, strictly increasing knot times.
- __call__(times)¶
Call self as a function.
Compatibility¶
- class spatial_casadi.Translation(t)¶
A translation vector, retained for the original API.
- as_vector()¶
- magnitude()¶
- classmethod identity()¶
- classmethod random(rng=None)¶
- classmethod symbolic(name='t', kind='SX')¶
- classmethod from_vector(t)¶
- classmethod from_matrix(matrix)¶
- as_transformation()¶
- as_matrix()¶
- property x¶
- property y¶
- property z¶