# Kinesthetic Learning Based on Fast Marching Square Method for Manipulation
## 3 Learning Manipulation Trajectories via Fast Marching Square
### Important Parameters: Saturation and Area of Influence  
In the FML method, there are two parameters derived from Fast Marching that are essential for the correct behavior of the algorithm, which are saturation and area of influence.  
Saturation (_sat_) represents the propagation velocity of FM\({}^{2}\). Saturation in FML is used to indicate the places with previous experience or auto-learned experience. Therefore, places that have previous experience will be reached earlier. If the saturation value is really low, the method will only use the experience provided for the kinesthetic data. On the contrary, if the value is very high, the method will encourage the exploration of the environment by not following exactly learned values.  
The area of influence (_aoi_) allows to estimate the dilation of the path points in order to give connectivity to the demonstrations and its spatial surroundings. In two-dimensional environments, the area of influence is in pixels (px) and in three dimensions it is measured in voxels (vx). This parameter affects the learning generalization. When an excessively low value is given, the algorithm will not generalize and it will strictly follow the taught trajectories. In the opposite case, the reproductions will excessively generalize and the demonstrations shapes will be lost. Normally, this parameter usually follows a morphologically flat structural element based on a disc, which allows the dilatation processes to be carried out according to the value of the selected _aoi_, as shown in Figure 12.  
Figure 11: Example of auto-learned and non-auto-learned process for different paths. Red point indicates the initial point and red star indicates final point. (**a**) Kinesthetically captured data; (**b**) dilation of the learned data using _aoi_ value; (**c**) path (green line) with \(\kappa~{}=~{}0.732\) is not auto-learned; (**d**) path (green line) with \(\kappa~{}=~{}0.157\) is auto-learned; AND (**e**) dilation of the new auto-learned path including it in the previous learned space.  
In the proposed case, where we are working in three dimensions, both for the FML process and for the cases where auto-learning is necessary, a multidimensional structure has to be applied (in this case in three dimensions). When working with 2-dimensional elements, as shown in Figure 12, it may happen that areas that have been auto-learned do not appear as traversable areas for the algorithm. This is due to path orientation changes. If the path is totally parallel to the base where we are taking data, the disc will be dilating parallel to the ground. Therefore, non-passable areas between auto-learned zones are created due to the lack of the third dimension (height) of the structure, obtaining a result in which a totally unconnected path is obtained. An example of this can be seen in Figure 13 where the result of the same auto-learning is compared using a typical 2-dimensional structure (disc) and a 3-dimensional structure (sphere).  
It can also be seen that the use of 3D structures does not only improve the regions that are parallel to the ground, but also that a positive influence is achieved for the curved paths, as shown in Figure 13.  
Figure 12: Example of a typical disc structure (SE), with the origin at the central matrix element and a radius of 3 elements.  
Figure 13: Comparison between a 2-dimensional structure and a 3-dimensional structure for dilation. The gray color represents the dilatation of the information collected by the arm. (**a**) Auto-learning dilated data obtained using disc structure (2D) with _aoi_\(=5\)_px;_ (**b**) auto-learning dilated data obtained using sphere structure (3D) with _aoi_\(=5\)_vx.