# How to compute a path from a Frame A to a Frame B

the problem I have is the following (see picture below), I am able to compute a starting frame $F_S (X_S, Y_S, Z_S)$, an ending frame $F_E (X_E, Y_E, Z_E)$ and a path from $F_S$ to $F_T$ and what I want to do it to compute a serie of transformations that will transform $F_S$ into $F_E$ along the path.

Naively I computed the Euler angles for $F_E$ end $F_S$, compute the differences and incrementally built the transformations but it does not work. Does somebody can give me some hints or pointers towards existing solutions?

The application is related to the computation of a path for an arm and so the frames are associated with the end effector.

Thank you

• Euler angles have many mathematical disadvantages, and it's never necessary to use them because of all the alternatives (mentioned in the answers), so it's best to forget about them. – JJM Driessen May 20 '17 at 10:21

Let a transformation matrix $T$ be $$T = \begin{bmatrix}R & p\\ 0 & 1\end{bmatrix},$$ where $R$ is a rotation matrix and $p$ is a position vector. I will write $T = (R, p)$ for short. You want to generate a path connecting $T_1= (R_1, p_1)$ and $T_2= (R_2, p_2)$. The problem then boils down to generating a rotational path and a translational path, separately. For translation, a path can be generated pretty easily using any method like polynomial interpolation or using splines. For rotation, it's a bit more complicated but in the end it can also be done using methods like polynomial interpolation. So I will talk a bit about rotation here.
The thing is that any rotation matrix can be written as $$R = e^{[r]},$$ where $r \in \mathbf{R}^3$, $[\cdot]$ maps a vector to a unique skew symmetric matrix, and $e^{[r]}$ is the matrix exponential $$e^{[r]} = \sum_{k = 0}^{\infty}\frac{1}{k!}[r]^k.$$ (Of course, there is a formula for that without evaluating that infinite sum.) So actually a rotational path may be generated as $$R(t) = R_0e^{[r(t)]},$$ where $r(t)$ is a polynomial vector and $R_0$ is some constant rotation matrix. Then you just need to find $r(t)$ such that $R_0e^{[r(0)]} = R_1$ and $R_0e^{[r(T)]} = R_2$, so as to meet your boundary conditions. For more details, you may have a look at this paper, for example.