2 from numpy
import cos, sin, sqrt
4 from .dynamic
import DynamicPinocchio
19 [cy * cp, cy * sp * sr - sy * cr, cy * sp * cr + sy * sr],
20 [sy * cp, sy * sp * sr + cy * cr, sy * sp * cr - cy * sr],
21 [-sp, cp * sr, cp * cr],
28 rr = 1.0 + d0 + d1 + d2
32 _x = (rotmat[2, 1] - rotmat[1, 2]) * s
33 _y = (rotmat[0, 2] - rotmat[2, 0]) * s
34 _z = (rotmat[1, 0] - rotmat[0, 1]) * s
39 if (d0 > d1)
and (d0 > d2):
40 s = 0.5 / sqrt(1 + d0 - d1 - d2)
42 _y = (rotmat[0, 1] + rotmat[1, 0]) * s
43 _z = (rotmat[0, 2] + rotmat[2, 0]) * s
44 _r = (rotmat[1, 2] + rotmat[2, 1]) * s
46 s = 0.5 / sqrt(1 + d0 - d1 - d2)
47 _x = (rotmat[0, 1] + rotmat[1, 0]) * s
49 _z = (rotmat[1, 2] + rotmat[2, 1]) * s
50 _r = (rotmat[0, 2] + rotmat[2, 0]) * s
52 s = 0.5 / sqrt(1 + d0 - d1 - d2)
53 _x = (rotmat[0, 2] + rotmat[2, 0]) * s
54 _y = (rotmat[1, 2] + rotmat[2, 1]) * s
56 _r = (rotmat[0, 1] + rotmat[1, 0]) * s
58 return np.matrix([q_sot[0:3] + (_x, _y, _z, _r) + q_sot[6:]])
60 return np.matrix([q_sot[0:]])