我测了一下代码,不错,用的是ADXL345,L3G4200D。
仔细阅读了那篇A Guide To using IMU (Accelerometer and Gyroscope Devices) in Embedded Applications.
对那篇算法的过程倒是能够弄清楚,但是为什么那样做就不清楚。
代码中- line(0, 0, 0, 1, 0, 0);
- line(0, 0, 0, 0, -1, 0);
- line(0, 0, 0, 0, 0, 1);
- line(0, 0, 0, -RwEst[0], RwEst[1], RwEst[2]);
复制代码 为什么RwEst[0] 前面需要加负号, 我感觉是具体的方向变换这块没能够理解。
包括- rotateX(HALF_PI * -RwEst[0]);
- rotateZ(HALF_PI * RwEst[1]);
复制代码 这块的代码,也是这样。谁能够具体讲讲坐标系以及方向具体怎么看 |