## 3 Our Approach to Estimation of Robot Pose and Pipe Diameter (EPD)
### Analysis of Residual Symmetry in RU-EPD  
To address the limitations of the C-EPD scheme caused by the asymmetry of the canonical ellipse residual function, we propose the RU-EPD scheme. This approach introduces a novel error-based residual function that ensures unbiased and accurate estimation under random depth errors. The proposed residual function evaluates the projected depth error in the \(YZ\)-plane of the PCS. Unlike the canonical approach, which indirectly measures deviations from the ellipse model, this function directly estimates the depth error itself, eliminating asymmetry. Figure 3 illustrates the proposed residual function based on the distance between the measurement point \(\mathbf{\hat{x}}_{i,P}\) and its ground truth \(\mathbf{x}_{i,P}\) in the \(YZ\)-plane. The proposed residual function captures the difference in radial distances from the sensor origin \(\mathbf{x}_{0,P}\) to the measured point \(\mathbf{\hat{x}}_{i,P}\) and the intersection point \(\mathbf{x}_{i,P}\). This formulation assigns negative values to negative-error points and positive values to positive-error points, inherently preserving the signed depth error and eliminating the estimation bias present in the C-EPD scheme. Then, the error-based residual function is formally defined as follows:  
\[r_{d}(\mathbf{\hat{x}}_{i,P},\mathbf{\beta})=\sqrt{(\hat{y}_{i,P}-y_{0,P})^{2}+(\hat{ z}_{i,P}-z_{0,P})^{2}}-\sqrt{(y_{i,P}-y_{0,P})^{2}+(z_{i,P}-z_{0,P})^{2}}. \tag{20}\]  
The intersection point \(\mathbf{\hat{x}}_{i,P}\) is computed as the point where the ellipse model intersects the sensing line passing through the sensor origin \(\mathbf{x}_{0,P}\) and the measurement point \(\mathbf{\hat{x}}_{i,P}\). The parametric equation for this line is given by  
\[\hat{y}_{P}=y_{0,P}+t(\hat{y}_{i,P}-y_{0,P}),\text{ and }\hat{z}_{P}=z_{0,P}+t( \hat{z}_{i,P}-z_{0,P}). \tag{21}\]Substituting \(\hat{y}_{P}\) and \(\hat{z}_{P}\) into the ellipse Equation (5) yields a quadratic equation in \(t\). The solution is given by  
\[t= \frac{\sqrt{A-\frac{(z_{0,P}\hat{y}_{i,P}-y_{0,P}\hat{z}_{i,P})^{2}} {(D_{\max}/2)^{2}(D_{\min}/2)^{2}}}-\left(\frac{y_{0,P}(\hat{y}_{i,P}-y_{0,P})}{( D_{\max}/2)^{2}}+\frac{z_{0,P}(\hat{z}_{i,P}-z_{0,P})}{(D_{\min}/2)^{2}} \right)}{A}, \tag{22}\] \[\text{where }A=\frac{(\hat{y}_{i,P}-y_{0,P})^{2}}{(D_{\max}/2)^{2}}+ \frac{(\hat{z}_{i,P}-z_{0,P})^{2}}{(D_{\min}/2)^{2}}.\]  
By substituting the line equation in (21) into (20), the error-based residual function \(r_{d}\) is further simplified as follows:  
\[r_{d}(\hat{x}_{i,S},\mathbf{\beta})=(1-t)\sqrt{(\hat{y}_{i,P}-y_{0,P})^{2}+(\hat{ z}_{i,P}-z_{0,P})^{2}}. \tag{23}\]  
Finally, the optimal RU-EPD parameters \(\mathbf{\beta}_{RU-EPD}^{*}\) are obtained by minimizing the following objective function:  
\[\mathbf{\beta}_{RU-EPD}^{*}=\arg\min_{\
u\mathbf{\beta}}\sum_{i=1}^{N}r_{d}^{2}(\hat{ x}_{i,P},\mathbf{\beta}). \tag{24}\]  
Unlike the canonical approach, the residual function \(r_{d}\) is inherently symmetric with respect to random depth errors. If the diameter components of \(\mathbf{\beta}\) match the ground truths, the intersection point \(\hat{x}_{i,P}\) coincides with the ground-truth point \(x_{i,P}\). In this case, \(r_{d}\) directly reflects the true random depth error magnitude in the \(YZ\)-plane, preserving the signed nature of the errors. As a result, \(r_{d}\) eliminates the estimation bias issue observed in the canonical residual function. Theorem 2 formally establishes that the ground-truth diameters \(D_{\max}\) and \(D_{\min}\) minimize the cost function when using the error-based residual function \(r_{d}\). **Theorem 2** (Unbiased Diameter Estimation with Error-based Residual Function). : _With zero-mean Gaussian random depth errors and the error-based residual function, the ground-truth diameters \(D_{\max}\) and \(D_{\min}\) minimize the cost function._  
Proof.