Careful! Its math time!
Definition and Overview
Every Robot assumes a pose in the real world described by its position [x, y, z] and orientation [pitch, yaw, roll] along three major axes of a cartesian coordinate system.
The most useful way to describe the position and orientation (relative to what?) has to do with the application. Could be the base of the robot, could be some point in a building, startup location, etc.
A Frame of Reference is effectively a “Local Coordinate System” - there is no standard Global coordinate system.
Matrix Notation
Point in frame of reference described by a linear combination of three basis vectors that span .
\begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} + p_y\begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} + p_z\begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}$$ Let $\hat{X}_{B}, \hat{Y}_{B}, \hat{Z}_{B}$ be unit vectors that correspond to the principle axes of a coordinate system $\{B\}$. When expressed in coordinate system $\{A\}$, they are denoted $\prescript{A}{}{\hat{X}_{B}}, \prescript{A}{}{\hat{Y}_{B}}, \prescript{A}{}{\hat{Z}_{B}}$. If we want to express a vector in one coordinate system in another coordinate system, we must project each of its components to the unit vectors that span the coordinate system. $$\prescript{A}{}{\hat{X}_{B}} = (\hat{X}_{B} \cdot \hat{X}_{A}, \hat{X}_{B} \cdot \hat{Y}_{A}, \hat{X}_{B} \cdot \hat{Z}_{A})$$ here, $\cdot$ represents a scalar product since all the vectors are unit vectors. We can do the same thing to $\prescript{A}{}{\hat{Y}_{B}}, \prescript{A}{}{\hat{Z}_{B}}$ and that gives us the rotation matrix $$\prescript{A}{B}{R} = [\prescript{A}{}{\hat{X}_{B}}, \prescript{A}{}{\hat{Y}_{B}}, \prescript{A}{}{\hat{Z}_{B}}]$$ Which describes $\{B\}$ relative to $\{A\}$. ### Mapping from one frame to another If frames $\{A\}$ and $\{B\}$ have the same orientation, the find point $\prescript{B}{}{Q}$ as $\prescript{B}{}{Q}$, you can simply add the displacement of the frames of reference. $$\prescript{A}{}{Q} = \prescript{B}{}{Q} + \prescript{A}{}{P}$$ But in practice, this is rarely the case. You'll want to create a homogenous matrix $\prescript{A}B{T}$ that describes the rotation and translation such that\prescript{A}{}{Q} = \prescript{A}{B}{T} \prescript{B}{}{Q}
In expanded form, this looks like $$\begin{bmatrix} \prescript{A}{}{Q} \\ 1\end{bmatrix} = $\begin{bmatrix} &\prescript{A}{B}{R} && | & \prescript{A}{}{P} \\ 0&0&0&|&1\end{bmatrix}\begin{bmatrix} \prescript{B}{}{Q} \\ 1\end{bmatrix}$$ ### Concatenation of Transformations $$\prescript{A}{}{P} = \prescript{A}{B}{T}\prescript{B}{C}{T}\prescript{C}{}{P} = \prescript{A}{C}{T}\prescript{C}{}{P}$$ ### Other representations of orientation #### Euler Angles oh my god im not writing this out fuggin google it theyre pretty useless but interpretable #### Quaternions definition: $$q = a+bi+cj+dk $$ Conjugate: $$q^* = a-bi-cj-dk $$ > Unlike multiplying two rotation matrices, which requires 27 multiplications and 18 additions, multiplying two quaternions only requires 16 multiplications and 12 additions, making the operation computationally more efficient. Importantly, this representation does not suffer from singularities for specific joint angles, making the approach computationally more robust. This is particularly relevant for robotics, as mathematical singularities have pretty significant real-world impact on physical robots.