warp.spatial_adjoint#
- warp.spatial_adjoint( ) Matrix[Float, Literal[6], Literal[6]]#
Construct a 6x6 spatial matrix from the two 3x3 blocks
rands.For a rigid transform
(R, p), settingr = Rands = skew(p) * Rconstructs the matrix that maps twist(w, v)to(R * w, cross(p, R * w) + R * v). Wrenches transform differently from twists; usetransform_wrench()to transform them.- Parameters:
r – Block placed on both diagonals.
s – Block placed in the lower-left corner.
- Returns:
The 6x6 block matrix
[[r, 0], [s, r]].
Example
@wp.kernel def build(out: wp.array[wp.spatial_matrix]): r = wp.mat33(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) s = wp.mat33(0.0, -3.0, 2.0, 3.0, 0.0, -1.0, -2.0, 1.0, 0.0) out[0] = wp.spatial_adjoint(r, s) out = wp.empty(1, dtype=wp.spatial_matrix) wp.launch(build, dim=1, outputs=[out]) print(out.numpy()[0])
[[ 1. 0. 0. 0. 0. 0.] [ 0. 1. 0. 0. 0. 0.] [ 0. 0. 1. 0. 0. 0.] [ 0. -3. 2. 1. 0. 0.] [ 3. 0. -1. 0. 1. 0.] [-2. 1. 0. 0. 0. 1.]]