Robotics. 2D Rotations
Published:
2D Geometry
2D Pose
In robotics, a pose is defined as the set of parameters that completely describe a robot’s location and orientation in the plane. Two types of parameters are used:
- those that model the position,
- and those that represent the orientation.
In \(\mathbb{R}^2\) a pose is fully described by 3 parameters:
- Position: coordinates \((x, y)\)
- Orientation: orientation angle \((\theta)\) with respect to a reference axis
Thus, any pose in 2D can be expressed as:
\[\xi = (x, y, \theta)\]Robotics notation
Let (A) be a coordinate frame and (B) a point. We define
\[\space^{A}p_{B}\]as the position vector of point (B) expressed in coordinate frame (A).
Similarly, the pose of one reference frame with respect to another can be expressed as:
\[\space^{A}\xi_{B}\]which represents the pose of system (B) with respect to system (A).
Composition of frames
Positions and poses are different entities and therefore cannot be directly operated together. However, they can be properly composed.
For example, the relative position with respect to frame (A) can be obtained from the relative position with respect to (B):
\[\space^{A}p = \space^{A}\xi_{B} \cdot \space^{B}p\]Likewise, three frames can be related through pose composition:
\[\space^{A}\xi_{C} = \space^{A}\xi_{B} \oplus \space^{B}\xi_{C}\]Pose algebra
Below is a summary of the fundamental operations defined on poses (pose algebra):
Pose inverse
The inverse pose undoes the transformation of a pose. If a pose is applied and then its inverse, we return to the origin:
\[\xi^{-1} \oplus \xi = 0\]Pose addition
Addition corresponds to the composition of transformations:
- It is not commutative.
- It is not distributive.
- It represents applying one pose after another.
Useful properties
- \[\space^X\xi_Y \oplus \space^Y\xi_Z = \space^X\xi_Z\]
- \[\xi_{1} \oplus \xi_{2} \neq \xi_{2} \oplus {\xi}_{1}\]
- \[\ominus \space^X\xi_Y = \space^Y\xi_X\]
- \[\xi \ominus \xi = 0\]
- \[\ominus \xi \oplus \xi = 0\]
- \[\xi \ominus 0 = \xi\]
- \[\xi \oplus 0 = \xi\]
Developing a real representation of pose in 2D
Any 2D pose can be described as the composition of a rotation and a translation.
2D rotations
Any rotation in 2D can be defined in the space \(SO(2)\):
\[R(\theta) = \begin{pmatrix} \cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \end{pmatrix}\] \[\begin{pmatrix} x' \\ y' \end{pmatrix} = R \begin{pmatrix} x \\ y \end{pmatrix}\]2D translations
As with 2D rotations, we seek an operator that maps any 2D position to its translated version:
\[\begin{pmatrix} x + \Delta \\ y \end{pmatrix} = T_x(\Delta) \begin{pmatrix} x \\ y \end{pmatrix}\]Let us derive the values:
\[T_x(\Delta, y) = \begin{pmatrix} 1 & \frac{\Delta}{y} \\ 0 & 1 \\ \end{pmatrix}\]As we see, a translation matrix \((T_x(\Delta))\) in \(\mathbb{R}^{2\times 2}\) does not exist, since the derived matrix depends on the vector’s position being translated: \(T_x(\Delta, y)\).
Homogeneous form
As a solution to the previously described problem, a new coordinate system is introduced, called the homogeneous form:
\[\tilde{p} = \begin{pmatrix}x \\ y \\ 1\end{pmatrix}\]This allows the definition of a translation operator that depends only on the displacement distance:
\[T_x(\Delta) = \begin{pmatrix} 1 & 0 & \Delta \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}\]The rotation matrix is also modified in homogeneous form:
\[R(\theta) = \begin{pmatrix} \cos\theta & \sin\theta & 0\\ -\sin\theta & \cos\theta & 0\\ 0 & 0 & 1 \end{pmatrix}\]All other operators are modified as well, for example scalar multiplication in homogeneous form:
\[\lambda = \begin{pmatrix} \lambda & 0 & 0 \\ 0 & \lambda & 0 \\ 0 & 0 & 1 \end{pmatrix}\]The pose transformation matrix is defined as:
\[\space^{A}\xi_{B} \sim \space^{A}R_{B} \cdot \space^{A}T_{B} = \begin{pmatrix} \cos\theta & -\sin\theta & t_x \\ \sin\theta & \cos\theta & t_y \\ 0 & 0 & 1 \end{pmatrix}\]With the properties:
- \[\space^{A}\xi_{B} \oplus \space^{B}\xi_{C} \sim \space^{A}T_{B} \space^{B}T_{C}\]
- \[\ominus \xi \sim T^{-1}\]