xxxxxxxxxx
from scipy.spatial.transform import Rotation as R
r = R.from_quat([0, 0, np.sin(np.pi/4), np.cos(np.pi/4)])
print(r.as_matrix())
xxxxxxxxxx
from scipy.spatial.transform import Rotation as R
r = R.from_quat([x, y, z, w])
print(r.as_matrix())