# Advancing Road Infrastructure Safety with the Remotely Piloted Safety Cone
## 3 Results
### Obstacle Detection  
In this test, an RPSC equipped with an ultrasonic HC-SR04 sensor was placed two meters away from a wall and moved slowly towards it. Distance measurements were taken using three methods: raw measurement, which corresponds to unprocessed data; moving average filtering, which involves averaging a set of measurements; and Kalman filtering, an advanced statistical filter that provides more precise estimates. The moving average filtering method, Figure 15, involves calculating the average of the last five measurements to reduce the noise in the original data. In the test, moving average filtering significantly improved compared to raw measurement. The mean deviation was reduced from 0.023 m in the raw measurement to 0.015 m, indicating greater accuracy. The standard deviation decreased from 0.025 m to 0.0196 m, suggesting reduced variability and noise in the measurements. The maximum and minimum deviations were also reduced, from 0.075 m and 0.002 m in the raw measurement to 0.065 m and 0.001 m, respectively, using moving average filtering. While these improvements are significant, moving average filtering does not achieve the same accuracy and stability as the Kalman filter. The Kalman filter, Figure 16, is an advanced statistical method that provides more precise estimates by considering both measurements and their associated uncertainty. In the test, Kalman filtering proved the most effective technique for obtaining accurate and stable distance measurements. The mean deviation was the lowest among the three methods, at 0.012 m, indicating high accuracy. The standard deviation was also the lowest, at 0.015 m, suggesting less variability and noise in the measurements. Furthermore, the maximum and minimum deviations were reduced to 0.050 m and 0.001 m, respectively, evidencing high consistency in the obtained data. These characteristics make the Kalman filter ideal for applications requiring high precision and measurement stability. In the second test, the RPSC moves towards a specific point with a person acting as a moving obstacle. The avoidance distance was set to 1 m. The RPSC adjusts its position in response to the presence of the person. The RPSC is instructed to move to a certain point, and the person positions themselves in its path, with the avoidance distance set to 1 m. The RPSC stops and slightly retreat. Then, the person moves randomly in front of the RPSC, approaching and moving away. The RPSC responds appropriately: when the person moves away, the RPSC advances, but if the person approaches again, the RPSC retreats to maintain the distance. This test corresponds to Figure 17, which shows a noisier graph due to the real scenario and the sensor detecting a moving foot, not a flat wall. Figure 15: Unfiltered distances and distances smoothed by a moving average. The measurement results showed a significant difference between the methods used. The average deviation in pure measurement was 0.105 m, while mean filtering and Kalman filtering reduced this deviation to 0.085 m and 0.073 m, respectively, improving measurement accuracy. The standard deviation for pure measurement was 0.115 m, reduced to 0.096 m with mean filtering and to 0.082 m with Kalman filtering, suggesting a reduction in variability and noise in the measurements. The maximum deviation in pure measurement was 0.402 m, while mean filtering reduced it to 0.305 m and Kalman filtering to 0.238 m. The minimum deviation also decreased, from 0.002 m in pure measurement to 0.001 m with mean filtering and 0.001 m with Kalman filtering. These results reinforce the conclusion that Kalman filtering provides more accurate and stable measurements than other methods. In conclusion, the comparative analysis between mean filtering and Kalman filtering in a real environment with a moving obstacle shows that, although both methods improve distance measurements compared to raw data, Kalman filtering stands out for its higher accuracy and stability.