<style>
.reveal {
font-size: 24px;
}
</style>
# Twists
Finding the angular velocity, and translational velocity of a space.
Summarized from
"Modern Robotics: Mechanics, Planning, and Control"
For better look check this note in [HackMD.io](https://hackmd.io/@libernormous/twists)
by:
[Liber Normous](https://hackmd.io/@libernormous)
---
# Transformation matrix
<!-- $$
\left(
\begin{matrix}
\end{matrix}
\right)
$$ -->
Transformation consists of two components, rotation $\boldsymbol{R}$ and translation $\boldsymbol{t}$.
$$
^A\boldsymbol{T}_B=
\left(
\begin{matrix}
^A\boldsymbol{R}_B & ^A\boldsymbol{t}_B\\
0 & 1
\end{matrix}
\right)=
\left(
\begin{matrix}
r_{11} & r_{12} & r_{13} & t_{1}\\
r_{21} & r_{22} & r_{23} & t_{2}\\
r_{31} & r_{32} & r_{33} & t_{3}\\
0 & 0 & 0 & 1
\end{matrix}
\right)
$$
Point $P$ on frame {B} can be represented as vector $^A\boldsymbol{p}_P$. And also represented in homogenous term as $^A\tilde{\boldsymbol{p}}_P$. And to transform or represent point $P$ on frame {A} we can use
$$
^A\tilde{\boldsymbol{p}}_P = ^A\boldsymbol{T}_B\ ^B\tilde{\boldsymbol{p}}_P
$$
---
# Properties of transformation matrix
$$
^A\boldsymbol{T}_B=
\left(
\begin{matrix}
^A\boldsymbol{R}_B & ^A\boldsymbol{t}_B\\
0 & 1
\end{matrix}
\right)\\
^A\boldsymbol{T}_B^{-1}=^B\boldsymbol{T}_A=
\left(
\begin{matrix}
^A{\boldsymbol{R}_B}^T & -{^A\boldsymbol{R}_B}^T\ ^A\boldsymbol{t}_B\\
0 & 1
\end{matrix}
\right)\\
^A{\boldsymbol{R}_B}^T =\ ^A{\boldsymbol{R}_B}^{-1}=\ ^B{\boldsymbol{R}_A}\\
\boldsymbol{t}^T \neq \boldsymbol{t}^{-1}
$$
---
# Skew symmetric matrix
Lets follow Prof. Corke's notation one more. We denote $\boldsymbol{S}(\cdot)$ as skew symmetric notation, for example
$$
\boldsymbol{S}(\boldsymbol{x})=
\left(
\begin{matrix}
0 & -x_3 & x_2\\
x_3 & 0 & -x_1\\
-x_2 & x_1 & 0
\end{matrix}
\right)
$$
And the magic of this matrix is
$$
\boldsymbol{S}(\boldsymbol{x})^-1 = -\boldsymbol{S}(\boldsymbol{x})^T
$$
---
# Angular velocity
A body frame {b} is attached to space frame {s}.
Let $^s\boldsymbol{R}_b(t)$ be the rotation matrix describing the orientation of frame {b} with respect to frame {s} at time $t$. We write it as $\boldsymbol{R}(t)$ from now on. $\dot{\boldsymbol{R}}(t)$ is its time rate of change as seen from {s}. Using skew symmetric we can calculate $\dot{\boldsymbol{R}}(t)$
$$
\boldsymbol{S}(\boldsymbol{\omega}_s)\boldsymbol{R}(t)=\dot{\boldsymbol{R}(t)}\\
\boldsymbol{S}(\boldsymbol{\omega}_s) = \dot{\boldsymbol{R}(t)}{\boldsymbol{R}(t)}^{-1}\\
\boldsymbol{S}(\boldsymbol{\omega}_b) = {\boldsymbol{R}(t)}^{-1}\dot{\boldsymbol{R}(t)}
$$
.
----
where
$$
\boldsymbol{S}(\boldsymbol{\omega}_s)=
\left(
\begin{matrix}
0 & -\omega_z & \omega_y\\
\omega_z & 0 & -\omega_x\\
-\omega_y & \omega_x & 0
\end{matrix}
\right)
$$
---
# Moving body frame
Let assume {s} as fixed space and {b} as moving body frame. A body frame {b} is attached to space frame {s}. Let $^s\boldsymbol{t}_b(t)$ be the vector describing the position of frame {b} with respect to frame {s} at time $t$. We write it as $\boldsymbol{t}(t)$ from now on. $\dot{\boldsymbol{t}}(t)$ is its time rate of change as seen from {s}. Then let
$$
^A\boldsymbol{T}_B(t)=\boldsymbol{T}(t)=
\left(
\begin{matrix}
\boldsymbol{R} (t) & \boldsymbol{t}(t)\\
0 & 1
\end{matrix}
\right)\\
$$
denote configuration of {b} as seen from {s}. This time we write $^A\boldsymbol{T}_B(t)$ as $\boldsymbol{T}(t)$.
$$
\begin{align}
\boldsymbol{T}^{-1}\dot{\boldsymbol{T}}&=
\left(
\begin{matrix}
\boldsymbol{R}^T & -\boldsymbol{R}^T\boldsymbol{t}\\
0 & 1
\end{matrix}
\right)
\left(
\begin{matrix}
\dot{\boldsymbol{R}} & \dot{\boldsymbol{t}}\\
0 & 1
\end{matrix}
\right)\\
&= \left(
\begin{matrix}
\boldsymbol{R}^T\dot{\boldsymbol{R}} & \boldsymbol{R}^T\dot{\boldsymbol{t}}\\
0 & 0
\end{matrix}
\right)\\
&= \left(
\begin{matrix}
\boldsymbol{S}(\boldsymbol{\omega}_b) & \boldsymbol{v}_b\\
0 & 0
\end{matrix}
\right)
\end{align}
$$
.
----
Recall that $\boldsymbol{S}(\boldsymbol{\omega}_b)$ is skew symmetry matrix representation of angular velocity expressed in {b} coordinates. Also $\dot{\boldsymbol{t}}$ is linear velocity of frame {b} expressed in frame {s}. Also, $\boldsymbol{v}_b$ is linear velocity expressed in frame {b}.
----
$\dot{\boldsymbol{R}}(t)$ is angular velocity of frame {b} as seen from frame {s}.
$\boldsymbol{v}_b$ is linear velocity of frame {b} as seen from frame {s}.
----
$\boldsymbol{\omega}_s$ is space frame veolcity. $\boldsymbol{\omega}_b$ is body frame veolcity.
Both of them do not depend on the choice of a frame even the calculation looks like it needs a frame of reference.
---
# Spatial velocity in the body frame
Or simply **body twist**
$$
\mathcal{V} =
\left(
\begin{matrix}
\boldsymbol{\omega}_s \\ \boldsymbol{v}_s
\end{matrix}
\right)
$$
$$
\boldsymbol{v} = (v_x, v_y, v_z)\\
\boldsymbol{\omega} = (\omega_x, \omega_y, \omega_z)
$$
----
Please note, some reference will use different notation of $\mathcal{V}$, for example in Prof. Corke's book he write it as $\mathcal{V} =
\left(
\begin{matrix}
\boldsymbol{v}_s \\ \boldsymbol{\omega}_s
\end{matrix}
\right)$
----
So if we have $^s\boldsymbol{T}_b$ we can construct this form *matrix representation* (6x6) of **body twist**:
$$
\boldsymbol{S}(\boldsymbol{\mathcal{V}}_s) = \dot{^s\boldsymbol{T}_b}\ ^s\boldsymbol{T}_b^{-1} = \left(
\begin{matrix}
\boldsymbol{S}(\boldsymbol{\omega}_s) & \boldsymbol{v}_s\\
0 & 0
\end{matrix}
\right)
$$
$$
\boldsymbol{S}(\boldsymbol{\mathcal{V}}_b) =\ ^s\boldsymbol{T}_b^{-1}\ \dot{^s\boldsymbol{T}_b} = \left(
\begin{matrix}
\boldsymbol{S}(\boldsymbol{\omega}_b) & \boldsymbol{v}_b\\
0 & 0
\end{matrix}
\right)
$$
----
So if we have $^s\boldsymbol{T}_b$ we can construct this form *matrix representation* of **spatial twist**:
$$
\boldsymbol{\mathcal{V}}_s=
\left(
\begin{matrix}
\boldsymbol{\omega_s} \\ \boldsymbol{v_s}
\end{matrix}
\right)=
\left(
\begin{matrix}
\boldsymbol{R} & \boldsymbol{0}\\
\boldsymbol{S}(\boldsymbol{t})\boldsymbol{R} & \boldsymbol{R}
\end{matrix}
\right)
\left(
\begin{matrix}
\boldsymbol{\omega_b} \\ \boldsymbol{v_b}
\end{matrix}
\right)=
\boldsymbol{S}(\textrm{Ad}_{\boldsymbol{T}})\boldsymbol{\mathcal{V}}_b
$$
$$
\boldsymbol{\mathcal{V}}_b=
\left(
\begin{matrix}
\boldsymbol{\omega_b} \\ \boldsymbol{v_b}
\end{matrix}
\right)=
\left(
\begin{matrix}
\boldsymbol{R}^T & \boldsymbol{0}\\
-\boldsymbol{R}^T\ \boldsymbol{S}(\boldsymbol{t}) & \boldsymbol{R}^T
\end{matrix}
\right)
\left(
\begin{matrix}
\boldsymbol{\omega_s} \\ \boldsymbol{v_s}
\end{matrix}
\right)=
\boldsymbol{S}(\textrm{Ad}_{^b\boldsymbol{T}_s})\boldsymbol{\mathcal{V}}_s
$$
----
To be more clear!
$$
\boldsymbol{\mathcal{V}}_s=
\left(
\begin{matrix}
\boldsymbol{\omega_s} \\ \boldsymbol{v_s}
\end{matrix}
\right)=
\left(
\begin{matrix}
^s\boldsymbol{R}_b & \boldsymbol{0}\\
\boldsymbol{S}(^s\boldsymbol{t}_b)^s\boldsymbol{R}_b & ^s\boldsymbol{R}_b
\end{matrix}
\right)
\left(
\begin{matrix}
\boldsymbol{\omega_b} \\ \boldsymbol{v_b}
\end{matrix}
\right)=
\boldsymbol{S}(\textrm{Ad}_{^s\boldsymbol{T}_b})\boldsymbol{\mathcal{V}}_b
$$
$$
\boldsymbol{\mathcal{V}}_b=
\left(
\begin{matrix}
\boldsymbol{\omega_b} \\ \boldsymbol{v_b}
\end{matrix}
\right)=
\left(
\begin{matrix}
^s\boldsymbol{R}{_b}^T & \boldsymbol{0}\\
-^s\boldsymbol{R}_b^T\ \boldsymbol{S}(^s\boldsymbol{t}_b) & ^s\boldsymbol{R}_b^T
\end{matrix}
\right)
\left(
\begin{matrix}
\boldsymbol{\omega_s} \\ \boldsymbol{v_s}
\end{matrix}
\right)=
\boldsymbol{S}(\textrm{Ad}_{^b\boldsymbol{T}_s})\boldsymbol{\mathcal{V}}_s
$$
----
$\textrm{Ad}_{^s\boldsymbol{T}_b}$ is called adjoint representation of $^s\boldsymbol{T}_b$. it has this property
$$
\boldsymbol{S}(\textrm{Ad}_{^s\boldsymbol{T}_b})^{-1}=\boldsymbol{S}(\textrm{Ad}_{{^s\boldsymbol{T}_b}^{-1}})=\boldsymbol{S}(\textrm{Ad}_{^b\boldsymbol{T}_s})
$$
.
---
# Example
from [[5] p.102](http://hades.mech.northwestern.edu/images/7/7f/MR.pdf)
Figure 3.18 shows a top view of a car, with a single steerable
front wheel, driving on a plane. The $\hat{z}_b$-axis of the body frame {b} is into the page and the $\hat{z}_s$-axis of the fixed frame {s} is out of the page. The angle of the front wheel of the car causes the car’s motion to be a pure angular velocity

---
# References
[[1] Visual Servoing Platform Tutorial p.14](https://visp-doc.inria.fr/manual/visp-tutorial-geometric-objects.pdf)
[[2] Rigid body motion Ohio State University p.16](http://www2.ece.ohio-state.edu/~zhang/RoboticsClass/docs/LN4_RigidBodyMotion.pdf)
[[3] ECE 5463 Introduction to Robotics Ohio State University](http://www2.ece.ohio-state.edu/~zhang/RoboticsClass/)
[[4] A Mathematical Introduction to Robotic Manipulation p.55](https://www.cds.caltech.edu/~murray/books/MLS/pdf/mls94-complete.pdf)
[[5] MODERN ROBOTICS MECHANICS, PLANNING, AND CONTROL p.97](http://hades.mech.northwestern.edu/images/7/7f/MR.pdf)
###### tags: `robot`
{"metaMigratedAt":"2023-06-15T06:25:47.263Z","metaMigratedFrom":"YAML","title":"Twists","breaks":false,"slideOptions":"{\"transition\":\"slide\"}","contributors":"[{\"id\":\"5873a290-d7f7-4feb-90ca-77e42841519a\",\"add\":13297,\"del\":4285}]"}