Accelerometer gravity components

后端 未结 5 1304
迷失自我
迷失自我 2020-12-15 13:10

I know this question is definitely solved somewhere many times already, please enlighten me if you know of their existence, thanks.

Quick rundown: I want to compute

5条回答
  •  佛祖请我去吃肉
    2020-12-15 13:42

    Thanks Janus! Your explanation kinda enlightened me regarding the rotation matrix. And the final line did solve my problem!

    Now I just need to rework my free body diagrams to find out what I've did wrong... I already found that I should not have had a X-Y component of gravity, since gravity is orthonormal to the X-Y axis...

    THanks again!

    Edit: follow up on this, the last line: {g Sin[pitchangle],-g Cos[pitchangle] Sin[rollangle],-g Cos[pitchangle] Cos[rollangle]}

    I've found instead of -g Cos[pitchangle] Sin[rollangle] Sin[roll] from my free body diagram more closely resembles the actual acceleration.

    What I can't understand now is the last component -g Cos[pitchangle] Cos[rollangle] now it is perfect for small pitch and roll angles, and it works fine for either a pitch or roll angle while the other stays at 0, but a deviation becomes significant when both pitch and roll are no longer a small angle (say 40 degrees). Actually I also realised to achieve a 45 roll and 45 pitch on the nexus one, the phone would have a 0 Z axis reading, with X and Y both on 6.8ish acceleration. While the resulting formula from the rotation matrix multiplication at 45 roll and 45 pitch would be 0.5 gravity.

    Is there something wrong with the orientation sensor output? or is this how pitch and roll are supposed to work?

    Does anyone know how to account for this?

    Thanks!

提交回复
热议问题