From 5c6241616eeea50f45dcbd17711af402bdeb72bc Mon Sep 17 00:00:00 2001 From: Henry Moore Date: Fri, 1 Nov 2024 17:20:35 +0000 Subject: [PATCH 1/3] switch to using inline LaTeX instead of images --- doc/Constraints.md | 14 +++++++++----- doc/constraints-generic_cost_equation.gif | Bin 2292 -> 0 bytes doc/constraints-least_squares_equation.gif | Bin 1706 -> 0 bytes doc/constraints-observation_model_equation.gif | Bin 3525 -> 0 bytes doc/constraints-pose_2d_prior_equation.gif | Bin 4202 -> 0 bytes ...nstraints-state_transition_model_equation.gif | Bin 3039 -> 0 bytes 6 files changed, 9 insertions(+), 5 deletions(-) delete mode 100644 doc/constraints-generic_cost_equation.gif delete mode 100644 doc/constraints-least_squares_equation.gif delete mode 100644 doc/constraints-observation_model_equation.gif delete mode 100644 doc/constraints-pose_2d_prior_equation.gif delete mode 100644 doc/constraints-state_transition_model_equation.gif diff --git a/doc/Constraints.md b/doc/Constraints.md index 77bbdbec3..9ea083cbd 100644 --- a/doc/Constraints.md +++ b/doc/Constraints.md @@ -15,7 +15,7 @@ documentation is highly recommended. The nonlinear least-squares system used by the Ceres Solver is written as: -![least squares equation](constraints-least_squares_equation.gif) +$$ \mathrm{arg\ min}_{x} \left(\frac{1}{2} \sum_i \rho_i \left(||f(x_{i_1},...,x_{i_k})||^2\right)\right)$$ In Ceres Solver parlance, ρ() is called a "loss function". f() is called a "cost function", which accepts one or more inputs, x. And the inputs, x, are called "parameter blocks". The "parameter blocks" themselves may be @@ -43,7 +43,8 @@ The "cost function" is the main component of the Constraint object. It is respon minimized by the Ceres Solver optimizer. The cost function must implement some sort of equation to generate a score for arbitrary input values. In its most generic form, that equation is written simply as: -![generic cost equation](constraints-generic_cost_equation.gif) +$$ \begin{bmatrix} r_1 \\ ... \\ r_i\end{bmatrix} = f\left(\begin{bmatrix}x_{1_1} \\ ... \\ x_{1_j}\end{bmatrix}, ..., \begin{bmatrix}x_{n_1} \\ ... \\ x_{n_k}\end{bmatrix}\right)$$ + where f() is the cost function, x1 through xn are the input Variables, each of which may contain multi-dimensional data, and ri are one or more dimensions of the computed costs. In Ceres Solver notation, @@ -58,7 +59,7 @@ An observation model, sometimes called a sensor model, predicts a sensor measure of the system Variables. The cost is then computed as the difference between the predicted sensor measurement and the actual sensor measurement, normalized by the measurement uncertainty. -![observation model equation](constraints-observation_model_equation.gif) +$$ \begin{bmatrix} r_1 \\ ... \\ r_i\end{bmatrix} = \left(\begin{bmatrix}z_1 \\ ... \\ z_i\end{bmatrix} - h\left(\begin{bmatrix}x_{1_1} \\ ... \\ x_{1_j}\end{bmatrix}, ..., \begin{bmatrix}x_{n_1} \\ ... \\ x_{n_k}\end{bmatrix}\right)\right) \cdot \Sigma ^{-\frac{1}{2}}$$ where z is the sensor measured, h() is the sensor prediction function, and Σ is the covariance matrix. Within the least-squares minimization, the entire cost function will get squared. By dividing by the square root of the @@ -72,7 +73,7 @@ A state transition model, sometimes called a motion model, predicts the value of current estimates of the system Variables. This is generally used to enforce a physical model of the system, such as known vehicle kinematics. -![state transition model equation](constraints-state_transition_model_equation.gif) +$$ \begin{bmatrix} r_1 \\ ... \\ r_i\end{bmatrix} = \left(\begin{bmatrix}x_{t_1} \\ ... \\ x_{t_i}\end{bmatrix} - f\left(\begin{bmatrix}x_{{t-1}_1} \\ ... \\ x_{{t-1}_i}\end{bmatrix}\right)\right) \cdot \Sigma ^{-\frac{1}{2}}$$ where xt is the current Variable estimate for time _t_, xt-1 is the current Variable estimate for time _t-1_, f() is the state prediction function that implements the desired kinematic or dynamic model @@ -245,7 +246,10 @@ modeled this way. Our cost function will follow the "observation model", where t predict the sensor measurement, and the cost will be the different between the measured and the prediction normalized by the measurement uncertainty. -![2D pose prior cost equation](constraints-pose_2d_prior_equation.gif) +$$ \begin{bmatrix} \mathrm{cost}_1 \\ \mathrm{cost}_2 \\ \mathrm{cost}_3\end{bmatrix} += \left(\begin{bmatrix}z_x \\ z_y \\ z_{yaw}\end{bmatrix} +- \begin{bmatrix}position_x \\ position_y \\ orientation_{yaw}\end{bmatrix}\right) +\cdot \Sigma ^{-\frac{1}{2}}$$ We will make use of Ceres Solver's automatic derivative system to compute the Jacobians. For that to work, we must implement the cost function equation as a functor object (has an `operator()` method). To compute the cost, our diff --git a/doc/constraints-generic_cost_equation.gif b/doc/constraints-generic_cost_equation.gif deleted file mode 100644 index 9fc2ac5241300585d9ea61bc8ee16b30190f601d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2292 zcmV1hJf!z+?~s5V^X-$)nNGC=18{zk$@zM+CUe zwcFg6vfl-)~5CIst0stQ@F$Dg{Nt}3MBp{P<2tGihsoVk+#7->O7$YUe z6^D3|bG5~xiJfG8Mw2+8s1E>0W1d5?OhL^RCk0rI0bz*>r9W8&xFNCG34AiT76A*a zEDE%QQVLKvG={Z|00t;HpCBD~vNey`3LlCCU!S;gEZ!*B&P zw;L-3C~#2$33yUqdWC^li$N2bm=}srz(T+l3=ok378u?(LL#bpXq$q7In*I`W2^`O z1TE@E9B-A3_8yZx5(z*HKLlACe!)074tG%2C5Dnz4jG=9Mht-1NKlYuM0t5|Mp}>370UF|QBQgQ0q*FF& zsVB>E>1){GU~F`rKJV-ca=U}}D?t`e)Pyn!`>4!7FiVls#5h9n*kFhIaY zzoODB4aFX-Q4uXzwQQAV{>s2zWW%nKY$?+wMcrqBbZcj|G4OYtFM`hE<%{XIcBg!2 zh-)UfDzt!Lwy13TiM$L^hfgv5o=Wc}`UMQ%y0*3}*`3RbWpJefr!WGhnVM6pvI?tv zXR4uO>?^{(q>9%^`GU-?$H_4kfB_HF8gWY_P+GCJChvUqK; zBH~+$zLfC%F`y$Pz%$aCs*@89_!K>J$v)fcD%0~lU9%Vu47NZbGjOLWtT*?Yb<$}M zRPaMyug%15W*?#Sxa8hVEv#_2Jufg0$vlI6XQSH-)Qsr;Y!S>A5I5k)2Ef2SHpnNe z(Vrk*h~jty(Ly@@ek+>HY(VgL`PD~%4GHIe2O;_6H#9)N?6lWDy8{%*K)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o;T%)keLjIwf}n=7isjE73s8#+ zFXDoPao~s&z)t=MfKveAEbw>i#03h@fy5PjKq}pE-w6_MoI6560P7h*o)+-IRB`~4QNUl>{8tNCj-W;v2;3_3 zVnY^G(lA^oKq--s83V}h1=z}fGA?I;YFhJ}iBLoW8si9}^k9F;e8Tpeur%nk-~cT| zNvYP!2XKb-ok=J}A|)Bh{MhrJ_{=9hg$U1nI)NNTbRQx8Nzh5WZbfwzL1XS$(1uQe z0HXi}4P9sh1c^k)p%~4m03d`sM#67{H7C}2sE%G4vgu&Gc@Y80aihzI}xJ1LpX AlmGw# diff --git a/doc/constraints-observation_model_equation.gif b/doc/constraints-observation_model_equation.gif deleted file mode 100644 index 25a37d3128ab8faf18571687cfeca29940eae9b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3525 zcmV;$4Lb5iNk%w1VbB3k0K@&t2-7j`b#tI09bUJrbsM7&yxm(AH2E}Ix89}5Xkr@GZ$l!^?m@&o2g4g~kuG^@oBLD^hj=(HQtDXS`3>GX<;D(6H zUkL_Q6NzGh0|5Lf01HT>U>s_cXlP+e6;R-FYev(9R}5f7)nYTCUv|08v)>OaG5%mjHum8cT!H2JcY=cHiPivw7n1iLUNL|t0|O3@ z1|cL22!)`30ImQcff{~OqF++o5#oe1vZxtL%T;ItMR)BOK#v>N5*CFY)~FpM0kC(X z3~8iL%8E?2=uMLS(LhmDhd}wmk-uzoB?|L70T=<66+vcZK|0}2jz!w|jX?ZWxk6S- zNv36fLBc7g3JH9nK$*OuaOZ`C5Aejw-U05Sw0bH7<3Dq^8@6c`Q!1Vq|E18=1u>Iqy@Q$TK~3N`B&5jZ$#r*1k`D?zsckn0H$L|};m zY4JLjYXSjDL$jL}(I`6R{^b*@kt1$W=8`HrMu4u^k_wCnXzDq@Z=0cdh!hHayaX zytj9BLbmTB`r^YAe>=z_XKF+XQfGd%FsVE7=YmFzf`=%7Y$aG(T^&AT7Qd zpZla!miyh}c%fh)ZlV*E1KOa2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}Qst zy#X1fR|F4ebvV_6oe&wr$8?qU1LU=Vudo!IaRb(J8>|;5G3X}ZHNuGA{x^Ea5PqO2S*T}rttdSZ0f_;k0M=%P zHc%p<2N6v&8uUSnZAcTiC~{xY8&yMxf!KR0FpTr{6pjKZl46Vx(tIK!jfDphY@&Mx zFi4F^3^ccbi2@Ij!f4ufifPh~wT38)asq)uBhZM7eBvj7k^{wZEWu}m-2#R&a3Sgy zhVfy4Lh}H%ScjW6Z?%Rhs=_Ksu?+zEi!|{71ZiLjA%2!IEXA0AtY(W-@GBCDE5vax z`7#6%aDtPk1VhGSme_;gu~^11lHNcT(Zd!k_${O1V;BhtE;(oOqAu*>G(iV{qp=$F zvXdgxF)Z*)F0pXZf{*vNI*lSU*bFe`Q&X$)iRPP?ZA76jH-DYRQ(zNKKleL3i>fqV$wX=LBGrC}Lv*2H+?IKw%wW zgGu>{Xz2v(Qig4biNC}+i^-5q5fovRJ8&a6ia`)ov5k=@K8^!9kx&2x5sPZ}$pC%U3(5&{4_xGE_Y diff --git a/doc/constraints-pose_2d_prior_equation.gif b/doc/constraints-pose_2d_prior_equation.gif deleted file mode 100644 index 54e432c27b1dce8920fc27614aa3302a160ac819..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4202 zcmaKl_dnH(2|LQdi&4{Rh6!A6`E_Uymo{oP~j*=N!lu7z2P`zkUG#fJUQRT3T>8 zoS&cH^z^ixoLopqNJ&Wvi^Y2R@?}(16qQPS@ZiDw_wPw0lD4)s7K_c#&zF>x{NMNg zNA5cm^q-;r-~87EV8?89#v7o*zojjB7c6v6=|;#aH6KpR$r7%I+GZ^>yS0js6>M~S z#y=B(xT2w(G{Lu9Dyp*z^zU#kwcRc6!FOlf z>$m3PQ|(e79kv`)E6$yK*vAwAJvDgJj~0rX?O$LH{bf7%eBEYM1zrF4)k``GOxdcL z6IfaQl(4o-`S8Q`5WtEbERbbn5&RqcR5G!A;2N+iuHX-mBm44R)S*XrOp`>AD1zM( zl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_uclnHtaU*mi^v+Up`WR`n2V!e1!cS1AQSN}k%!Sf# zHx^^Z#JV-iyL&oxG7Dl(LTi^I?oW+jU~7^FeeOm<)m@+D*N1`6&&r)RJxETT#?+m_ zAks>-XmVdqyy>a5zT(N;_|vQ&lDNQ#1fBIJ8@iKIR!+w(meL&BomRN|vgoenQ{M84 z`W2%@+M~=Xep53)=rY4$c5A>f#^A4nU+0gs#*!_Zq x>4S0PJYPfH6nueKpInNlKCCaABW7_1)Mp3miGv%v{r&Vof7gLaB4EJy{{S3(LMH$K diff --git a/doc/constraints-state_transition_model_equation.gif b/doc/constraints-state_transition_model_equation.gif deleted file mode 100644 index f8dd22c0d772b52c28cb919c49b710c8ea3f747f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3039 zcmV<53n27INk%w1VTJ)u0K@X1`REWa?X?G1MJZ9f>fy_0Z z)9ifF4F{j;dPH_&crkoNhk=TU0tJc@g^NuC0a-DPk|~gCnTnK_E0~>In{b>q0;i*^ zsE&c9tTqv;G@_lbv23%dD7LvoxGR(kM#I0ym#%uj$SDsFHNKL}%}3AC%GEQ}&IH!p z+Q`yt+{h3C5ZJ5b;WX#zwb|`ckueMPHut>qi{oAFzX(86Hwqv>6#`owTw#!bfFlkU zuJUI<0fPk#6qo^quUP_g3S%fpz`#JpjZOXxO8f{fo{W(tPs%IUQH6m34UF8(DKV43 zoCO@@qy%VN&0_)v5>&y{02lxti5*e7FzJtZxbk0uv9wE!ano zEh|cHPmCKt=BA0YPN?#Odvzw=tW5BBJ(}X20wadW_M0hHz~LAWd@v*&s|As9EkFLF zEYWh`6`2FDiF}2#+=oU4pjKRV=81bn0Sr*!;PK?Roo+I?>>34wH!BtZmt~rtZr(J0 z+Z$eEcJ0!*8x%(&9XD&_F*M6yV7qNN1|UDf>5d{n@7vc?fN#0<68RJ6jc|wlY;tzoG?eCqSmm~qK7Lq;T0scS-1CrG+U^oR9(H{W!w6tJ@Hq2LqUIc(uM2BPT z*F=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1 Nov 2024 17:20:45 +0000 Subject: [PATCH 2/3] remove dead link --- doc/Variables.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/Variables.md b/doc/Variables.md index 6a9a09219..8e518a1f0 100644 --- a/doc/Variables.md +++ b/doc/Variables.md @@ -47,8 +47,6 @@ places where most of the dimensions are unused. However, including too few physi also leads to inefficient and cumbersome usage when even the simplest of observation models involve many variables. This is one of those "Goldilocks principle" situations. -![Goldilocks principle](http://home.netcom.com/~swansont_2/goldilocks.jpg) - Understanding how Variable interact with the rest of the system will help in the design of "good" Variable. * The fuse stack is designed to combine observations _of the same variable identity_ from multiple sources. As From 5bde0be5d2b8a2640fd8ab039f31e189acb1eec6 Mon Sep 17 00:00:00 2001 From: Henry Moore Date: Fri, 1 Nov 2024 17:52:18 +0000 Subject: [PATCH 3/3] switch to using math mode instead of $$ --- doc/Constraints.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/doc/Constraints.md b/doc/Constraints.md index 9ea083cbd..74662726c 100644 --- a/doc/Constraints.md +++ b/doc/Constraints.md @@ -15,7 +15,9 @@ documentation is highly recommended. The nonlinear least-squares system used by the Ceres Solver is written as: -$$ \mathrm{arg\ min}_{x} \left(\frac{1}{2} \sum_i \rho_i \left(||f(x_{i_1},...,x_{i_k})||^2\right)\right)$$ +```math +\mathrm{arg\ min}_{x} \left(\frac{1}{2} \sum_i \rho_i \left(||f(x_{i_1},...,x_{i_k})||^2\right)\right) +``` In Ceres Solver parlance, ρ() is called a "loss function". f() is called a "cost function", which accepts one or more inputs, x. And the inputs, x, are called "parameter blocks". The "parameter blocks" themselves may be @@ -43,7 +45,9 @@ The "cost function" is the main component of the Constraint object. It is respon minimized by the Ceres Solver optimizer. The cost function must implement some sort of equation to generate a score for arbitrary input values. In its most generic form, that equation is written simply as: -$$ \begin{bmatrix} r_1 \\ ... \\ r_i\end{bmatrix} = f\left(\begin{bmatrix}x_{1_1} \\ ... \\ x_{1_j}\end{bmatrix}, ..., \begin{bmatrix}x_{n_1} \\ ... \\ x_{n_k}\end{bmatrix}\right)$$ +```math +\begin{bmatrix} r_1 \\ ... \\ r_i\end{bmatrix} = f\left(\begin{bmatrix}x_{1_1} \\ ... \\ x_{1_j}\end{bmatrix}, ..., \begin{bmatrix}x_{n_1} \\ ... \\ x_{n_k}\end{bmatrix}\right) +``` where f() is the cost function, x1 through xn are the input Variables, each of which may contain @@ -59,7 +63,9 @@ An observation model, sometimes called a sensor model, predicts a sensor measure of the system Variables. The cost is then computed as the difference between the predicted sensor measurement and the actual sensor measurement, normalized by the measurement uncertainty. -$$ \begin{bmatrix} r_1 \\ ... \\ r_i\end{bmatrix} = \left(\begin{bmatrix}z_1 \\ ... \\ z_i\end{bmatrix} - h\left(\begin{bmatrix}x_{1_1} \\ ... \\ x_{1_j}\end{bmatrix}, ..., \begin{bmatrix}x_{n_1} \\ ... \\ x_{n_k}\end{bmatrix}\right)\right) \cdot \Sigma ^{-\frac{1}{2}}$$ +```math +\begin{bmatrix} r_1 \\ ... \\ r_i\end{bmatrix} = \left(\begin{bmatrix}z_1 \\ ... \\ z_i\end{bmatrix} - h\left(\begin{bmatrix}x_{1_1} \\ ... \\ x_{1_j}\end{bmatrix}, ..., \begin{bmatrix}x_{n_1} \\ ... \\ x_{n_k}\end{bmatrix}\right)\right) \cdot \Sigma ^{-\frac{1}{2}} +``` where z is the sensor measured, h() is the sensor prediction function, and Σ is the covariance matrix. Within the least-squares minimization, the entire cost function will get squared. By dividing by the square root of the @@ -73,7 +79,9 @@ A state transition model, sometimes called a motion model, predicts the value of current estimates of the system Variables. This is generally used to enforce a physical model of the system, such as known vehicle kinematics. -$$ \begin{bmatrix} r_1 \\ ... \\ r_i\end{bmatrix} = \left(\begin{bmatrix}x_{t_1} \\ ... \\ x_{t_i}\end{bmatrix} - f\left(\begin{bmatrix}x_{{t-1}_1} \\ ... \\ x_{{t-1}_i}\end{bmatrix}\right)\right) \cdot \Sigma ^{-\frac{1}{2}}$$ +```math +\begin{bmatrix} r_1 \\ ... \\ r_i\end{bmatrix} = \left(\begin{bmatrix}x_{t_1} \\ ... \\ x_{t_i}\end{bmatrix} - f\left(\begin{bmatrix}x_{{t-1}_1} \\ ... \\ x_{{t-1}_i}\end{bmatrix}\right)\right) \cdot \Sigma ^{-\frac{1}{2}} +``` where xt is the current Variable estimate for time _t_, xt-1 is the current Variable estimate for time _t-1_, f() is the state prediction function that implements the desired kinematic or dynamic model @@ -246,10 +254,12 @@ modeled this way. Our cost function will follow the "observation model", where t predict the sensor measurement, and the cost will be the different between the measured and the prediction normalized by the measurement uncertainty. -$$ \begin{bmatrix} \mathrm{cost}_1 \\ \mathrm{cost}_2 \\ \mathrm{cost}_3\end{bmatrix} +```math +\begin{bmatrix} \mathrm{cost}_1 \\ \mathrm{cost}_2 \\ \mathrm{cost}_3\end{bmatrix} = \left(\begin{bmatrix}z_x \\ z_y \\ z_{yaw}\end{bmatrix} - \begin{bmatrix}position_x \\ position_y \\ orientation_{yaw}\end{bmatrix}\right) -\cdot \Sigma ^{-\frac{1}{2}}$$ +\cdot \Sigma ^{-\frac{1}{2}} +``` We will make use of Ceres Solver's automatic derivative system to compute the Jacobians. For that to work, we must implement the cost function equation as a functor object (has an `operator()` method). To compute the cost, our