Skip to content

novaphy.SpatialTransform

Featherstone-style spatial transform X_{A←B}, used to push spatial motion / force vectors between coordinate frames in NovaPhy's articulated- body algorithms (forward_kinematics, forward_dynamics, mass_matrix_crba).

The transform is parameterised by a rotation E (3 × 3 from B → A) and a translation r (origin of B expressed in A). The 6 × 6 spatial matrix is computed implicitly when applying apply_motion / apply_force.

Constructor

SpatialTransform()                # identity
SpatialTransform(E: Mat3, r: Vec3)

Attributes

Attribute Description
E 3 × 3 rotation matrix from frame B to frame A.
r 3-vector — origin of frame B expressed in frame A [m].

Methods

Method Description
apply_motion(v) -> Vec6 Push a 6-D spatial motion (twist) vector from B to A. Layout is [angular(3); linear(3)].
apply_force(f) -> Vec6 Push a 6-D spatial force (wrench) vector from B to A. Layout is [torque(3); force(3)].

Example

import numpy as np
import novaphy

E = np.eye(3, dtype=np.float32)
r = np.array([0.5, 0.0, 0.0], dtype=np.float32)
X_ab = novaphy.SpatialTransform(E, r)

twist_b = np.array([0, 0, 1, 0, 0, 0], dtype=np.float32)   # pure spin
twist_a = X_ab.apply_motion(twist_b)
print(twist_a)

See Also