tyrex-team / benchmarks-attitude-smartphones

Benchmark on Attitude Estimation with Smartphones (datasets & scripts)
https://tyrex.inria.fr/mobile/benchmarks-attitude
Other
38 stars 27 forks source link

I feel confused about the Implementation of dcm2quat. #2

Closed Nronaldo closed 3 years ago

Nronaldo commented 3 years ago

Dear Tyrex: Thanks for your excellent job, and I benefited much from your work. But I felt confused about the Implementation of the dcm2quat function.
It seems like that you calculate the respective quaternion of the transpose of the inputting DCM. I compared your code with the link of reference. In your code, you calculate the quaternion like this: image In your reference, the quaternion is calculated like this:

image The sequences of the elements in the calculation are different. Would you please give me some advice? Thank you.

Nronaldo commented 3 years ago

Now I guess the aim of dcm2quat is to calculate the corresponding quaternion of the transpose of the inputting DCM. It may be a little confusing..

ThibaudM commented 3 years ago

Conventions in SO(3) are totally a mess. When I started to work on this project, I used the aerotbx toolbox that provides the dcm2quat function (https://www.mathworks.com/help/aerotbx/ug/dcm2quat.html). When I published the code of this project, I decided to rewrite this function internally for people who do not have aerotbx. Later, I discovered the dcm2quat function provided by robotics toolbox (https://www.mathworks.com/help/robotics/ref/rotm2quat.html), which uses the transpose of the DCM. I should have used this function initially but did not find the time to rewrite the code.