DroneWiS: Automated Simulation Testing of small Unmanned Aerial Systems in Realistic Windy Conditions

Bohan Zhang [email protected] XX Saint Louis UniversitySaint LouisMOUSA  and  Ankit Agrawal [email protected] Saint Louis UniversitySaint LouisMOUSA
(2024)
Abstract.

The continuous evolution of small Unmanned Aerial Systems (sUAS) demands advanced testing methodologies to ensure their safe and reliable operations in the real-world. To push the boundaries of sUAS simulation testing in realistic environments, we previously developed the DroneReqValidator (DRV) platform (Zhang et al., 2023), allowing developers to automatically conduct simulation testing in digital twin of earth. In this paper, we present DRV 2.0, which introduces a novel component called DroneWiS (Drone Wind Simulation). DroneWiS allows sUAS developers to automatically simulate realistic windy conditions and test the resilience of sUAS against wind. Unlike current state-of-the-art simulation tools such as Gazebo and AirSim that only simulate basic wind conditions, DroneWiS leverages Computational Fluid Dynamics (CFD) to compute the unique wind flows caused by the interaction of wind with the objects in the environment such as buildings and uneven terrains. This simulation capability provides deeper insights to developers about the navigation capability of sUAS in challenging and realistic windy conditions. DroneWiS equips sUAS developers with a powerful tool to test, debug, and improve the reliability and safety of sUAS in real-world. A working demonstration is available at https://youtu.be/khBHEBST8Wc.

Testing, Environmental Factors, Unmanned Aerial Systems
copyright: acmlicensedjournalyear: 2024doi: XXXXXXX.XXXXXXXconference: ; October 27th–Nov 1st, 2024; California, USisbn: 978-1-4503-XXXX-X/18/06ccs: Software and its engineering Application specific development environments

1. Introduction

The rapid advancements in small Uncrewed Aerial Systems (sUAS) has led to their increased use in various applications, including urban logistics and military operations in challenging terrains (Chen et al., 2022; Stodola et al., 2019). However, ensuring the safety and reliability of these systems in adverse environmental conditions, such as complex wind dynamics remains a significant challenge (Ilachinski, 2017). When testing sUAS under windy conditions, sUAS developers suffer from two primary challenges.

Traditional sUAS simulation tools, like Gazebo and AirSim, use oversimplified wind models that ignore complex interactions with terrain and buildings. These models typically feature stochastic wind fluctuations or constant wind velocity, resulting in inaccurate simulations. Additionally, setting up realistic wind conditions is manual and labor-intensive, involving a 3D graphic designer to create the environment and a CFD engineer to compute wind flows using tools like OpenFoam. This process must be repeated for each simulation scenario, highlighting the need for automation to allow sUAS developers to create complex wind patterns more efficiently.

These two primary limitations of sUAS simulation tools hinder developers from testing their systems in realistic wind conditions, resulting in a significant gap between simulation results and real-world sUAS operations. To mitigate the limitations of existing sUAS simulation tools, we introduce DroneWiS (Drone Wind Simulation), a novel module integrated into our established platform, DroneReqValidator(DRV) (Zhang et al., 2023; Agrawal et al., 2023). This enhancement evolves DRV into its next generation, DRV 2.0.

The DroneWiS module uses state-of-the-art CFD software, OpenFOAM (Jasak, 2009), with a terrain scanning algorithm in Unreal Engine, to automatically simulate desired wind conditions in any given 3D environment. This innovative approach generates high-fidelity, dynamic wind vector data for various wind types, including uniform, turbulent, and multi-source winds.

Next, we discuss the architectural design of DroneWiS (Section 2) describing the algorithms employed to automatically compute CFD-based wind flows within a given 3D environment (Algorithm 1). Furthermore, we also describe the integration of DroneWiS within DRV for evaluation purposes and demonstrate the platform’s efficacy in sUAS testing (Section 3).

2. System Design

