使用四元数消除向量 [英] De-Rotating vectors using Quaternions
问题描述
我在x,y,z方向(传感器主体框架)上具有一组加速度值.在操作过程中,传感器多次倾斜和改变方向.使用陀螺仪,磁力计和加速度计,我能够以四元数格式融合并提取侧倾角,俯仰角和偏航角(校准为Q).
I have a set of acceleration values along the x, y, z directions (sensor body frame). The sensor tilted and changed orientation many times during operation. Using the gyroscope, magnetometer and accelerometer, I was able to fuse and extract the Roll, Pitch and Yaw angles all in quaternion format ( cal it Q).
现在,将加速度值旋转到全局X,Y,Z位置.我只是简单地1.通过将标量部分设置为0(称为Acc)将加速度值转换为四元数2.将加速四元数乘以以下公式:Qtranspose * Acc * Q ??
Now, to derotate the acceleration values into global X, Y, Z positions. Do I just simply 1. convert the acceleration values into quaternion by setting the scalar part to 0 (call it Acc) 2. Multiply the acceleration quaternion as follows : Qtranspose * Acc * Q??
还是我的结论不对?我们如何旋转值?
Or is my conclusion wrong? how do we derotate the values?
谢谢
推荐答案
如果您已经具有正确的四元数方向 q ,那么加速度的未旋转"矢量就是您所说的:>
If you already have an accurate quaternion orientation q, then the 'unrotated' vector of the accelerations is as you said:
Ag = q* A q
或
Ag = q A q*
取决于四元数乘法所使用的约定.(只需尝试两者,看看哪一个能给您正确的重力矢量).
depending on which convention you are using for quaternion multiplication. (just try both and see which one give you the right gravity vector).
请注意,A和Ag是纯四元数"-这是一个四元数,其标量分量为0,轴分量为加速度矢量.换句话说,如果您的四元数为q = [w x y z],则A = [0 ax ay az].然后,您可以舍弃Ag的标量分量,以获得未旋转的矢量.确保加速度矢量的顺序与四元数矢量的顺序一致.
NOTE that A and Ag are 'pure quaternions' - this is a quaternion with the scalar component as 0, and the axis component as your acceleration vector. In other words if your quaternion is q = [w x y z], then A = [0 ax ay az]. You can then discard the scalar component of Ag to get the unrotated vector. Make sure the order of the acceleration vector is consistent with your quaternion vector order.
这篇关于使用四元数消除向量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!