我在 MATLAB 中有一个旋转矩阵
PC=[0.4822 0.5070 0.7145
-0.4086 0.8516 -0.3285
0.7750 0.1336 -0.6177];
quat=rotm2quat(PC); %gives me
[0.3937, 0.8641, 0.0319, 0.3119] %which is [w,x,y,z]
python中的相同矩阵
from scipy.spatial.transform import Rotation as R
rot=[[0.4822 , 0.5070 , 0.7145],[-0.4086 , 0.8516 , -0.3285],[ 0.7750 , 0.1336 , -0.6177]]
r=R.from_dcm(rot)
print(r.as_quat()) # gives me following
[ 0.04920064 0.99356301 -0.09745128 -0.0302504 ] # which is [x,y,z,w]
为什么四元数值[x,y,z,w]在 MATLAB 和 python 之间不匹配。