*2.5. Mapping Algorithm*

Both vision and radar maps exploit the Octomap library [23,24] to create and manage volume maps (defined by sets of voxels) in an efficient and fast way, which is a requirement when performed on embedded devices, such as Jetson boards. Two different type of maps can be employed: local and global maps, both using the same Earth reference system (ENU in this work). In general, we define a map as local when it only contains the obstacles detected at the current time, whereas a global map includes all the objects detected during the entire mission. In either cases, the task for updating the maps is computationally expensive since it requires a transformation of each detected point from the sensor frame to Earth frame, given the UAS attitude and position (pose). As said, for updating a local map, it is necessary to destroy the previous information at each new frame. Conversely, for the creation of the global map, it is sufficient to define a global container, where at each frame, all detected targets are inserted, without, however, deleting previously detected objects, even if they may no longer be present. Figure 5 shows the differences between the global map built using the radar sensor and the global map built starting from the optical one.

**Figure 5.** Differences between vision and radar global maps: left (**a**) is the radar map where detected obstacles are reported on the same plane as the drone; top right (**b**) is the optical point cloud, while on the bottom right (**c**), there is the corresponding conversion into a set of voxels used for the detection of dangerous obstacles. In this latter case, the map obtained also allows one to know the altitude of the detected obstacles.

In order to meet project AURORA specifications, which require independent and complementary sources for the obstacle detection subsystem, the proposed solution exploits two specific maps: a Vision local map and a Radar global map, as shown in the diagram of Figure 4. In particular, the vision maps are computed using the position estimate obtained from the vision process as a reference. Due to the camera operating range, it is quite common to have no visible objects during a mission for certain time intervals: in these conditions the SLAM process can diverge, creating inconsistencies between the new coordinates entered at the current time and the old ones, giving origin to distortions within the global map (see Figure 6). For this reason, the global map is to be considered unreliable, while the local map is the best choice for the task since in the latter, there are only the

current obstacles, and these are always consistent with the position estimate provided by the SLAM process.

**Figure 6.** Path divergence issues: estimated trajectories starting from data provided by the RTK system (**green**) and by the SLAM algorithm that uses the vision data (**red**). The latter diverges if there are no fixed objects in the operating range of the camera. This situation is shown in the image on the top right, where, after the avoidance of the building, all the fixed obstacles are out of the range of the optical sensor.

As for the radar obstacles detection, the reasoning for choosing a global map is different: unlike the stereoscopic vision system, the radar has a much lower resolution, so some obstacles may not always be reflective and consequently they could be detected only in certain time intervals. Therefore, a global map reporting all the targets detected during the mission allows for greater safety. It should be also noted that the radar maps, unlike the vision ones, are created using the path received by the RTK system as a reference [12], which has no particular divergence problems, being based on GNSS localization.
