diff --git a/electives/amr/autonomous-mobile-robots-cheatsheet.pdf b/electives/amr/autonomous-mobile-robots-cheatsheet.pdf index 2ae545d..9bc9682 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/02_Sensors-Actuators/03_cameras.tex b/electives/amr/parts/02_Sensors-Actuators/03_cameras.tex index ccbbfef..70ef6d7 100644 --- a/electives/amr/parts/02_Sensors-Actuators/03_cameras.tex +++ b/electives/amr/parts/02_Sensors-Actuators/03_cameras.tex @@ -12,9 +12,12 @@ with $f$ the distance to the lens and $z$ the full distance \newpage $u = c_u + f \cdot x'$ and $v = c_v + f \cdot y'$ where $x' = t_x \div t_z$ and $y' = t_y \div t_z$ where $u, v$ are the pixel $x, y$ coords, $\vec{c} = [c_u, c_v]^\top$ is optical centre of cam in pixel coords, $f$ scale factor, -and $\vec{{_C}\vec{t}_P} = [t_x, t_y, t_z]^\top$ +% and $\vec{{_C}\vec{t}_P} = [t_x, t_y, t_z]^\top$ -The full proj: $\vec{u} = \begin{bmatrix} +The full proj: +$\vec{u} = + {\scriptsize + \begin{bmatrix} \lambda u \\ \lambda v \\ \lambda @@ -28,23 +31,27 @@ The full proj: $\vec{u} = \begin{bmatrix} \begin{bmatrix} t_x \\t_y\\t_z \end{bmatrix} + } = \mat{K}\; {_C}\vec{t}_P$ -If p. in diff frame ${_W} \vec{t}_P$, then $\vec{u} = \mat{K}[\mat{R}_{CW}\; {_C}\vec{t}_{CW}] = {_W}\vec{t}_P$ +If p. in diff frame ${_W} \vec{t}_P$, then $\vec{u} = \mat{K}[\mat{R}_{CW}\; {_C}\vec{t}_{CW}] {_W}\vec{t}_P$ \subsubsection{Pinhole Camera Projection with distortion} -\shortdefinition Model: $\vec{u} = \vec{k}(\vec{d}(\vec{p}({_C}\vec{t}_P)))$, with: +\shortdefinition Model: $\vec{u} = \vec{k}(\vec{d}(\vec{p}({_C}\vec{t}_P)))$, with ($\vec{c}$ as above): (Projection) $\vec{x'} = \vec{p}({_C}\vec{t}_P) = t_z^{-1} \cdot [t_x, t_y]^\top$ -(Distortion model, $r^2 = x'^2 + y'^2$, $\vec{x''} = \vec{d}(\vec{x'})$\\ +(Distortion model) $r^2 = x'^2 + y'^2$, $\vec{x''} = \vec{d}(\vec{x'})$\\ $\vec{x''} = \! \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} \vec{x'} - + \begin{bmatrix} + + + {\scriptsize + \begin{bmatrix} 2p_1 x' y' + p_2(r^2 + 2x'^2) \\ p_1 (r^2 + 2y'^2) + 2p_2 x'y' - \end{bmatrix}$ + \end{bmatrix} + }$ -(Scale and Centre) $\vec{u} = \vec{k}(\vec{x''}) = \text{diag}([f_u, f_v]) \cdot \vec{x''} + \vec{x}$ +(Scale and Centre) $\vec{u} = \vec{k}(\vec{x''}) = \text{diag}([f_u, f_v]) \cdot \vec{x''} + \vec{c}$ All with $k_i$ radial distortion params, optional for $i > 2$, $p_i$ tang. dist. param, $f_u, f_v$ focal length in pixels diff --git a/electives/amr/parts/02_Sensors-Actuators/04_depth-range.tex b/electives/amr/parts/02_Sensors-Actuators/04_depth-range.tex index 96e0482..9a76fb6 100644 --- a/electives/amr/parts/02_Sensors-Actuators/04_depth-range.tex +++ b/electives/amr/parts/02_Sensors-Actuators/04_depth-range.tex @@ -13,17 +13,23 @@ $z = \frac{b \cdot f}{u_r - u_l}$ with $u_l = f\cdot \frac{x}{z} + c_u$ and $u_r \subsubsection{Time of Flight, Projection} {\color{ForestGreen}No occlusions/shadows}, {\color{red}Interference with other dev, multipath leading to larger distances sensed} -\bi{Proj.} $\vec{z} = \begin{bmatrix} +\bi{Proj.} $\vec{z} = + {\scriptsize + \begin{bmatrix} \vec{u} \\ d \end{bmatrix} = \begin{bmatrix} \vec{k}(\vec{d}(\vec{p}({_C}\vec{t}_P))) \\ [0, 0, 1] {_c}\vec{t}_P - \end{bmatrix}$ + \end{bmatrix} + }$ \bi{Back}: ${_C}\vec{t}_P - = \begin{bmatrix} - d \vec{x'} \\d - \end{bmatrix}$ + = + {\scriptsize + \begin{bmatrix} + d \vec{x'} \\d + \end{bmatrix} + }$ \subsubsection{Range Sensors} 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 915052c..8cfc94e 100644 --- a/electives/amr/parts/03_multi-sensor-estimation/00_linearization.tex +++ b/electives/amr/parts/03_multi-sensor-estimation/00_linearization.tex @@ -3,5 +3,5 @@ $\vec{f}(\vec{x}) \approx \vec{f}(\vec{\overline{x}}) + \mat{J}_{\vec{f}} \big|_ \shortdefinition[Jac.] $\mat{J}_{\vec{f}}$ rows for eq of $\vec{f}$ cols for vars of each eq. -Approximation using finite differences $\frac{f(\overline{x} + h) - f(\overline{x})}{h}$,\\ +Part. diff; Approx. using finite differences $\frac{f(\overline{x} + h) - f(\overline{x})}{h}$,\\ or central differences (vector of $\frac{\vec{f}(\vec{\overline{x}}) + h_i \vec{e_i}}{h_i}$, with $\vec{e_i}$ unit vec) 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 b51d0da..dc99c29 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 @@ -3,8 +3,8 @@ \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 +\bi{Prob. sol.}: $\text{argmax} \; \P(\vec{x} \divider \vec{z})$ with Maximum \dots \begin{itemize} - \item \bi{Max. Like} $p(\vec{x} | \vec{z}) \propto p(\vec{z} | \vec{x}) = \prod_{i = 1}^N p(\vec{z}_i | \vec{x})$ - \item \bi{M a Post} $p(\vec{x} | \vec{z}) \propto p(\vec{z} | \vec{x}) p(\vec{x}) = p(\vec{x}) \prod_{i = 1}^N p(\vec{z}_i | \vec{x})$ + \item \bi{Likelihood} $\P(\vec{x} | \vec{z}) \propto \P(\vec{z} | \vec{x}) = \prod_{i = 1}^N \P(\vec{z}_i | \vec{x})$ + \item \bi{a Post} $\P(\vec{x} | \vec{z}) \propto \P(\vec{z} | \vec{x}) \P(\vec{x}) = \P(\vec{x}) \prod_{i = 1}^N \P(\vec{z}_i | \vec{x})$ \end{itemize} 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 87a3f5f..f082ada 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 @@ -1,5 +1,5 @@ \subsection{Non-Linear Least Squares} -Find $\vec{x}^* = \text{argmax} p(\vec{x} | \vec{z}) = \argmin{}(-\log(p(\vec{x}|\vec{z})))$ +Find $\vec{x}^* = \text{argmax}\; \P(\vec{x} | \vec{z}) = \argmin{}(-\log(\P(\vec{x}|\vec{z})))$ \bi{Gauss-Newton} % TODO: Do we really need these? If so, use from NumCS (much simpler notation) diff --git a/electives/amr/parts/03_multi-sensor-estimation/03_bayes-filters.tex b/electives/amr/parts/03_multi-sensor-estimation/03_bayes-filters.tex index 19e807f..0ea801d 100644 --- a/electives/amr/parts/03_multi-sensor-estimation/03_bayes-filters.tex +++ b/electives/amr/parts/03_multi-sensor-estimation/03_bayes-filters.tex @@ -1,4 +1,4 @@ -\subsection{Bayes Filter} +\subsection{Bayes Filter (in DAG)} $\vec{x}_k^R$ state at time k, $\vec{z}_k^p$ dist. meas., $\vec{u}^p_k$ wheel odometry (= meas.). Typ. care ab. curr. state: altern. pred. \& update. % TODO: Do we really need the below? 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 f5bb87e..0f87c7a 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 @@ -10,3 +10,5 @@ Non-l. state trans. model $\vec{x}_k = \vec{f}(\vec{x}_{k - 1}, \vec{u}_k, \vec{ \item \bi{Meas. residual}: $\vec{y}_k = \tilde{\vec{z}}_k - \vec{h}(\hat{\vec{x}}_{k | k - 1})$ \end{itemize} Difference to above: $\mat{H}$ becomes $\mat{H}_k$, and $\mat{H}^\top$ is $\mat{H}_k^\top$ + +% TODO: Consider adding examples diff --git a/electives/amr/parts/04_vision/00_keypoints.tex b/electives/amr/parts/04_vision/00_keypoints.tex index 1b6d956..690460a 100644 --- a/electives/amr/parts/04_vision/00_keypoints.tex +++ b/electives/amr/parts/04_vision/00_keypoints.tex @@ -1,11 +1,14 @@ \subsection{Keypoints} -\bi{Corner det.} $SSD(\Delta_x, \Delta_y) \approx [\Delta_x \; \Delta_y] \mat{M} [\Delta_x \; \Delta_y]^\top$ -with $\mat{M} = \mat{R}^\top \text{diag}(\lambda_1, \lambda_2) \mat{R}$; $\lambda_i$ E.V. of $M$; -$\mat{R} = \det(M) - \kappa \cdot \text{trace}(M)^2 = \lambda_1\lambda_2 - \kappa(\lambda_1 + \lambda_2)^2$; -$\displaystyle M = \sum_{x, y \in P} \begin{bmatrix} - I_x^2 & I_x I_y \\ - I_x I_y & I_y^2 - \end{bmatrix}$ +\bi{Corner det.} $SSD(\Delta x, \Delta y) \approx [\Delta_x \; \Delta_y] \mat{M} [\Delta_x \; \Delta_y]^\top$ +with $\mat{M} = \mat{R}^\top \text{diag}(\lambda_1, \lambda_2) \mat{R}$; $\lambda_i$ E.V. of $M$; $\kappa$ const 0.04-0.15; +$\mat{R} = \det(M) - \kappa \cdot \text{TR}(M)^2 = \lambda_1\lambda_2 - \kappa(\lambda_1 + \lambda_2)^2$;\\ +$M = \sum_{x, y \in P} + {\scriptsize + \begin{bmatrix} + I_x^2 & I_x I_y \\ + I_x I_y & I_y^2 + \end{bmatrix} + }$ \shade{gray}{Blob Detection} ($I$ is the image) diff --git a/electives/amr/parts/04_vision/01_bootstrapping.tex b/electives/amr/parts/04_vision/01_bootstrapping.tex index 16d17e7..0207a00 100644 --- a/electives/amr/parts/04_vision/01_bootstrapping.tex +++ b/electives/amr/parts/04_vision/01_bootstrapping.tex @@ -1,9 +1,11 @@ \subsection{Bootstrapping} -\bi{PnP Problem} {\scriptsize Persp. n-P.} +\bi{PnP Problem} {\scriptsize Persp. $n$-P.} Find sol. for camera pose \textit{directly} \bi{RANSAC} {\scriptsize RANdom SAmpling Consensus} for find. outliers \& correct +% TODO: Do we need to know this algorithm / be able to implement it? +% -> likely not \bi{Stereo Triang.} Given two rays (known poses for points in 2D). Find good point in 3D. Fast sol: \bi{Midpoint Method}: @@ -16,15 +18,22 @@ Find good point in 3D. Fast sol: \bi{Midpoint Method}: \rmvspace \bi{2} Solve normal equation $\mat{A} \vec{\lambda} = \vec{b}$ with $\vec{q} = -{_W}\vec{e}^\top_1 {_W}\vec{e}_2$: \[ - \mat{A} = \begin{bmatrix} + \mat{A} = + {\scriptsize + \begin{bmatrix} 1 & \vec{q} \\ \vec{q} & 1 \end{bmatrix} + } \quad - \vec{b} = \begin{bmatrix} + \vec{b} = + {\scriptsize + \begin{bmatrix} \vec{e}_1^\top \cdot ({_W}\vec{t}_{C_2} - {_W}\vec{t}_{C_1}) \\ -\vec{e}_2^\top \cdot ({_W}\vec{t}_{C_2} - {_W}\vec{t}_{C_1}) \end{bmatrix} + } + \quad C_i \text{ cam} \] \bi{3} Pick midp. ${_W}\vec{t}_P \! = \! 0.5(\tau_1 \! + \! \tau_2)$; $\tau_n \! = \! {_W}\vec{t}_{C_n} + \lambda_n{_W}\vec{e}_n)$