# A Cyber-Physical System for Wildfire Detection and Firefighting
## 3 Materials and Methods
### Nuclio Serverless Function
While RViz only displays trees and not the terrain, the algorithm takes into account altitude changes, ground characteristics such as differences between grass and rock, and the physics of all objects during landing. RViz is a useful tool to observe the algorithm's

Figure 11: UAV waypoint navigation based on GPS coordinate. Figure 12: UAV fire detection at Waypoint #3.

computed path (red line) and the UAV's actual path (green dotted line) in real time. However, the algorithm only considers obstacle detection and collision avoidance parameters and not the UAV's flight parameters. Therefore, the autopilot must manage the collision avoidance system commands and combine them with vehicle dynamics. This results in differences between the two paths, especially in turns or changes of trajectory. If the vehicle is unable to complete the mission, the path is changed, or the collision avoidance system's parameters are varied while maintaining the same mission. Throughout all the tests, the UAV demonstrated its ability to autonomously locate and suppress fires, successfully overcoming the obstacles posed by the simulated trees. Additionally, the Unmanned Aerial Vehicle (UAV) acts as an aerial support platform, providing valuable assistance in fire detection and suppression operations. The UAV offers several advantages and capabilities that complement those of the UGV. Firstly, the UAV enhances situational awareness by providing a bird's-eye view of the fire. Secondly, the UAV enables intervention capabilities in scenarios where the UGV may face limitations or challenges. For example, if the UGV encounters inaccessible terrains or areas with unfavorable conditions, the UAV can be deployed to reach those locations and perform necessary actions to control or suppress the fire. By incorporating the UAV into the system alongside the UGV and the wildfire detection systems, our solution addresses a broader range of fire scenarios in diverse forest environments. The synergy between the UGV and UAV optimizes the effectiveness and efficiency of fire suppression operations, leveraging the unique capabilities of each platform to tackle different challenges and enhance overall performance. However, it is important to note some limitations and capabilities of obstacle avoidance. Due to the computational cost of calculating avoidance paths, the maximum speed supported for obstacle avoidance is approximately 3 m/s. Other aspects to consider are the flight range, the battery life, the payload capacity, and regulatory restrictions when deploying the UAV. Adhering to these considerations ensures the UAV operates within its specified operational limits and maximizes its potential in supporting fire suppression efforts. It is important to note that the current limitation can not be corrected as it is a result of the simulated execution environment. Figure 13: UAV collision avoidance using 3 DVFH+ algorithm. ### Unmanned Ground Vehicle

The UGV's behavior has been extensively tested and validated through simulations conducted in Gazebo, a popular robot simulation environment. The simulations were performed on a machine with an Intel Core i7-8750H 2.20 GHz CPU with 6 cores and Intel UHD Graphics, running Ubuntu 20.04 LTS with ROS version Noetic. These specifications ensured sufficient computational power and compatibility with the ROS framework for accurate simulation results. In the simulations, we created a realistic forest environment, incorporating vegetation and fire representation. The fire spots were represented by a cube, while trees acted as obstacles that the UGV had to navigate around. To evaluate the UGV's performance, we conducted a series of tests with varying distances to the fire spot. In each test, the UGV receives the geographical coordinates. Upon receiving the GPS coordinates of the fire from the UAV, it initiates its simulation and autonomously navigates through the forest (Figure 14). It utilizes the YOLOv4-Tiny model, installed on the onboard camera, to detect the fire (Figure 15).