# Painting Path Planning for a Painting Robot with a RealSense Depth Sensor
## 5 Experiments and Results
As was mentioned earlier, the main precedence of the RANSAC algorithm is its capability for robust assessment of the model parameters, because it can estimate the parameters with a high degree of accuracy, even when a great number of outliers are present in the data set. This means that in the case of lower quality depth information and depth images, the RANSAC algorithm detects the desired plane of the wall. This is an important feature, since a low-cost D435 depth camera is used for surface depth mapping [45; 46]. The RANSAC plane detection results are presented in Figure 5a. The wall area was successfully extracted and is shown as green in the image. The red parts denote the detected obstacles. Since the obstacles were closer to the camera, they were set to be red in the camera's built-in software. The blue parts are the shadows of the obstacles, which the D435 camera recognized as very distant objects. As a result, they were not significant in the later painting process. Figure 3: (**a,b**) The painting robot during the RTAB mapping process in order to form the point cloud of the wall surface. Figure 5b shows the binary mask of the plane-detected image. The white area represents the surface that should be painted. This binary image was connected with the  
Figure 4: The resulting merged point cloud of the wall surface with obstacles included. Figure 5: (**a**) The detected plane without obstacles representing the wall, as detected by the RANSAC algorithm. (**b**) Binary mask of the detected plane without obstacles, which represents the wall to be painted by the painting robot. coordinates of the point cloud of the surface and this information was forwarded to the robot's control system. Taking the obtained data and using the ROS, the control software began the painting process. Since the development and equipping of the painting equipment was still in progress, the painting process was simulated using the robot's arm and ROS software. Figure 6a,b shows the simulation process for the wall painting. It should be noted that the red, blue, and purple lines show the movement of the painting head. It is easy to notice that the panting head avoided the obstacles during the painting process. The complete procedure for wall capturing, point cloud merging, plane detection, and wall painting lasted about 4-5 min on the corresponding hardware. The hardware configuration used in the tests included an Intel Core i7 8700 K CPU, Asus GeForce GTX 1050 Dual 2 GB GDDR5 128 bit graphic card, 32 GB 3000 MHz DDR4 RAM memory, Samsung 850 EVO 250 GB SATA3 SSD, and Asus PRIME Z370-A desktop motherboard. This is important for commercial purposes, since the whole procedure is quite fast--certainly faster than the time it would take a person to paint the same surface. The next example will introduce the segmentation process and the painting simulation process for an outdoor wall on a terrace. Figure 7a shows a door and the window surrounded by the wall to be painted. Figure 7b,c displays the painting robot during the RTAB mapping process used to form the point cloud of the complex surface. The red rectangle-based object represents the depth camera used in simulation process. As can be seen, the point cloud is formed successfully using the previously explained procedure. Figure 6: (**a**) The movement of the painting robot during the painting simulating process for the detected wall surface. (**b**) The movement of the painting robot in the painting simulating process on the detected wall surface for the real point cloud. The next step in the process was plane detection, again with the goal of detecting and extracting the wall area to be painted. The goal of the wall detection process was to avoid the door and the window, which were not to be painted. The plane extraction process was performed again by executing the RANSAC-based segmentation algorithm, preceded by statistical filtering. In this example, the wall area was successfully extracted and is colored green in the image.