2

What I am trying to achieve here is to convert the rotation Matrix from one software (Quest3D) to an another one (Rock robotic framework) of course with different reference system.

I have the Motion matrix (the 4x4 matrix which contains the 3x3 rotation matrix and the translation vector) in a Left-Handed (LH for the following) system as follow :

X positive forward
y positive up
z positive left

And I would like to put it in an Right-Handed (RH for the following) system as follow : (edit)

North West Up (NWU): 
X positive forward
y positive **left**
z positive up

This is what I tried to find so far and I will be glad if someone could help me there or point me to some documentations that I could have missed !

  1. First step: the order of rotations

So first of all, to find the theoretical rotation matrix of Quest3D I needed to know what was the order of multiplication that creates the rotation matrix with an euler angle notation.

With the following reference system

I have :

Rx_LH(tet1) =
[ 1,         0,      0    ]
[ 0, cos(tet1), -sin(tet1)]
[ 0, sin(tet1),  cos(tet1)]

Ry_LH(tet2) =
[  cos(tet2), 0, sin(tet2)]
[          0, 1,      0   ]
[ -sin(tet2), 0, cos(tet2)]

Rz_LH(tet3) =
[ cos(tet3), -sin(tet3), 0]
[ sin(tet3),  cos(tet3), 0]
[         0,     0,      1]  

Then since there is 12 different way of computing the rotation matrix, I wrote a small matlab program that computes all the different options and then with a set of specified values for X,Y,Z in Quest3D (See image here) and the corresponding matrix in numerical values I tried to match which one of the rotation matrix is the same and therefore I will have my rotation order.

Result : not so much.. I manage to have a matrix that posses the same element but not at the right position in the matrix. ( there is actually a symmetry regarding the diagonal)

This is my "target matrix"

MatR_Sim_LH =

    0.9447    0.3130   -0.0978
   -0.0290    0.9363    0.1987
    0.1538   -0.1593    0.9752

and this is the closest thing I have

    0.9447   -0.2896    0.1538
    0.3130    0.9363   -0.1593
   -0.0978    0.1987    0.9752

Let's say it's a mistake of mine, the order to create the rotation matrix is 213.

  1. Change of basis

For the change of basis I have to go from the Quest3D reference system to a ** Right-Handed with X positive forward, y positive right and z positive Up **.

My idea was the following.

a) change from Left-Handed to Right-Handed b) Do what's necessary to the motion matrix when we swap the Y and Z axis in the reference frame.

for a) I am using this matrix

Switch_LH2RH =

     1     0     0
     0     1     0
     0     0    -1

which I apply to my LH (Left-Handed) rotation matrix of Quest3D like this

MatR_Sim_RH     = Switch_LH2RH * MatR_Sim_LH * Switch_LH2RH; 

then for b) to switch Y and Z I am using the following matrix in the following expression

Mat_toggle_ZY =

     1     0     0
     0     0     1
     0     1     0

MatR_Rock_RH    =  Mat_toggle_ZY * MatR_Sim_RH * Mat_toggle_ZY; 

But of course it's not working for some reason that probably are not obvious for me yet !

Thanks for the help

V.v

ViVittori
  • 103
  • 1
  • 6
  • It seems to me like your "Right-handed" basis vectors you describe are still left-handed. Am I wrong? You would either need to change +y axis to be to the left, or change +z axis to be down. – Nathan Jan 16 '14 at 16:38
  • Also, you won't be able to transform a LH matrix to RH by rotations. One of the axes must be inverted. – Nathan Jan 16 '14 at 16:39
  • Ok i made a typo here, the RH reference system I want to go is called NWU (North West Up). Regarding the transform, can you light me up on how to proceed then if not by rotations. – ViVittori Jan 17 '14 at 08:26
  • After working it out explicitly, I get the same thing you have: [1 0 0;0 1 0;0 0 -1] for the transformation matrix. So I'm not entirely sure what the problem is. – Nathan Jan 17 '14 at 16:01
  • Swapping the basis vectors for two axes should also do the trick. Use [0 1 0] for x-axis, and [1 0 0] for the y. In exactly what way is that transformation matrix you're using not working? What is wrong with the result? – Nathan Jan 17 '14 at 16:10
  • Essentially, what you need to do is to swap the last two rows. This can be done by multiplying with [[1,0,0],[0,0,1],[0,1,0]] from the left of the matrix. – Lutz Lehmann Mar 07 '14 at 19:57
  • look here http://stackoverflow.com/a/25216549/2521214 just extract vectors, reorder negate what you need and construct back also check first if you do not use transposed matrix to that image – Spektre Sep 10 '14 at 10:49

0 Answers0