Understanding Quaternion to DCM Conversion in Openshoe Matlab Library

  • Thread starter Thread starter namster
  • Start date Start date
  • Tags Tags
    Quaternion
Click For Summary
SUMMARY

The discussion focuses on the conversion from quaternion to Direction Cosine Matrix (DCM) using the OpenShoe Matlab library. The specific function discussed is q2dcm(q), which implements the conversion algorithm. Users expressed confusion regarding the matrix representation used in OpenShoe compared to other sources, but confirmed that the results are consistent. The Matlab implementation is accessible via the OpenShoe website, providing a practical resource for users seeking to understand quaternion transformations.

PREREQUISITES
  • Understanding of quaternion mathematics
  • Familiarity with Matlab programming
  • Knowledge of matrix operations and transformations
  • Basic concepts of rotation representation in 3D space
NEXT STEPS
  • Study the OpenShoe Matlab library documentation for additional functions
  • Learn about quaternion mathematics and its applications in 3D graphics
  • Explore alternative quaternion to DCM conversion methods
  • Investigate the implications of using different matrix representations in 3D transformations
USEFUL FOR

This discussion is beneficial for students, researchers, and developers working with 3D transformations, particularly those utilizing the OpenShoe Matlab library for motion analysis and sensor data processing.

namster
Messages
2
Reaction score
0
Summary:: Conversion from quaternion to DCM

Hi All ,
our teacher asked us to try to understand the openshoe Matlab library , i stagnate on function that convert the quaternion to DCM i have found many example on website but the description of matrix are diffrente that the one is used on openshoe but it give the same result , so i wan't to know which of this matrix is correcte ?
Q2DCM2.PNG

Q2DCM1.PNG
 

Attachments

  • 1611017261433.png
    1611017261433.png
    307 bytes · Views: 177
Physics news on Phys.org
jedishrfu said:
Are you using this library?

https://sourceforge.net/p/openshoe/home/Home/

or some other one?
yes that's it , i use the Matlab implementation http://www.openshoe.org/?page_id=362

Matlab:
function R=q2dcm(q)

p=zeros(6,1);

p(1:4)=q.^2;

p(5)=p(2)+p(3);

if p(1)+p(4)+p(5)~=0
   p(6)=2/(p(1)+p(4)+p(5));
else
   p(6)=0;
end
%[ 1-p(6)*p(5) p(6)-p(5)           p(6)+p(5)
%  p(6)+p(5)   1-p(6)*(p(1)+p(3))  p(6)-p(5)
%  p(6)-p(5)   p(6)+p(5)           1-p(6)*(p(1)+p(2)) ]

R(1,1)=1-p(6)*p(5);
R(2,2)=1-p(6)*(p(1)+p(3));
R(3,3)=1-p(6)*(p(1)+p(2));

p(1)=p(6)*q(1);
p(2)=p(6)*q(2);
p(5)=p(6)*q(3)*q(4);
p(6)=p(1)*q(2);

R(1,2)=p(6)-p(5);
R(2,1)=p(6)+p(5);
p(5)=p(2)*q(4);
p(6)=p(1)*q(3);

R(1,3)=p(6)+p(5);
R(3,1)=p(6)-p(5);

p(5)=p(1)*q(4);
p(6)=p(2)*q(3);

R(2,3)=p(6)-p(5);
R(3,2)=p(6)+p(5);

end
 
Last edited by a moderator:

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
10K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
12
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K