Transformations between two coordinate systems on a rigid body

1.3k Views Asked by At

I have two coordinate frames, A and B, which are rigidly attached to each other on a body. This body then translates and rotates, such that A starts at A1, and moves to A2, and B starts at B1, and moves to B2. This is shown in the diagram below.

enter image description here

By inspection of the grid, I have calculated the transformation matrix (in 3D homogeneous coordinates) from A1 to B1 to be as follows:

$$ T_{A_1B_1} = \left [\begin{array}{ccc} 0 & 1 & 0 & -2 \\ 1 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{array} \right ]$$

Then after the movement, again by inspection of the grid, I have calculated the transformation matrix (in 3D homogeneous coordinates) from A2 to B2 to be as follows:

$$ T_{A_2B_2} = \left [\begin{array}{ccc} 0 & 1 & 0 & 1 \\ 1 & 0 & 0 & 2 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{array} \right ]$$

Why are these matrices not the same? Have I calculated them incorrectly? Or is my diagram inconsistent somehow?

Thank you.

1

There are 1 best solutions below

0
On

Well, if I had to transform $A1$ to $A2$ by a rotation and then a translation I would do it with homogeneous coordinates and in 4 steps (4 matrices).

  • 1) $T_1$: translate $A1$ to the origin (down 4 and left 1)
  • 2) $T_2$: do the rotation (90 degrees clockwise)
  • 3) $T_3$: translate back (up 4 and right 1)
  • 4) $T_4$: translate right 3 and down 1.

    $$T=T_4T_3T_2T_1= \begin{bmatrix} 1&0&3\\ 0&1&-1\\ 0&0&1\\ \end{bmatrix} \begin{bmatrix} 1&0&1\\ 0&1&4\\ 0&0&1\\ \end{bmatrix} \begin{bmatrix} 0&1&0\\ -1&0&0\\ 0&0&1\\ \end{bmatrix} \begin{bmatrix} 1&0&-1\\ 0&1&-4\\ 0&0&1\\ \end{bmatrix}$$

Which gives the full transformation from $A1$ to $A2$

$$ T=\begin{bmatrix} 0&1&0\\ -1&0&4\\ 0&0&1\\ \end{bmatrix}$$

The reason this does not work on $B1$ is because of the rotation. $B1$ is not centered about the origin when $A1$ is. You need to make sure the rotation (or reflection) works for both $A1$ and $B1$ at the same time.