Frames

9.1.4. Frames#

We are now ready to introduce the frame, a 4x4 matrix that expresses both the position and the orientation of a coordinate system, in reference to another coordinate system.

The fourth (easiest) column of a frame is the position of the local coordinate system’s origin expressed in the reference coordinate system. In the example of Figure 4, this is:

\[\begin{split} ~^\text{global}p_\text{upper arm} = \begin{bmatrix} x_\text{upper arm} \\ y_\text{upper arm} \\ z_\text{upper arm} \\ 1 \end{bmatrix} \end{split}\]

The first three columns of a frame express the frame orientation. They are, in the reference coordinate system, the coordinates of three unit vectors that are respectively oriented toward the x, y and z axes of the local coordinate system.

Fig. 9.5 Orientation of the upper arm coordinate system (bold lines) in reference to the global coordinate system (thin lines).#

Based on Fig. 9.5, which illustrates this concept for the pose of Fig. 9.4, here is how we would express these three unit vectors in both coordinate systems:

In the upper arm coordinate system

In the global coordinate system

Upper arm x axis

\(\begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}\)

\(\begin{bmatrix} \cos(\theta) \\ \sin(\theta) \\ 0 \\ 0 \end{bmatrix}\)

Upper arm y axis

\(\begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix}\)

\(\begin{bmatrix} -\sin(\theta) \\ \cos(\theta) \\ 0 \\ 0 \end{bmatrix}\)

Upper arm z axis

\(\begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix}\)

\(\begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix}\)

Combining these four vectors into a single 4x4 matrix gives the frame \(~^\text{global}_\text{upper arm}T\):

\[\begin{split} ~^\text{global}_\text{upper arm}T = \begin{bmatrix} \cos(\theta) & -\sin(\theta) & 0 & x_\text{upper arm} \\ \sin(\theta) & \cos(\theta) & 0 & y_\text{upper arm} \\ 0 & 0 & 1 & z_\text{upper arm} \\ 0 & 0 & 0 & 1 \end{bmatrix} \end{split}\]

where the expression \(~^\text{global}_\text{upper arm}T\) is read as: Position and orientation of the upper arm coordinate system, expressed in the global coordinate system.

For example, if the shoulder is located 15 cm forward and 70 cm upward to the global origin, and the upper arm is inclined at 30 degrees of the vertical, then the position and orientation of the upper arm coordinate system is expressed by the frame:

\[\begin{split} ~^\text{global}_\text{upper arm}T = \begin{bmatrix} \cos(30) & -\sin(30) & 0 & 0.15 \\ \sin(30) & \cos(30) & 0 & 0.7 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \\= \begin{bmatrix} 0.866 & -0.5 & 0 & 0.15 \\ 0.5 & 0.866 & 0 & 0.7 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \end{split}\]

Important

Independently of the position and orientation of the studied body, a frame always has this form:

\[\begin{split} \begin{bmatrix} R_{11} & R_{12} & R_{13} & P_x \\ R_{21} & R_{22} & R_{23} & P_y \\ R_{31} & R_{32} & R_{33} & P_z \\ 0 & 0 & 0 & 1 \end{bmatrix} \end{split}\]

where:

  • the \(R\) sub-matrix is a function of three rotation angles and represents the orientation of the local coordinate system;

  • the \(P\) vector is the position of the local coordinate system’s origin.