diff --git a/electives/amr/assets/inverse-kinematics.png b/electives/amr/assets/inverse-kinematics.png index 2a8e88f..e7b1d87 100644 Binary files a/electives/amr/assets/inverse-kinematics.png and b/electives/amr/assets/inverse-kinematics.png differ diff --git a/electives/amr/autonomous-mobile-robots-cheatsheet.pdf b/electives/amr/autonomous-mobile-robots-cheatsheet.pdf index 566745c..4731f22 100644 Binary files a/electives/amr/autonomous-mobile-robots-cheatsheet.pdf and b/electives/amr/autonomous-mobile-robots-cheatsheet.pdf differ diff --git a/electives/amr/parts/01_kinematics/00_intro.tex b/electives/amr/parts/01_kinematics/00_intro.tex index ef027dc..eaac7e7 100644 --- a/electives/amr/parts/01_kinematics/00_intro.tex +++ b/electives/amr/parts/01_kinematics/00_intro.tex @@ -7,25 +7,25 @@ $_{\color{blue}\fbox{W}}\,\vec{t}\,_{\color{red}\fbox{B}} = \, _{\color{blue}\fb \shortdefinition[State vector] $x_R$: $x$, $v$ of rob in $W$, pos of sensors \shortdefinition[Rot. Mat.] +$\mat{R}_{z}(\psi)$ (Yaw), +$\mat{R}_y(\theta)$ (Pitch), +$\mat{R}_x(\varphi)$ (Roll)\\ {\scriptsize - $\mat{R}_{z}(\psi)$ (Yaw), - $\mat{R}_y(\theta)$ (Pitch), - $\mat{R}_x(\varphi)$ (Roll)\\ - $\begin{bmatrix} - c(\psi) & -s(\psi) & 0 \\ - s(\psi) & c(\psi) & 0 \\ - 0 & 0 & 1 - \end{bmatrix}; - \begin{bmatrix} - c(\theta) & 0 & s(\theta) \\ - 0 & 1 & 0 \\ - -s(\theta) & 0 & c(\theta) \\ - \end{bmatrix}; - \begin{bmatrix} - 1 & 0 & 0 \\ - 0 & c(\varphi) & -s(\varphi) \\ - 0 & s(\varphi) & c(\varphi) - \end{bmatrix}$ +$\begin{bmatrix} + c(\psi) & -s(\psi) & 0 \\ + s(\psi) & c(\psi) & 0 \\ + 0 & 0 & 1 + \end{bmatrix}; + \begin{bmatrix} + c(\theta) & 0 & s(\theta) \\ + 0 & 1 & 0 \\ + -s(\theta) & 0 & c(\theta) \\ + \end{bmatrix}; + \begin{bmatrix} + 1 & 0 & 0 \\ + 0 & c(\varphi) & -s(\varphi) \\ + 0 & s(\varphi) & c(\varphi) + \end{bmatrix}$ } \shortremark Application: ${_W} \vec{a} = \mat{R}_{WB} {_B} \vec{a}$ @@ -36,17 +36,17 @@ $_{\color{blue}\fbox{W}}\,\vec{t}\,_{\color{red}\fbox{B}} = \, _{\color{blue}\fb \shortdefinition[Euler Ang] (Tait-Brian) $\mat{R}_{EB} = \mat{R}_z(\psi) \cdot \mat{R}_y(\theta) \cdot \mat{R}_x(\varphi)$. $\begin{smallmatrix} - \psi = \arcsin\left( R_{21} \div \sqrt{1 - R_{31}^2} \right)\\ - \theta = \arcsin(-R_{31})\\ - \varphi = \arcsin\left( R_{31} \div \sqrt{1 - R_{31}^2} \right)\\ - \end{smallmatrix}$ -{\scriptsize - $[\vec{n}]^\times = \begin{bmatrix} - 0 & -a_3 & a_2 \\ - a_3 & 0 & -a_1 \\ - -a_2 & a_1 & 0 - \end{bmatrix}$ - } + \psi = \arcsin\left( R_{21} \div \sqrt{1 - R_{31}^2} \right)\\ + \theta = \arcsin(-R_{31})\\ + \varphi = \arcsin\left( R_{31} \div \sqrt{1 - R_{31}^2} \right)\\ + \end{smallmatrix}$ +$[\vec{n}]^\times = \begin{bmatrix} + 0 & -a_3 & a_2 \\ + a_3 & 0 & -a_1 \\ + -a_2 & a_1 & 0 + \end{bmatrix}$ + +For pitch axis $= \pm 90\deg$, Gimbal Lock, Jacobian singular. \shortdefinition[Angle-Axis] $\vec{\alpha} = \alpha \vec{n}$ ($\vec{n}$ normal); Convert to rot. mat\\ @@ -58,31 +58,31 @@ To quat: $\vec{q} = [\vec{n}, \alpha]$ $i^2 = j^2 = k^2 = -1$, ($ij = -ji = k$, same for $jk$ and $ki$). $\vec{q} = \begin{bmatrix} - \vec{v}(\vec{q}), a(\vec{q}) - \end{bmatrix}^\top$, $a(\vec{q}) = q_w$, Add like $\C$ (by ``groups'') + \vec{v}(\vec{q}), a(\vec{q}) + \end{bmatrix}^\top$, $a(\vec{q}) = q_w$, Add like $\C$ (by ``groups'') \bi{Mult} {\scriptsize - $\vec{q} \otimes \vec{p} = \begin{bmatrix} - a(\vec{q}) \vec{v}(\vec{p}) + a(\vec{p}) + \vec{v}(\vec{q}) \times \vec{v}(\vec{p}) \\ - a(\vec{q}) a(\vec{p}) - \vec{v}(\vec{q})^\top \vec{v}(\vec{p}) - \end{bmatrix}$ + $\vec{q} \otimes \vec{p} = \begin{bmatrix} + a(\vec{q}) \vec{v}(\vec{p}) + a(\vec{p}) + \vec{v}(\vec{q}) \times \vec{v}(\vec{p}) \\ + a(\vec{q}) a(\vec{p}) - \vec{v}(\vec{q})^\top \vec{v}(\vec{p}) + \end{bmatrix}$ } \bi{To Rot Mat} {\scriptsize - $R_{AB} = \mat{I}_3 + 2a(\vec{q}_{AB}) [\vec{v}(\vec{q}_{AB})]^\times + 2([\vec{v}(\vec{q}_{AB})]^\times)^2$ + $R_{AB} = \mat{I}_3 + 2a(\vec{q}_{AB}) [\vec{v}(\vec{q}_{AB})]^\times + 2([\vec{v}(\vec{q}_{AB})]^\times)^2$ } \shortdefinition[Transf. M] {\scriptsize - $\mat{T}_{AC} = \mat{T}_{AB} \mat{T}_{BC}$ R.-Handed typ; Aero: Left-H\\ - $\mat{T}_{AB} = \begin{bmatrix} - \mat{R}_{AB} & {_A}\vec{t}_B \\ - \mat{0}_{1\times 3} & 1 - \end{bmatrix}; - \mat{T}_{BA} = \mat{T}_{AB}^{-1} = - \begin{bmatrix} - \mat{R}_{AB}^\top & -\mat{R}_{AB}^\top {_A}\vec{t}_B \\ - \mat{0}_{1 \times 3} & 1 - \end{bmatrix}$ + $\mat{T}_{AC} = \mat{T}_{AB} \mat{T}_{BC}$ R.-Handed typ; Aero: Left-H\\ + $\mat{T}_{AB} = \begin{bmatrix} + \mat{R}_{AB} & {_A}\vec{t}_B \\ + \mat{0}_{1\times 3} & 1 + \end{bmatrix}; + \mat{T}_{BA} = \mat{T}_{AB}^{-1} = + \begin{bmatrix} + \mat{R}_{AB}^\top & -\mat{R}_{AB}^\top {_A}\vec{t}_B \\ + \mat{0}_{1 \times 3} & 1 + \end{bmatrix}$ } diff --git a/electives/amr/parts/01_kinematics/02_inverse.tex b/electives/amr/parts/01_kinematics/02_inverse.tex index d054a39..bd48fee 100644 --- a/electives/amr/parts/01_kinematics/02_inverse.tex +++ b/electives/amr/parts/01_kinematics/02_inverse.tex @@ -1,12 +1,11 @@ \subsection{Inverse Kinematics (IK)} -\begin{wrapfigure}[10]{r}{0.4\columnwidth} - \includegraphics[width=0.4\columnwidth]{assets/inverse-kinematics.png} +\begin{wrapfigure}[10]{r}{0.35\columnwidth} + \includegraphics[width=0.35\columnwidth]{assets/inverse-kinematics.png} \end{wrapfigure} \bi{Option}: Solve Forward Kinematics for angles.\\ -\bi{Better}: Law of cosine with polar coordinates. Compute angle using cosine rule,\\ +\bi{Better}: Law of cosine with polar coordinates. Compute angle using cosine rule, $\theta_1 = \varphi \pm \alpha$, $\theta_2 = \pm(\pi - \beta)$ - -(Positive for {\color{ForestGreen} Elbow Down}, Negative for {\color{red} Elbow Up}) +(Positive for {\color{ForestGreen} Elbow Down}, Neg. for {\color{red} Elbow Up}) \bi{Extension to 6R}: 1. Waist: spherical coords (2 sol.)\\ diff --git a/electives/amr/parts/01_kinematics/03_temporal-models.tex b/electives/amr/parts/01_kinematics/03_temporal-models.tex index 2135a87..d58b422 100644 --- a/electives/amr/parts/01_kinematics/03_temporal-models.tex +++ b/electives/amr/parts/01_kinematics/03_temporal-models.tex @@ -7,7 +7,7 @@ $\mat{H}$ is meas., $\mat{F}_C$ system, $\mat{G}$ input gain, $\vec{w}$ process both zero-mean \bi{Gaussian White Noise Process}. To \bi{discretize}, integrate from $t_{k - 1}$ to $t_k$:\\ -$\vec{x}_k = \vec{f}(\vec{x}_{k - 1}, \vec{u}_k, \vec{w}_k)$ +$\vec{x}_k = \vec{f}(\vec{x}_{k - 1}, \vec{u}_k, \vec{w}_k)$; $\vec{z}_k = \vec{h}(\vec{x}_k) + \vec{v}_k$, \bi{linearised}:\\ $\delta \vec{x}_k = \vec{f}(\vec{\overline{x}}, \vec{\overline{u}}) + \mat{F} \delta \vec{x}_{k - 1} + \mat{G}_k \delta \vec{u}_k + \mat{L}_k \vec{w}_k$; diff --git a/electives/amr/parts/01_kinematics/05_rigid-body-dynamics.tex b/electives/amr/parts/01_kinematics/05_rigid-body-dynamics.tex index fc20fe3..29c09e5 100644 --- a/electives/amr/parts/01_kinematics/05_rigid-body-dynamics.tex +++ b/electives/amr/parts/01_kinematics/05_rigid-body-dynamics.tex @@ -2,8 +2,10 @@ \label{sec:rigid-body-dynamics} \shortdefinition[Newton II] For fin. body w/ mass $m$ and inertia mat. $I$, with force $\vec{F}$ and torque $\vec{T}$ on \bi{Centre of Mass} (CoM), expressed in body frame: \begin{align*} - {_B}\vec{F} &= \sum {_B}\vec{F}_i = m({_B} \vec{\dot{v}}_{CoM}) + m_B \vec{\omega} \times {_B}\vec{v}_{CoM} \\ - {_B}\vec{T} &= \sum {_B}\vec{T}_i = \mat{I}({_B} \vec{\dot{\omega}}) + {_B} \vec{\omega} \times \mat{I}_B\vec{\omega} + {_B}\vec{F} & = \sum {_B}\vec{F}_i = m({_B} \vec{\dot{v}}_{CoM}) + m_B \vec{\omega} \times {_B}\vec{v}_{CoM} \\ + {_B}\vec{T} & = \sum {_B}\vec{T}_i = \mat{I}({_B} \vec{\dot{\omega}}) + {_B} \vec{\omega} \times \mat{I}_B\vec{\omega} \end{align*} ${_B} \vec{v}_{CoM}$ vel. of CoM, ${_B}\omega$ rot. speed; both w.r.t. inert. frame + + {\scriptsize Legged robots don't need to maintain stability!}