Compute rotation matrix using the magnetic field

前端 未结 2 623
隐瞒了意图╮
隐瞒了意图╮ 2021-02-04 22:17

In get rotation matrix value it contains public static boolean getRotationMatrix (float[] R, float[] I, float[] gravity, float[] geomagnetic) Here how can i calcula

2条回答
  •  有刺的猬
    2021-02-04 23:05

    I know that this is an old thread but in case it helps, for Android I think the 3x3 rotation matrix is actually given by a variation of the approved answer. To be specific, in Android the rotation matrix is

         (cosφ cosψ - sinφ sinψ sinθ)     sinφ cosθ     ( cosφ sinψ + sinφ cosψ sinθ)
        -(sinφ cosψ + cosφ sinψ sinθ)     cosφ cosθ     (-sinφ sinψ + cosφ cosψ sinθ)
                  -sinψ cosθ                 -sinθ                  cosφ cosθ
    

    where

        φ = azimuth
        θ = pitch
        ψ = roll
    

    which corresponds to the 3x3 Android rotation matrix R[0] to R[8] (matrixR in the question) via

        R[0] R[1] R[2]
        R[3] R[4] R[5]
        R[6] R[7] R[8]
    

提交回复
热议问题