3

given position and orientation of two coordinate frames, how can transfer a vector from one frame to another.

The position is given in Cartesian space and the orientations in quaternion or Euler angels.

Alejandro
  • 151
  • 2
  • Hi @Azerila, your question is also answered in this thread: https://physics.stackexchange.com/questions/422069/change-of-basis-vs-change-of-coordinate-system. It's a change of basis: https://en.wikipedia.org/wiki/Change_of_basis

    It's

    – bergercookie Jun 02 '20 at 18:16

1 Answers1

3

A homogeneous transform $T$ is 4x4 matrix that looks like:

$$T=\begin{bmatrix} R & t \\ 0_3 & 1 \end{bmatrix}$$

where $R$ is a 3x3 rotation matrix and $t$ is the translation. The rotation matrix can be calculated by converting either the quaternion or the euler angles.

This matrix is used to transform a point from one coordinate system to another. The equation would look like this:

$$p_A=T_{AB}*p_B$$

with $p$ representing a point in the homogeneous form which is just appending a 1 to the end of it.

$$p=\begin{bmatrix} p_x \\ p_y \\ p_z \\ 1 \end{bmatrix}$$

If you don't want to use the homogenous form then the equations just break down to

$$p_A=R_{AB}*p_B+t_{AB}$$.

here $p$ is just a 3x1 vector without the 1.

You can directly use the quaternion if you change the rotation matrix multiplication to quaternion multiplication.

$$p_A=q_{AB}\otimes p_B+t_{AB}$$.

This equation converts a point in the $B$ coordinate system into the $A$ coordinate system.

You have or can easily figure out $T_{AB}$. I don't know how you are storing the vector, but it can always be broken into 2 endpoints. Now just use the equation above to transform both points, and then convert back into your vector format.

edwinem
  • 1,861
  • 9
  • 13