【发布时间】:2021-10-22 03:44:51
【问题描述】:
到目前为止,我已将运动传感器融合如下:
// Get Static Orientation (Accelerometer + Magnetometer)
SensorManager.getOrientation(staticRotationMatrix, staticOrientation)
// Get Dynamic Orientation (Gyroscope)
SensorManager.getOrientation(dynamicRotationMatrix, dynamicOrientation)
// Fuse Orientations (Complementary Filter)
fusedOrientation[0] = coefficient * dynamicOrientation[0] + (1.0F - coefficient) * staticOrientation[0]
fusedOrientation[1] = coefficient * dynamicOrientation[1] + (1.0F - coefficient) * staticOrientation[1]
fusedOrientation[2] = coefficient * dynamicOrientation[2] + (1.0F - coefficient) * staticOrientation[2]
// Remove Gyroscope Drift
dynamicRotationMatrix = getRotationMatrixFromOrientation(fusedOrientation)
但正如您所见,我将矩阵转换为方向,然后将其转换回矩阵。
我想通过将互补滤波器直接应用于矩阵来提高性能(不将矩阵转换为方向)。有可能吗?
矩阵的大小为 9 (3x3)。
换句话说,我该怎么做?
MatrixC = 0.98 * MatrixA + 0.02 * MatrixB
【问题讨论】:
标签: java android kotlin matrix sensors