Refer to caption
(a) Google Earth Digital Twin Model
Refer to caption
(b) Scanned Voxel Grid
Refer to caption
(c) OpenFOAM Wind-Flow Computation
Figure 1. The figure shows three views of the same environment: (a) the initial terrain, (b) the voxel grid from the Terrain Scanning Algorithm, and (c) wind simulation results from OpenFOAM, with arrows indicating wind velocity and direction.
Refer to caption
Figure 2. DroneWiS Architecture and Integration with DRV

DRV Platform Background: In our previous work, we presented the DRV platform (Zhang et al., 2023; Agrawal et al., 2023) which uses a modular client-server architecture, comprising a React-based front-end and a Python/Flask back-end. The user-friendly interface allows developers to configure realistic simulation environments, including specific parts of the Google Digital Twin model where they wish to simulate one or more UAVs. The back-end automatically retrieves 3D environment data from the Google Earth 3D API to create the simulation. It uses AirSim APIs and Unreal Engine to simulate the behavior of single or multiple sUAS in the user-specified geolocations.

DroneWiS : Figure 2 presents the overall architecture of DroneWiS and its integration with the DRV platform. DroneWiS receives inputs from the DRV User Interface regarding the simulation region, which corresponds to real-world geo-coordinates (e.g., Latitude and longitude of Saint Louis University), and the wind conditions developers wish to simulate. In addition to normal and turbulent wind simulations, DroneWiS allows users to specify multi-source winds. For example, it can simulate normal wind from the east of Chicago at 10 meters per second and turbulent wind from the west at 30 meters per second with 40% fluctuation, exposing sUAS to complex urban wind conditions.

Based on these inputs, DroneWiS automatically produces the wind flow data. The automation pipeline includes two primary components: 1) a terrain scanning algorithm to understand the details of obstacles and elements in the environment, 2) OpenFoam, a CFD tool, to automatically compute the wind vectors in the environment, and process them for quick read operation during simulation run-time.

2.1. Terrain Scanning

To model wind flow around complex real-world objects (such as buildings), we need to represent the digital twin model of the environment in a format that can be easily processed by computational algorithms. This includes identifying which parts of the 3D environment are occupied by objects and which parts are empty where wind flow needs to be computed. Therefore, we developed a terrain scanning algorithm (Algorithm 1) to efficiently scan the 3D digital twin model (Fig. 1(a)).

The algorithm takes the 3D environment as input and overlays a Volumetric Pixel Grid (Voxel Grid shown in Fig 1(b)), where each cell (a 1-meter cube) acts as a sampling point (Algo 1 - Lines 1-3). For each cell in the grid, we need to identify if it is occupied by an object or empty. Thus, for each cell (Line 4), we run the function ObstructionCheck, which takes the center of the grid cell as input (Line 5) and returns false if the cell is empty or true if it is occupied (Line 6).

