簡體   English   中英

加速度計和磁力計的俯仰,橫滾和偏航

[英]Pitch, roll and yaw from accelerometer and magnetometer

我想根據旋轉向量做一些工作。 問題在於大多數Android設備都沒有陀螺儀傳感器(也沒有旋轉矢量傳感器)。 我認為有一種方法可以通過使用加速度計(用於俯仰和橫滾)和磁力計(用於偏航)來計算四元數的近似值。 問題在於它們的值不受最大值限制(對於俯仰和橫滾,我可以使用G = 9.81並嘗試過濾其他加速度)。

有人可以幫我找到一個近似的解決方案嗎?

float[] rotationMatrix = new float[16];
float[] rotationMatrixRemapped = new float[16];
float[] accMagOrientation = new float[3];

SensorManager.getRotationMatrix(rotationMatrix, null, oldAccelerometerVals, oldMagnetometerVals);
SensorManager.remapCoordinateSystem(rotationMatrix, SensorManager.AXIS_MINUS_Y, SensorManager.AXIS_MINUS_X, rotationMatrixRemapped);
SensorManager.getOrientation(rotationMatrix, accMagOrientation);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM