Skip to content

novaphy.SpatialTransform

Featherstone-style spatial transform X_{A←B}, used to map spatial motion vectors and their dual force vectors between coordinate frames in NovaPhy's articulated- body kernels (SolverFeatherstone, eval_fk, eval_jacobian, eval_mass_matrix).

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 [linear(3); angular(3)].
apply_force(f) -> Vec6 Apply the dual map to a 6-D wrench from A-space to B-space. Layout is [force(3); torque(3)]. This opposite direction preserves the motion-force power pairing.
to_matrix() -> Mat6 Return the 6 × 6 motion-transform matrix.
inverse() -> SpatialTransform Return X_{B←A}.
__mul__(other) Compose two spatial transforms.
from_transform(t) Static factory converting a rigid Transform.
identity() Static identity factory.

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, 0, 0, 0, 1], dtype=np.float32)   # pure spin
twist_a = X_ab.apply_motion(twist_b)
print(twist_a)

See Also