## Article
### Collision Point Cloud Generation  
The generation of a collision point cloud has the goal of using it for avoiding collisions between the impact hammer and surrounding environment. The collision point cloud always includes the environment point cloud, and the material cloud, depending on if the user wants to avoid the material or not. For instance, when the hammer's end-effector needs to be placed in the rock to be broken, the user chooses not to include the material cloud. This is done by just pressing a button on the haptic device. The generation of collision points starts with a dilation operation over the environment point cloud, and applies over the material point cloud, which is implemented in each case using as structuring element cube of \(3\times 3\times 3\) points. The dilation of the input point cloud by the cube of \(3\times 3\times 3\) (which corresponds to a cube of 27 points), can be understood as the locus of the points covered by the cube of \(3\times 3\times 3\) point when the center of it, moves within the input point cloud. The dilation operation is defined as follows:  
\[A\bigoplus B=\cup_{b\in B}A_{b} \tag{1}\]  
where \(A\) is the initial point cloud, and \(B\) is the structuring element (cube \(3\times 3\times 3\)). This means that for each initial point, 26 extra points are created, which will surround the initial point (27 points in total). Figure 7 shows the dilation operation, and the result of this operation on a single voxelized point. At the end of the morphological dilation, a new point cloud is obtained, with multiple repeated points because the implemented dilation algorithm does not check if there is already a point in the space where the new points are generated. To eliminate this redundant  
Figure 6: Processes to obtain the Point Cloud of the material. Figure 7: (**A**): Single voxelized point; (**B**): \(3\times 3\times 3\) structuring element with origin in central point; and (**C**): result of dilatation operation. data and to increase the algorithm's performance, the resulting cloud is voxelized again. Figure 8 shows the process to obtain the collision points. As mentioned, the collision point cloud is composed of two parts. The first part will come from the processing of the point cloud belonging to the environment model. As this model is static and was previously calculated in a previous module, it is only processed once to generate the cloud of collision points belonging to the environment. The second part will come from the processing of the point cloud belonging to the material. As this point cloud is dynamic (it is expected to change frequently), the process of obtaining the collision point cloud is performed in each execution cycle. In this case, for performance reasons, the dilatation operation is performed once per cycle. In the case of requiring to generate a thicker collision point cloud, several dilation iterations should be performed in the same cycle. This would result in a larger safety distance between the real object and end effector. Figure 9 shows a comparison between the point cloud of the generated grizzly model and the point cloud resulting from the dilation process. Therefore, the resulting collision cloud will be the concatenation of points from the static processing (performed only once at the beginning of the program) of the environment model, with that of the dynamic processing of the material (performed in each cycle). This point cloud will result in a more homogeneous cloud, filling the empty spaces due to the imperfection of the sensors. Figure 8: Processes to obtain the collision point cloud. Figure 9: (**a**) The original collision cloud generated with the environment points. (**b**) The resulting collision point cloud after applying the dilation process. It must be emphasized that at any moment, the user can choose using just the environment model for the generation of the collision point cloud, not including the point clouds associated to the material. This is normally made just before placing the hammer on the rock to be broken.