mbrossar / ai-imu-dr

AI-IMU Dead-Reckoning
MIT License
788 stars 222 forks source link

renormalization of the rotation matrices #47

Closed shaibagon closed 4 years ago

shaibagon commented 4 years ago

Thank you very much for enlighting work and published code.

In many other works on orientation estimation I noticed there is an additional "re-normalization" step of the rotation matrix, making sure it is unitary and the norm of the columns are all one.

I havn't noticed any such stage in the proposed algorithm.

How can the code guarantee that the estimated rotation matrix, e.g, R_IMU, is indeed a "proper rotation" matrix?

I looked at the resulting "z direction" (last column of the matrix) and noticed that its norm significantly deviates from one.

How can I rectify this?

Thanks, -Shai

mbrossar commented 4 years ago

Hello Shai,

The norm of a rotation matrix should be one, but due numerical approximations, it can deviate from one. To rectify it, you can normalize the rotation matrix.

This is done in the filter here after each "n_normalize_rot" steps.

The function for normalizing rotation matrices is available here for numpy and here for pyTorch.

Martin

shaibagon commented 4 years ago

@mbrossar Thank you very much for the detailed and prompt response! Your code is really in very high standard and it is enriching and enlightening to go through it.