【问题标题】:Apply a complementary filter directly to matrices将互补滤波器直接应用于矩阵
【发布时间】: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


    【解决方案1】:

    我解决了这个问题:

    1. 将矩阵的每个条目与标量相乘。

    2. 根据它们的入口坐标将矩阵的每个入口相加。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-17
      • 1970-01-01
      相关资源
      最近更新 更多