# Field Navigation Using Fuzzy Elevation Maps Built with Local 3D Laser Scans
## 5 Building FEMs and FRMs  
This section describes the computation of an FEM and its FRM from a filtered 3D point cloud. Instead of using the adaptive neuro-fuzzy inference system (ANFIS) for identification [16; 18; 19], least squares fuzzy modeling [29] has been employed to improve computation time. Additionally, cylindrical coordinates \((\alpha,r,z)\) have been employed instead of Cartesian coordinates \((x,y,z)\). It is assumed that the ground surface around the robot can be represented as a continuous function \(z=H(\alpha,r)\), where the angle \(\alpha=\arctan(y/x)\) and the distance \(r=\sqrt{x^{2}+y^{2}}\) describe the projection of a 3D point on the \(X_{p}Y_{p}\) plane. Similarly, an FRM is defined as a continuous function \(v=V(\alpha,r)\), where values of \(v\) close to one and zero, represent the maximum and minimum reliability values for the FEM, respectively. The FEM and FRM are defined in the universe \(U_{\alpha}=[0^{\circ},360^{\circ}]\) for variable \(\alpha\), and \(U_{r}=[0\,m,d_{max}]\) for \(r\), which corresponds to a circle centered at the origin of \(X_{p}Y_{p}\). A total of sixteen fuzzy sets for \(\alpha\) have been defined evenly-distributed over \(U_{\alpha}\) (see Figure 9). In this case, triangular membership functions \(\mu_{i}\) for \(i=1,2,\ldots,16\) are defined as:  
\[\mu_{i}(\alpha)=\left\{ \begin{array}{ll}\frac{\alpha-\alpha^{i-1}}{\alpha^{ i}-\alpha^{i-1}},&\text{if }\alpha^{i-1}\leq\alpha<\alpha^{i},\\ \frac{\alpha^{i+1}-\alpha}{\alpha^{i+1}-\alpha^{i}},&\text{if }\alpha^{i}\leq \alpha<\alpha^{i+1},\\ 0,&\text{otherwise},\end{array} \right. \tag{1}\]  
where \(\alpha^{i}=(i-1)22.5^{\circ}\) represent the peak values, i.e., \(\mu_{i}(\alpha^{i})=1\). For distance \(r\), ten uneven-distributed fuzzy sets have been defined over \(U_{r}\) to provide higher detail for regions closest to the robot (see Figure 9). Concretely, peak parameter \(r^{j}\) for \(j=1,2,\ldots 10\) are computed as:  
\[r^{j}=\left(\frac{\tau^{j}-1}{\tau^{10}-1}\right)\left(d_{max}-\frac{h}{2} \right)-\frac{h}{2}, \tag{2}\]  
where \(\tau=1.0624\) is an expansion ratio that fulfills that \(r^{1}=h/2\). Then, the membership functions \(\mu_{j}\) for \(r\) are defined  
The combined membership for both variables \(\mu_{i,j}\) is calculated with the product operator for a given 3D point:  
\[\mu_{i,j}(\alpha,r)=\mu_{i}(\alpha)\,\mu_{j}(r), \tag{4}\]  
where the following condition is satisfied:  
\[\sum_{\forall i,j}\mu_{i,j}(\alpha,r)=1. \tag{5}\]  
Let \(m\) be a row vector that contains all the possible memberships:  
\[m(\alpha,r)=\left(\mu_{1,1}(\alpha,r),\,\mu_{1,2}(\alpha,r),\ldots,\,\mu_{16, 10}(\alpha,r)\right), \tag{6}\]  
where most of its 160 elements are null. Non null elements correspond to the regions where the projection of the 3D point falls on the \(X_{p}Y_{p}\) plane and its nearby regions (see Figure 10). Using zero-order Sugeno consequents for the rule that relates the fuzzy set \(i\) for \(\alpha\) and the fuzzy set \(j\) for \(r\) requires just one parameter \(z_{i,j}\) for the FEM, and another \(v_{i,j}\) for the FRM. Let \(\theta_{z}\) and \(\theta_{v}\) be the column vectors that contains all the unknown parameters:  
\[\theta_{z}=\left( \begin{array}{c}z_{1,1}\\ z_{1,2}\\ \vdots\\ z_{16,10}\end{array} \right),\quad\theta_{v}=\left( \begin{array}{c}v_{1,1}\\ v_{1,2}\\ \vdots\\ v_{16,10}\end{array} \right). \tag{7}\]  
Given the algebraic equations: \(z=m(\alpha,r)\,\theta_{z}\) and \(1=m(\alpha,r)\,\theta_{v}\) for the FEM and the FRM, respectively, the least-squares method finds the parameters \(\theta_{z}\) and \(\theta_{v}\), respectively, that minimizes the sum of the squares of the residuals: \(z-m(\alpha,r)\,\theta_{z}\) and \(1-m(\alpha,r)\,\theta_{v}\), respectively, made in the results of every 3D point in cylindrical coordinates \((\alpha,r,z)\). For model training, the recursive least squares technique has been employed in the Map node.