Algorithm 1 Scanning Algorithm
1:  Input: scanRange𝑠𝑐𝑎𝑛𝑅𝑎𝑛𝑔𝑒scanRangeitalic_s italic_c italic_a italic_n italic_R italic_a italic_n italic_g italic_e {xyz𝑥𝑦𝑧x\cdot y\cdot zitalic_x ⋅ italic_y ⋅ italic_z}
2:  Output: voxelGrid𝑣𝑜𝑥𝑒𝑙𝐺𝑟𝑖𝑑voxelGriditalic_v italic_o italic_x italic_e italic_l italic_G italic_r italic_i italic_d
3:  voxelGrid{}𝑣𝑜𝑥𝑒𝑙𝐺𝑟𝑖𝑑voxelGrid\leftarrow\{\}italic_v italic_o italic_x italic_e italic_l italic_G italic_r italic_i italic_d ← { }
4:  for each coordinate𝑐𝑜𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒coordinateitalic_c italic_o italic_o italic_r italic_d italic_i italic_n italic_a italic_t italic_e in scanRange𝑠𝑐𝑎𝑛𝑅𝑎𝑛𝑔𝑒scanRangeitalic_s italic_c italic_a italic_n italic_R italic_a italic_n italic_g italic_e do
5:     cellCenter𝑐𝑒𝑙𝑙𝐶𝑒𝑛𝑡𝑒𝑟absentcellCenter\leftarrowitalic_c italic_e italic_l italic_l italic_C italic_e italic_n italic_t italic_e italic_r ← center of the current coordinate𝑐𝑜𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒coordinateitalic_c italic_o italic_o italic_r italic_d italic_i italic_n italic_a italic_t italic_e cell
6:     hit𝑖𝑡absenthit\leftarrowitalic_h italic_i italic_t ← ObstructionCheck(cellCenter𝑐𝑒𝑙𝑙𝐶𝑒𝑛𝑡𝑒𝑟cellCenteritalic_c italic_e italic_l italic_l italic_C italic_e italic_n italic_t italic_e italic_r)
7:     if hit𝑖𝑡hititalic_h italic_i italic_t then
8:        add coordinate𝑐𝑜𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒coordinateitalic_c italic_o italic_o italic_r italic_d italic_i italic_n italic_a italic_t italic_e to voxelGrid𝑣𝑜𝑥𝑒𝑙𝐺𝑟𝑖𝑑voxelGriditalic_v italic_o italic_x italic_e italic_l italic_G italic_r italic_i italic_d
9:     end if
10:  end for
11:  
12:  return  voxelGrid𝑣𝑜𝑥𝑒𝑙𝐺𝑟𝑖𝑑voxelGriditalic_v italic_o italic_x italic_e italic_l italic_G italic_r italic_i italic_d
13:  function ObstructionCheck(cellCenter𝑐𝑒𝑙𝑙𝐶𝑒𝑛𝑡𝑒𝑟cellCenteritalic_c italic_e italic_l italic_l italic_C italic_e italic_n italic_t italic_e italic_r)
14:   Input: cellCenter𝑐𝑒𝑙𝑙𝐶𝑒𝑛𝑡𝑒𝑟cellCenteritalic_c italic_e italic_l italic_l italic_C italic_e italic_n italic_t italic_e italic_r
15:   Output: bool𝑏𝑜𝑜𝑙boolitalic_b italic_o italic_o italic_l
16:   faces𝑓𝑎𝑐𝑒𝑠absentfaces\leftarrowitalic_f italic_a italic_c italic_e italic_s ← Generate 6 faces of the voxel centered at cellCenter𝑐𝑒𝑙𝑙𝐶𝑒𝑛𝑡𝑒𝑟cellCenteritalic_c italic_e italic_l italic_l italic_C italic_e italic_n italic_t italic_e italic_r
17:  for each pair of opposite face centers in faces𝑓𝑎𝑐𝑒𝑠facesitalic_f italic_a italic_c italic_e italic_s do
18:      hasLineOfSight𝑎𝑠𝐿𝑖𝑛𝑒𝑂𝑓𝑆𝑖𝑔𝑡absenthasLineOfSight\leftarrowitalic_h italic_a italic_s italic_L italic_i italic_n italic_e italic_O italic_f italic_S italic_i italic_g italic_h italic_t ← lineTrace(face1, face2)
19:     if Not hasLineOfSight𝑎𝑠𝐿𝑖𝑛𝑒𝑂𝑓𝑆𝑖𝑔𝑡hasLineOfSightitalic_h italic_a italic_s italic_L italic_i italic_n italic_e italic_O italic_f italic_S italic_i italic_g italic_h italic_t then
20:         
21:        return  true
22:     end if
23:  end for
24:   
25:  return  false
26:  end function

