<style>
.reveal {
font-size: 24px;
}
</style>
# Measuring motion
[Summary from Professor Peter Corke's tutorial](https://robotacademy.net.au/masterclass/measuring-motion/?lesson=235)
by:
[Liber Normous](https://hackmd.io/@libernormous)
---
# Using accelerometer
{%youtube abJYmxJbyvs %}
[Video link](https://robotacademy.net.au/masterclass/measuring-motion/?lesson=238)
----
$$
\left(\begin{matrix}
a_x\\
a_y\\
a_z
\end{matrix}\right)=
\left(\begin{matrix}
-g\sin{\theta}\\
g\cos{\theta}\sin\phi\\
g\cos{\theta}\cos\phi
\end{matrix}\right)
$$
$$
\begin{matrix}
\sin\theta = \frac{-a_x}{g} &\ \ \ \tan\phi = \frac{a_y}{a_z}
\end{matrix}
$$
$\phi$ Roll rotation on X-axis
$\theta$ Pitch rotation on Y-axis
$\psi$ Yaw rotation on Z-axis
---
# Using magnetometer
{%youtube PESgDsm9fbI %}
[Video link](https://youtu.be/PESgDsm9fbI)
----
$$
\psi = \tan^{-1}\frac{\cos\theta(b_z\sin\phi-b_y\cos\phi)}{b_x+B\sin I\sin\theta}
$$
$\mathbf{B}=(b_x,b_y,b_z)^T$
$B$ is magnitude. $I$ is magnetic inclination. $\theta$ is pitch (rotation on Y-axis)
---
# Using gyroscope
{%youtube BI5rUKu49jA %}
[Video link](https://youtu.be/BI5rUKu49jA)
----
$$
\mathbf{RR}^T = \mathbf{I}\ \ \ \ \text{Its transpose is its inverse}\\
\mathbf{R}_x(\theta)\mathbf{R}_x(\theta)^T=\mathbf{I}\\
\frac{d}{d\theta}\mathbf{R}_x(\theta)\mathbf{R}_x(\theta)^T + \mathbf{R}_x(\theta)\frac{d}{d\theta}\mathbf{R}_x(\theta)^T \\
\mathbf{S} + \mathbf{S}^T = 0 \\
\text{the summation of its transpose is zero}\\
\text{the derivative is skew matrix}
$$
----
$$
\mathbf{S}(\mathbf{v})=
\left(\begin{matrix}
0 &-z &y\\
z &0 &-x\\
-y &x &0
\end{matrix}\right)\\
\mathbf{v}=(x,y,z)\\
\mathbf{S}([1,0,0])=
\left(\begin{matrix}
0 &0 &0\\
0 &0 &-1\\
0 &1 &0
\end{matrix}\right)
$$
----
## Derivation of rotation on each axis
1. derifative rotation on X-axis
$$
\frac{d}{d\theta}\mathbf{R}_x(\theta)=\mathbf{S}([1,0,0])\mathbf{R}_x(\theta)
$$
2. derifative rotation on Y-axis
$$
\frac{d}{d\theta}\mathbf{R}_y(\theta)=\mathbf{S}([0,1,0])\mathbf{R}_y(\theta)
$$
3. derifative rotation on Z-axis
$$
\frac{d}{d\theta}\mathbf{R}_z(\theta)=\mathbf{S}([0,0,1])\mathbf{R}_z(\theta)
$$
4. derifative rotation on arbitrary axis, vector $l$
$$
\frac{d}{d\theta}\mathbf{R}_l(\theta)=\mathbf{S}(l)\mathbf{R}_l(\theta)
$$
----
....SO
$$
\dot{\mathbf{R}_l}(\theta)=\mathbf{S}(\omega)\mathbf{R}_l(\theta)\ ;\ \omega=\dot{\theta}l
$$
---
# References:
[[1] Measuring motion by Professor Peter Corke](https://robotacademy.net.au/masterclass/measuring-motion/?lesson=235)
---
###### tags: `robot`
{"metaMigratedAt":"2023-06-15T05:57:24.099Z","metaMigratedFrom":"YAML","title":"Measuring motion","breaks":true,"slideOptions":"{\"transition\":\"slide\"}","contributors":"[{\"id\":\"5873a290-d7f7-4feb-90ca-77e42841519a\",\"add\":3059,\"del\":459}]"}