# orientation transformation

I have a 6-dimensional vector(x,y,z,roll,pitch,yaw) in frame 1, I want to convert it to frame 2 in order to represent the value in frame 2. I know that p2=R12*p1 where p1 is the (xyz) in frame 1. The question is how I convert the roll, pitch yaw to the other frame?

Your 6d vector can also be considered a frame. Lets call it the frame of the object. Convert your 6d vector to something easier to work with like Homogeneous Transforms. Another alternative is Quaternion + Translation, but homogeneous matrices are easier.

Homogeneous Transform:

A 4x4 matrix that looks like:

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

Here $$R$$ is a 3x3 rotation matrix. $$t$$ is your translation vector (x,y,z). $$0_3$$ is just a row vector of all 0s.

To get the rotation matrix you have to convert your euler angles to the rotation matrix form. You can google that or check out the equation on the wikipedia page.

Your frames 1,2 should also be stored in the homogeneous matrix form. We now can just multiply the various transforms together to get the end result. If you get confused it sometimes helps to draw it out. By convention $$T_{a,b}$$ means the Transform of frame $$b$$ in frame $$a$$.

I have labeled the pieces of information we have. For instance we have the Transform of the object in frame 1( $$T_{1,o}$$ ). We want to find the question mark $$?$$. To do that just trace the path of the arrows. If 2 separate paths start on the same frame and end on the same frame then it means they are equivalent. So for this example the $$?$$ transform will be the same as the path using $$T_{1,2}$$ and $$T_{1,o}$$. If we ever end up going against the arrow direction then it means we need to inverse that Transform.

All that being said your final equation is:

$$? = T_{2,o} = T_{1,2}^{-1}*T_{1,o}$$

If you want your 6d vector form again then I would just convert the rotation matrix back to euler angles.