The ObstructionCheck function (Lines 13-26) uses Unreal Engine ray tracing to determine if a cell is empty or occupied. For example, consider a cube cell in the volumetric grid; this cell has six faces, each with a central point denoted as P1subscript𝑃1P_{1}italic_P start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT to P6subscript𝑃6P_{6}italic_P start_POSTSUBSCRIPT 6 end_POSTSUBSCRIPT. Here, P1subscript𝑃1P_{1}italic_P start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT to P4subscript𝑃4P_{4}italic_P start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT correspond to the central point of the back, right, front, and left sides of the cube, while P5subscript𝑃5P_{5}italic_P start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT and P6subscript𝑃6P_{6}italic_P start_POSTSUBSCRIPT 6 end_POSTSUBSCRIPT are the top and bottom sides (Line 16). We have three unique pairs of opposite faces: P1,3subscript𝑃13P_{1,3}italic_P start_POSTSUBSCRIPT 1 , 3 end_POSTSUBSCRIPT, P2,4subscript𝑃24P_{2,4}italic_P start_POSTSUBSCRIPT 2 , 4 end_POSTSUBSCRIPT, and P5,6subscript𝑃56P_{5,6}italic_P start_POSTSUBSCRIPT 5 , 6 end_POSTSUBSCRIPT. From each pair (Line 17), we trace two rays, resulting in a total of six rays. Algorithm 1 adds a cell to the resulting voxelGrid if there is a visibility obstruction between any pair of opposite faces, indicating the presence of an obstacle. The remaining cells represent open spaces. The obstructed cells are represented by green color in Figure 1(c).

2.2. Wind Flow Computation and Processing

After DroneWiS scans the environment, the resulting voxel grid is transferred to OpenFoam, a specialized CFD tool for processing voxel grids and computing wind vectors. DroneWiS automatically configures OpenFoam according to user-specified wind conditions, which include wind type (normal, turbulent, multi-source), wind direction, and wind velocity. Therefore, OpenFoam takes the voxel grid and wind characteristics as inputs to compute wind flows.

After OpenFoam finishes computing the wind flow, it generates wind vectors that describe the velocity and direction of wind for each empty grid cell. We utilize an advanced k-d Tree preprocessing algorithm (Skrodzki, 2019) to optimize random access speed of data using nearest neighbor queries and store the constructed k-d Tree in the wind speed database. This processing step is crucial to retrieve the wind vector from the database during simulation run-time in negligible time and ensure that wind forces are applied to the simulated UAV for each time step of the simulation.

During the simulation, DRV retrieves the wind vector at the current geographical coordinates of the simulated sUAS from DroneWiS and applies the wind forces to impact the flight path of the UAV based on the computed wind at that geo-location. As shown in the architectural diagram in Figure 2, this design completely separates the responsibilities of wind computation and corresponding sUAS simulation. Therefore, this design allows existing sUAS simulation platforms such as Gazebo to also utilize DroneWiS to access wind data at specific sUAS locations, apply wind forces, and simulate sUAS behavior in variety of wind conditions.

2.3. Automation Computational Analysis

To assess the efficiency of the scanning algorithm, we analyzed its performance across various scanning ranges, as depicted in Fig. 3. The graph displays two lines: one for scanning time and another for wind computation and processing time across 3D environment of various sizes. We can observe that the terrain scanning algorithm operates quickly and efficiently without significantly impacting the overall computation time, unlike the time-intensive calculations of OpenFoam CFD for wind computations. Since CFD methods are traditionally computationally intensive, there is a growing interest in transitioning towards predictive approaches for wind flow analysis. As part of our future plans, we aim to optimize wind flow computation time by leveraging physics-informed neural networks.

Refer to caption
Figure 3. Terrain Scan and Wind Flow Computation Time

3. Application of DroneWiS in sUAS Testing

To rigorously assess the accuracy of wind computation and the responsiveness of sUAS to wind conditions in simulations, we conducted a comparative analysis with Airsim (Shah et al., 2018). Our primary objective was to evaluate how wind conditions influenced sUAS flight paths and to determine the extent to which their behavior appeared “organic”—that is, realistically unpredictable and natural—under similar conditions across different simulation platforms. We used scenario-based approach to validate the effectiveness of DroneWiS in simulation testing(Ryser and Glinz, 1999).

