# Confusion about order of homogeneous transform multiplication

This is my first post here, so if I unknowingly vioated any rules, mods are welcome to edit my post accordingly.
Ok, so my problem is that following Craig's conventions, I can't seem to find the expected homogeneous transform after a series of transformations.
I have included the image for clarity.

We are given the initial frame {0} as usual and then:
-$\{A\}$ is the frame under rotating {0} $90^\circ$ around $z$ and translating, with $OA = \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}$
-$\{B\}$ is obtained after translating $A$ by $AB = \begin{bmatrix} -2 \\ -2 \\ 0 \end{bmatrix}$
What I found is:
$${}_A^OT = \left[ {\begin{array}{*{20}{c}} 0&-1&0&1\\ 1&0&0&1\\ 0&0&1&{1}\\ 0&0&0&1 \end{array}} \right], \;\;{}_B^AT=\left[ {\begin{array}{*{20}{c}} 1&0&0&-2\\ 0&1&0&-2\\ 0&0&1&{0}\\ 0&0&0&1 \end{array}} \right],\\ {}_B^OT = {}_A^OT {}_B^AT=\left[ {\begin{array}{*{20}{c}} 0&-1&0&3\\ 1&0&0&-1\\ 0&0&1&{1}\\ 0&0&0&1 \end{array}} \right]$$ This is wrong, since the last column should obviously have the coordinates $-1,-1,1$, the origin of B
What am I missing?

The mistake is in the second matrix $T_B$ in the last column
this column means that you want to transfer the Frame by -2 in it's X direction and by -2 in it's Y direction which in your case is like this:
The X vector of the second Frame (A-Frame) is the Y Vector of the world Frame (O-Frame)
The Y vector of the second Frame (A-Frame) is the opposite of X Vector of the world Frame (O-Frame)
so if you want to transfer the new Frame by (-2, -2, 0) according to the world Frame you need to transfer it by (-2, 2, 0) according to the new Frame.. so the last column in the second matrix needs to be (-2, 2, 0, 1)
in this case the last column of the total matrix will be as you expected (-1, -1, 1, 1)

in general you need to write the transferring vector always in the last frame coordinates, so you need to apply all the previous transformations on it before you use it in the new transfer matrix
you need to multiply the (-2, -2, 0) vector by the inverse of first rotating matrix $T_A$ which is ($T_A^T$) and you will get the new transferring vector (-2, 2, 0)

• Yes, that's it! The thing is, I considered the translation vector AB, but this was essentialy referenced to {0}. Instead the general formula that can be applied, is off course, (A)Borg=T(AO)*((O)Borg) – alet May 25 '17 at 11:25

It is the order of multiplication.

Suppose you have a frame $A$ and you want to apply the transformation $T_B$ to $A$:

• If $T_B$ is described in the global frame, you pre-multiply $T_A$ with $T_B$. This is your desired solution: you want to translate $A$ by $(-2, -2, 0)$, i.e., $-2$ in the world's $x$-direction and $-2$ in the world's $y$-direction.
• If $T_B$ is described in the $A$ frame, you post-multiply $T_A$ with $T_B$. This is what you did.

In order to find the correct translation you need to rotate the origin of frame B by $^{A}_{B}{R}$ and then add the origin of frame A. Check eq. 2.41 page 35 of Craig's Introduction to Robotics

• It would be great if you could duplicate that equation here, for those that don't have access to the book. – Shahbaz May 24 '17 at 22:43