diff --git a/electives/amr/autonomous-mobile-robots-cheatsheet.pdf b/electives/amr/autonomous-mobile-robots-cheatsheet.pdf index 600480d..d7b0219 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/00_basics/00_probability.tex b/electives/amr/parts/00_basics/00_probability.tex index 49e6ab3..9d228e3 100644 --- a/electives/amr/parts/00_basics/00_probability.tex +++ b/electives/amr/parts/00_basics/00_probability.tex @@ -20,3 +20,5 @@ e.g. $\sum_{X} \P(X) = 1$ becomes $\int \P(x) \dx = 1$ PDF: $f(\vec{x}) = \frac{1}{\sqrt{(2\pi)^k \det(\mat{\Sigma})}} \text{exp}\left( -\frac{1}{2}(\vec{x} - \vec{\mu})^\top \mat{\Sigma}^{-1} (\vec{x} - \vec{\mu}) \right)$ $\Sigma^{-1}$ for $\Sigma$ diagonal, inverse of diag els (e.g. $\sigma^{-1}$) + +\hl{Always Normalize (i.e. sum of all probabilities is 1)} diff --git a/electives/amr/parts/00_basics/03_error-propagation.tex b/electives/amr/parts/00_basics/03_error-propagation.tex index e3cfe84..e6a7837 100644 --- a/electives/amr/parts/00_basics/03_error-propagation.tex +++ b/electives/amr/parts/00_basics/03_error-propagation.tex @@ -1,4 +1,5 @@ \subsection{Error Propagation} \label{sec:error-propagation} For functions $\vec{f}(\vec{x}) = \mat{A}\vec{x}$, the \bi{linear error propagation} -is given by $\Sigma^f = A \Sigma^x A^\top$, with $\Sigma^x$ the uncertanty of $\vec{x}$ (covariance mat.) +is given by $\Sigma^f = A \Sigma^x A^\top$, with $\Sigma^x$ the uncertanty of $\vec{x}$ (covariance mat.), typically $\texttt{diag}(\sigma^2)$, +with $\sigma^2$ the variance of all variables involved diff --git a/electives/amr/parts/01_kinematics/03_temporal-models.tex b/electives/amr/parts/01_kinematics/03_temporal-models.tex index ad44254..d1d8a29 100644 --- a/electives/amr/parts/01_kinematics/03_temporal-models.tex +++ b/electives/amr/parts/01_kinematics/03_temporal-models.tex @@ -39,7 +39,6 @@ Linearization happens typically with one of the below: \shortdefinition[Euler-Forward] $\vec{x}_k = \vec{x}_{k - 1} + \Delta t \vec{f}_C(\vec{x}_{k - 1}, \vec{u}_{k - 1}, t_{k - 1})$ -\newpage \shortdefinition[Trapezoidal num. int] $\Delta \vec{x}_1 = \Delta t \vec{f}_C (\vec{x}_{k - 1}, \vec{u}_{k - 1}, t_{k - 1})$\\ $\Delta \vec{x}_2 = \Delta t \vec{f}_C (\vec{x}_{k - 1} + \Delta \vec{x}_1, \vec{u}_{k}, t_{k})$, then:\\ diff --git a/electives/amr/parts/01_kinematics/06_wheeled-robot.tex b/electives/amr/parts/01_kinematics/06_wheeled-robot.tex index 7d1f611..2d34b28 100644 --- a/electives/amr/parts/01_kinematics/06_wheeled-robot.tex +++ b/electives/amr/parts/01_kinematics/06_wheeled-robot.tex @@ -1,3 +1,4 @@ +\newpage \subsection{Wheeled robot Kinematics} \begin{wrapfigure}[7]{r}{0.2\columnwidth} \includegraphics[width=0.2\columnwidth]{assets/wheel-constraints.png} diff --git a/electives/amr/parts/02_Sensors-Actuators/02_actuators.tex b/electives/amr/parts/02_Sensors-Actuators/02_actuators.tex index 24f6b72..977a7cb 100644 --- a/electives/amr/parts/02_Sensors-Actuators/02_actuators.tex +++ b/electives/amr/parts/02_Sensors-Actuators/02_actuators.tex @@ -3,7 +3,6 @@ \bi{Pneumatic} {\color{ForestGreen} price, shock abs., speed}; {\color{red} acc., loud, maint.} -\newpage \subsubsection{DC Motor} \begin{wrapfigure}[4]{r}{0.32\columnwidth} \includegraphics[width=0.32\columnwidth]{assets/dc-motor.png} diff --git a/electives/amr/parts/03_multi-sensor-estimation/00_linearization.tex b/electives/amr/parts/03_multi-sensor-estimation/00_linearization.tex index b4132f0..bbe4ce4 100644 --- a/electives/amr/parts/03_multi-sensor-estimation/00_linearization.tex +++ b/electives/amr/parts/03_multi-sensor-estimation/00_linearization.tex @@ -3,6 +3,7 @@ $\vec{f}(\vec{x}) \approx \vec{f}(\vec{\overline{x}}) + \mat{J}_{\vec{f}} \big|_{x = \overline{x}}(\vec{x} - \vec{\overline{x}})$, $f'$, no vec in 1D; $\vec{\overline{x}}$ lin. p. \shortdefinition[Jac.] $\mat{J}_{\vec{f}}$ rows for eq of $\vec{f}$; cols for vars of each eq. +It may also be a single value (if just one var in the state) \shortdefinition[Gradient] $\nabla \vec{f}$ is vec, each comp. for par diff of var diff --git a/electives/amr/parts/03_multi-sensor-estimation/01_least-squares.tex b/electives/amr/parts/03_multi-sensor-estimation/01_least-squares.tex index 0a53425..2f3fa4a 100644 --- a/electives/amr/parts/03_multi-sensor-estimation/01_least-squares.tex +++ b/electives/amr/parts/03_multi-sensor-estimation/01_least-squares.tex @@ -1,6 +1,8 @@ \subsection{Linear Least Squares} \bi{Goal}: $\argmin{x \in \R^n} ||\mat{A}\vec{x} - b||^2_2$, $\mat{A}$: rows $i$-th datap. col $c$: $t_i^{c - 1}$. +Alt: compute sum of squared errors $S$, then min. $S$, i.e. solve system $\pardiff{\alpha}S = 0$, $\pardiff{r} S = 0$ for $\{ \alpha, r \}$ the params + \bi{Man. sol.}: comp. $M = A^\top A$, $b' = A^\top b$, then $Mx = b'$. \bi{Prob. sol.}: $\text{argmax} \; \P(\vec{x} \divider \vec{z})$ with Maximum \dots diff --git a/electives/amr/parts/03_multi-sensor-estimation/02_nonlinear-least-squares.tex b/electives/amr/parts/03_multi-sensor-estimation/02_nonlinear-least-squares.tex index e10e7d3..cd57477 100644 --- a/electives/amr/parts/03_multi-sensor-estimation/02_nonlinear-least-squares.tex +++ b/electives/amr/parts/03_multi-sensor-estimation/02_nonlinear-least-squares.tex @@ -21,8 +21,11 @@ def gauss_newton(x: np.ndarray, F, DF, tol=1e-6): \rmvspace[0.4] \bi{Levenberg-Marquardt} -Minimize $||F(x^{(k)}) + DF(x^{(k)})||^2 + \lambda||s||^2$, -with $s = \lambda_k DF(x^{(k)})$, $\lambda_k$ is called the \textit{learning rate} -% TODO: Do we need these? +\bi{(1)} Pick start point $\overline{\vec{x}}^0$ and start param $\lambda^0 = \max \text{diag}(\mat{A})$ and $v$ (e.g. $v = 2$).; +\bi{(2)} Modified GN sys: $\mat{A} + \lambda \text{diag}(\mat{A})) \Delta \vec{x} = \vec{b}$; +\bi{(3)} Solve for $\Delta \vec{x}$; +\bi{(4)} Update: $\overline{\vec{x}}^{k + 1} = \overline{\vec{x}}^k + \Delta \vec{x}$ (if cost reduced), +else: $\overline{\vec{x}}^{k + 1} = \overline{\vec{x}}^k$, $\lambda^{k + 1} = \lambda^k v$, go to step 3; +\bi{(5)} Check convergence, else go to step 2 -\bi{Local Param.} +\bi{Robust Cost Functions} Account for outliers, by mod. err. terms diff --git a/electives/amr/parts/03_multi-sensor-estimation/04_particle-filter.tex b/electives/amr/parts/03_multi-sensor-estimation/04_particle-filter.tex index ff08a3e..6522dff 100644 --- a/electives/amr/parts/03_multi-sensor-estimation/04_particle-filter.tex +++ b/electives/amr/parts/03_multi-sensor-estimation/04_particle-filter.tex @@ -4,5 +4,5 @@ Update step: \begin{itemize} \item Apply Bayes rule $w'_{k, s} = \P[\vec{z}_i \divider \vec{x}_{k, s}] w_{k - 1, s}$ \item Renormalize: $w_{k, s} = w'_{k, s} \div \sum_{s} w'_{k, s}$ - \item Resample: rand. sel. $S$ particles acc. to weights and $w_{k, s} = S^{-1}$ + \item Resample: rand. sel. $S$ particles acc. to weights, $w_{k, s} = S^{-1}$ \end{itemize} diff --git a/electives/amr/parts/03_multi-sensor-estimation/06_extended-kalman-filter.tex b/electives/amr/parts/03_multi-sensor-estimation/06_extended-kalman-filter.tex index 50debe4..329b762 100644 --- a/electives/amr/parts/03_multi-sensor-estimation/06_extended-kalman-filter.tex +++ b/electives/amr/parts/03_multi-sensor-estimation/06_extended-kalman-filter.tex @@ -13,5 +13,5 @@ With $\mat{F}_k = \frac{\partial \vec{f}}{\partial \vec{x}}$ and $\mat{L}_k = \f Difference to KF: $\mat{H}$ becomes $\mat{H}_k$, and $\mat{H}^\top$ is $\mat{H}_k^\top$. They are linearizations of $\vec{h}$, see \ref{sec:temporal-models} -\shortexample D-D Rob, measurements: $\Delta \varphi_l, \varphi_r$, GPS pos, yaw angle. +% \shortexample D-D Rob, measurements: $\Delta \varphi_l, \varphi_r$, GPS pos, yaw angle. % TODO: Finish this?