Environment Set-Up: We selected several points of interest on the Saint Louis University campus and used the DRV front-end to specify these simulation regions along with the dynamic wind conditions that an sUAS developer would want to simulate. Specifically, we set gusty wind flow at 10 meters per second from various directions with a 30 percent fluctuation in velocity. These inputs were then sent to DroneWiS , which scanned the environment using Algorithm 1 and produced the processed wind vector database that DRV used to apply wind forces during simulation run-time.

Refer to caption
Figure 4. Scenario - Circular flight around stationary object

Scenario 1: Circular Flight Path in Gusty Winds The objective of this scenario was to evaluate the capability of DroneWIS in simulating dynamic wind behavior in an urban environment and to observe its impact on sUAS flight paths. In this scenario, we utilized the digital twin environment as depicted in Fig. 1(a), and used DroneWiS to generate the Voxel Grid as presented in 1(c). We also used AirSim to simulate sUAS in the same environment and employed its default wind model to observe the flight path for comparative analysis.

Analysis: The observed flight paths is presented in the Figure 4. As illustrated, the circular flight path of the sUAS using DroneWiS (red line) exhibits more dynamic changes and variance in wind speed around the stationary tower in the center. The wind flow diverges after hitting the tower, causing wider flight deviations on the other side. In contrast, the flight path using AirSim (blue dashed line) does not show such dynamic changes because it assumes that wind flows uniformly and does not interact with environmental elements. This results in a more linear and less responsive flight path. The comparison highlights DroneWiS’s capability to account for the impact of environmental elements, such as buildings and other obstacles, to generate realistic wind patterns and observe how these wind flows affect the sUAS flight path.

Scenario 2: Unexpected Wind during Takeoff

We recreated a 2022 FAA-reported incident where a drone crashed while taking off between two buildings (one taller than the other) to capture target imagery. Although the buildings shielded the takeoff location from the wind’s direct effects, as soon as the sUAS reached a higher altitude, high wind velocity blew the UAV off course significantly.

As part of our evaluation, we recreated this scenario to verify if DroneWiS can detect such deviations. We used DRV to pick an environment for sUAS simulation where two buildings of different heights are close to each other, configured to simulate wind speed of 20 meters per second blowing towards the north. DroneWiS uses this as input to compute the wind vectors in that environment.

Analysis: As shown in Figure 5, the wind velocity above the buildings is notably higher, forming an area with increased wind speeds compared to lower altitudes. Initially, the sUAS encountered minimal difficulty during takeoff, as evidenced by its flight path near the takeoff point. However, as the sUAS ascended to an altitude parallel to the rooftops of the buildings, strong wind forces pushed it in the direction of the wind, causing it to fly chaotically.

In contrast, when using AirSim’s wind simulations, the simulated flight path showed a smooth curve. This indicates that wind effects on sUAS were present even at low altitudes, where buildings obstruct the wind coming from the source direction. This smooth flight path occurs because AirSim’s wind simulations do not account for obstacles such as buildings in their computation and simulation of wind flows.

Refer to caption
Figure 5. Scenario - Unexpected wind during takeoff

Summary of our Evaluation - Using DroneWiS , we replicated the system failures due to wind that have been reported in past incidents, and generated insights regarding system robustness in hypothetical windy conditions. While these are simulation results and require further validation under real-world windy conditions, the insights generated by DroneWiS are invaluable resources for sUAS developers during the initial development stages. Additionally, systematic simulation testing under diverse wind conditions can support safety analysis processing by using simulation artifacts as evidence to claim/refute safety and can also be automated to integrate automatically into Safety Assurance Cases(Agrawal et al., 2019; Agrawal and Cleland-Huang, 2023).

4. Conclusion

In this paper, we introduced DroneWiS, a novel component, integrated with the original DRV platform, that enables sUAS developers to conduct robust testing against complex wind patterns in a 3D simulation environment. By automating the computation and simulation of realistic wind conditions, DroneWiS provides a universally adaptable tool that can be integrated into various simulation platforms. Our comparative analysis of DroneWiS with AirSim’s wind simulations demonstrated significant improvements in wind effect fidelity, offering sUAS developers a powerful means to test and ensure safe operation of sUAS in real-world. In future work, we plan to adopt a machine learning-based approach to enhance the efficiency of wind vector generation for large-scale environments, support a broader range of wind conditions, and improve the fidelity of wind forces applied to sUAS.

5. CODE AVAILABILITY

Code-base of DRV and DroneWiS is available on our public GitHub repository:https://github.com/UAVLab-SLU/DRV_public.

6. Acknowledgements

The work in this paper was funded under USA National Aeronautics and Space Administration (NASA) Grant Number: 80NSSC23M0058

References

  • (1)
  • Agrawal and Cleland-Huang (2023) Ankit Agrawal and Jane Cleland-Huang. 2023. Leveraging Traceability to Integrate Safety Analysis Artifacts into the Software Development Process. In 2023 IEEE 31st International Requirements Engineering Conference Workshops (REW). IEEE, 475–478.
  • Agrawal et al. (2019) Ankit Agrawal, Seyedehzahra Khoshmanesh, Michael Vierhauser, Mona Rahimi, Jane Cleland-Huang, and Robyn Lutz. 2019. Leveraging artifact trees to evolve and reuse safety cases. In 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE). IEEE, 1222–1233.
  • Agrawal et al. (2023) Ankit Agrawal, Bohan Zhang, Yashaswini Shivalingaiah, Michael Vierhauser, and Jane Cleland-Huang. 2023. A Requirements-Driven Platform for Validating Field Operations of Small Uncrewed Aerial Vehicles. In 2023 IEEE 31st International Requirements Engineering Conference (RE). IEEE, 29–40.
  • Chen et al. (2022) Kuan-Wen Chen, Ming-Ru Xie, Yu-Min Chen, Ting-Tsan Chu, and Yi-Bing Lin. 2022. DroneTalk: An Internet-of-Things-based drone system for last-mile drone delivery. IEEE Transactions on Intelligent Transportation Systems 23, 9 (2022), 15204–15217.
  • Ilachinski (2017) Andrew Ilachinski. 2017. Artificial Intelligence and Autonomy: Opportunities and Challenges. (2017).
  • Jasak (2009) Hrvoje Jasak. 2009. OpenFOAM: open source CFD in research and industry. International Journal of Naval Architecture and Ocean Engineering 1, 2 (2009), 89–94.
  • Ryser and Glinz (1999) Johannes Ryser and Martin Glinz. 1999. A scenario-based approach to validating and testing software systems using statecharts. (1999).
  • Shah et al. (2018) Shital Shah, Debadeepta Dey, Chris Lovett, and Ashish Kapoor. 2018. Airsim: High-fidelity visual and physical simulation for autonomous vehicles. In Field and service robotics. Springer, 621–635.
  • Skrodzki (2019) Martin Skrodzki. 2019. The kd tree data structure and a proof for neighborhood computation in expected logarithmic time. arXiv preprint arXiv:1903.04936 (2019).
  • Stodola et al. (2019) Petr Stodola, Jan Drozd, Jan Mazal, Jan Hodickỳ, and Dalibor Procházka. 2019. Cooperative unmanned aerial system reconnaissance in a complex urban environment and uneven terrain. Sensors 19, 17 (2019), 3754.
  • Zhang et al. (2023) Bohan Zhang, Yashaswini Shivalingaiah, and Ankit Agrawal. 2023. DroneReqValidator: Facilitating High Fidelity Simulation Testing for Uncrewed Aerial Systems Developers. In 2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 2082–2085.