Next Article in Journal
Optimization of Flight Planning for Orthomosaic Generation Using Digital Twins and SITL Simulation
Previous Article in Journal
Distributed Relative Pose Estimation for Multi-UAV Systems Based on Inertial Navigation and Data Link Fusion
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Outdoor Dataset for Flying a UAV at an Appropriate Altitude

1
Faculty of Computing and Information Technology, King Abdulaziz University, Jeddah 21589, Saudi Arabia
2
Faculty of Computer Science and Engineering, University of Jeddah, Jeddah 23218, Saudi Arabia
*
Author to whom correspondence should be addressed.
Drones 2025, 9(6), 406; https://doi.org/10.3390/drones9060406
Submission received: 24 April 2025 / Revised: 29 May 2025 / Accepted: 29 May 2025 / Published: 31 May 2025

Abstract

The increasing popularity of drones for Internet of Things (IoT) applications has led to significant research interest in autonomous navigation within unknown and dynamic environments. Researchers are utilizing supervised learning techniques that rely on image datasets to train drones for autonomous navigation, which are typically used for rescue, surveillance, and medical aid delivery. Current datasets lack data that allow drones to navigate in a 3D environment; most of these data are dedicated to self-driving cars or navigation inside buildings. Therefore, this study presents an image dataset for training drones for 3D navigation. We developed an algorithm to capture these data from multiple worlds on the Gazebo simulator using a quadcopter. This dataset includes images of obstacles at various flight altitudes and images of the horizon to assist a drone in flying at an appropriate altitude, which allows it to avoid obstacles and prevents it from flying unnecessarily high. We used deep learning (DL) to develop a model to classify and predict the image types. Eleven experiments performed with the Gazebo simulator using a drone and a convolution neural network (CNN) proved the database’s effectiveness in avoiding different types of obstacles while maintaining an appropriate altitude and the drone’s ability to navigate in a 3D environment.

1. Introduction

Unmanned aerial vehicles (UAVs) are highly mobile and flexible, facilitating swift deployment to meet service demand [1]. UAVs have increased significantly in areas such as delivery, agriculture, medical support, and photography [2]. In addition, they have been used in smart cities and transportation networks [3]. UAVs can improve IoT applications by providing network resources in areas with limited connectivity [4]. However, there are challenges involved in their implementation, particularly involving collision avoidance due to unpredictable flight environments [5]. A UAV’s autonomy refers to its capability to carry out tasks independently without the need for direct user control [6]. UAVs can reach dangerous or hard-to-access areas safely, eliminating the risk to humans; therefore, UAVs should be designed for autonomous operation and collision avoidance during flight [7]. Effective autonomous drone navigation involves path planning, obstacle detection, and avoidance, and these capabilities require efficient task division for successful implementation [8].
Numerous studies have been conducted to address challenges in path planning and obstacle avoidance. Traditional UAV path planning techniques, such as Voronoi diagrams and Dijkstra, often fail to improve energy efficiency or to adapt to updated mission requirements [9]. In addition, these traditional techniques are ineffective in environments that contain complex obstacle shapes [2]. Metaheuristic algorithms, such as genetic, differential evolution, and the ant colony, are inefficient for real-time path planning due to their time-consuming search and iteration processes [10]. DL excels in complex and dynamic environments, learning compact features from high-dimensional situations, thereby making it more adaptable and resilient than traditional algorithms [11]. Supervised learning techniques, such as DL, are trained on image datasets collected from the environment in order to take appropriate action to avoid collisions with the obstacle and reach the target.
Many image datasets have been created and labeled for use in controlling a drone’s path or detecting obstacles. However, current methods rely on deep neural networks and deep reinforcement learning to generate action for two-dimensional movement, and they do not fully utilize the capabilities of UAVs to move in three dimensions (X, Y, and Z) [12]. The reason for this is that the current databases contain data that were captured inside buildings [13], captured on the road to detect obstacles [14], or obtained primarily to train cars for object detection while driving [15]. Therefore, as far as we know, there are currently no databases for training drones to increase their altitude, fly over obstacles, and navigate in a 3D environment. Simulated synthetic datasets are a good alternative for the development of new models in rare, dangerous, or unreachable environments due to their ease of use and cost-effectiveness [16,17]. Synthetic datasets represent a promising solution for deep learning, which requires large amounts of data to learn; they will, in turn, help in developing robots and preparing for everyday applications [18]. Numerous studies have demonstrated the effectiveness of synthetic images in training robots and UAVs and their generalization in the real world. One study showed that a robot trained to detect objects from a simulated image achieved high accuracy in the real world [19]. A simulation environment was used to train a UAV to avoid collisions, and real-world experiments proved the effectiveness of this simulation environment [20]. The results of the study on UAV detection demonstrated that UAVs trained on synthetic data outperformed those trained on real data, particularly in scenes with high-intensity light and distant objects [18].
Based on the above facts, we introduce a novel dataset for training a drone to adjust its altitude. The contributions of this study are as follows:
  • We present the novel dataset with a focus on altitude adjustment to train drones to fly at an appropriate altitude while detecting and avoiding obstacles.
  • A Gazebo simulator is efficient at taking images from different heights as if they were captured in the real world, and this is difficult to execute in a real environment; thus, the Gazebo simulator is used to collect all the images.
  • We have developed an algorithm for efficiently collecting data within a Gazebo environment using a drone.
  • The dataset contains obstacles at various heights, including the base, middle, and top of the obstacle, to train drones on different obstacle shapes while flying at different heights, thus making it suitable for navigation in 3D environments.
  • The database contains horizon images used to assess drone altitudes and to determine if the drones have reached high altitudes and need to slightly reduce their altitude.
  • Disturbances like wind, temperature, air pressure, and aerodynamic effects can lead to UAV instability  [21]. This instability may cause the drone to rotate at an angle of pitch, making the captured image the only image of the horizon, which may, in turn, be perceived as an obstacle because of its uniform color. Consequently, these horizon images are classified as horizons rather than obstacles.
  • The database image simulates reality by incorporating various light conditions, including images taken at night, during the day, and with different degrees of brightness.
  • We used a CNN to develop a model to classify and predict image types.
  • Eleven experiments were conducted using a drone and a CNN on the Gazebo simulator to verify the efficiency of our dataset.
The article is structured into five sections: Section 2 reviews the existing dataset; Section 3 explains the proposed approach; Section 4 evaluates our dataset; and Section 5 contains the conclusions and outlines future work.

2. Literature Review

This section features a review of various image datasets utilized in deep learning for autonomous drone navigation in unknown and dynamic environments. These datasets assist in training drones, enabling them to make action decisions to avoid obstacles and reach their targets. Data from numerous databases have been collected from within buildings. Nathan et al. [22] introduced the NYU dataset, consisting of 1449 RGB images of various indoor scenes; scene information was extracted via feature extraction and labeling. This dataset was designed to analyze the complexity of indoor scenes by segmenting images into regions that correspond to object types. Yingxiu et al. [13] developed the HDIN dataset, which was specifically designed for UAV navigation in 2D indoor environments. It includes real-world data with three types of labels: expected steering, fitting angular velocity, and scalable angular velocity. They pointed out the shortcoming of their database as follows: It does not enable drones to fly in a three-dimensional space. Padhy et al. [23] presented an ICL dataset that captures images of a corridor inside a building taken from nine different alignments and positions using an onboard UAV camera monocular. This dataset was used to train the UAV to perform three actions, i.e., left, right, and forward movements, across various lengths of the corridor. Hang et al. [24] used a camera to capture the scene and a distance sensor to measure the distance to collision. These sensors collected data from building corridors, labeling images with collision distances. They trained a deep learning model to determine the appropriate actions, i.e., forward, right, and left movements, based on the images and collision distances. Garcia et al. [25] created a dataset by using UAVs to record videos from more than 30 hallways across 10 buildings, ensuring diversity in the dataset. They collected 1484 images from 37 hallways in 10 buildings, using them to train a CNN to steer the angle of a quadrotor in a hallway. They plan to incorporate obstacle avoidance, such as a person in the hallway, into their future work.
Several datasets have been developed from road images. Eiger et al. [15] presented the KITTI dataset for autonomous vehicle navigation in a 2D environment, and it includes images of roads located in cities, outside cities, on campuses, and within residential areas along with labels for 3D objects. They used a car equipped with 3D lidar and a GPS to capture these images. Zhengyuan et al. [26] developed the SAIC dataset using three cameras, one in front and two on the sides, to record data from roads. These data were used to train the car to determine its speed and steering angle. Loquercio et al. [14] developed a collision sequence dataset captured from roads to simulate bicycles and cars. They attached a camera to the front of the bicycle and captured images of city roads, classifying the images as collision or non-collision. The Udacity dataset [27] was designed to predict steering angles using images captured from the road in front of the car by three front-view cameras. Schafer et al. [28] developed the comma2k19 dataset by collecting data from a vehicle equipped with sensors, a road surveillance camera, and a GPS during a 33 h drive along California’s Interstate 280, aiming to generate positions and orientations in a global reference frame from over 2 million images. Huang et al. [29] created the ApolloScape dataset using a vehicle with dual scanners, up to six video cameras, and an integrated IMU/GNSS system to collect extensive road data, resulting in 143,906 annotated video frames for semantic segmentation. The database contains complex images of people, cars, and bicycles, utilizing 25 annotation labels for lane detection, object identification, and path prediction. Guiziliniet et al. [30] created the Dense Depth for Automated Driving (DDAD) dataset for self-driving cars, which includes 17,050 training images and 4150 evaluation images to predict the estimation of monocular depth in various urban scenes up to 200 m.
Previous studies used these datasets for autonomous drone navigation in unknown and dynamic environments. Zhang et al. [31] used the KITTI dataset, and they proposed a system based on a convolutional neural network (CNN) that uses depth images from an RGB camera to generate steering commands, using the angular velocity to avoid obstacles. This dataset allows their method to navigate only in a 2D environment. Arshad et al. [32] proposed a CNN architecture to predict the steering angle and forward speed of drones. An Udacity database was used to determine the steering angle, and a collision sequence database was used to detect obstacles. This approach allows drones to navigate only in 2D environments. Zhang et al. [33] utilized the NYU dataset to train a deep Q network (DQN) for drone controllers to avoid obstacles in cluttered and unexplored environments. The actions of the network are move forward, turn left, and turn right for navigation in a 2D environment. Kulkarni et al. [34] proposed depth cameras to navigate cluttered environments and used variational auto-encoders for collision prediction. They used the NYU dataset to train their method, which predicts collision scores for executing two actions: velocity and steering angle adjustments. Han et al. [35] proposed using deep learning and LSTM to learn spatial and temporal information, in addition to using the steering behavior to predict the steering angle. They used the comma2k19 and city datasets to train their neural network architecture. The system proposed by Cho et al. [36] involves using a UAV equipped with two RGB cameras to create a depth image to train a deep learning network aimed at determining an aircraft’s heading angle and speed for collision avoidance. The training used the KITTI, ApolloScape, and DDAD datasets. This system does not allow the UAV to navigate in the Z-axis.
Table 1 shows that the datasets collected from roads that have been created for object detection, steering angle, and collision data for autonomous navigation on roads. These databases are useful for drone navigation in two-dimensional environments but not in three-dimensional ones. The table also incorporates database collections from the interior of buildings, designed for drone navigation in corridors and object recognition within buildings. These databases work in two-dimensional environments, with actions labeled as right, left, or forward, and with the angular velocity. Table 1 shows that the databases do not label Z-axis navigation, despite the capability for drone navigation in three dimensions (X, Y, and Z).
Research has been carried out on adjusting the altitude of a drone during flight. Chronis et al. [11] proposed an approach for autonomous drone navigation using a UAV that is equipped with four distance sensors: three in the front and one on the bottom. Reinforcement learning uses sensor readings to perform forward movements and altitude adjustments. The experiments were carried out on the AirSim4 simulator, and the researchers stated that, in future work, they will attempt to replace these sensors with cameras to gain a greater perception of the surrounding environment.

3. Proposed Approach

Figure 1 illustrates the proposed approach, describing the platform and tools used to create the dataset. The platform used in this study is the Gazebo simulator [37], through which we can create many worlds. We created many worlds that mimic the real world using the unified robot description format (URDF) [38]. URDF files are utilized to simulate a robot and its environment in the Gazebo simulator, providing a standardized description of the robot’s physical and kinematic properties, such as dimensions and joint configurations [39]. To collect data, we used a quadcopter drone equipped with an RGB camera to capture images of these worlds. To control the drone in order to change its altitude and take pictures, we used the Python language. We used the robot operating system (ROS) to send commands to the drone. The ROS functions as a communication layer over the host operating systems in a heterogeneous compute cluster, rather than as a traditional operating system focused on process management and scheduling. The ROS supports four languages: Python, C++, LISP, and Octave [40]. The fundamental concepts of the ROS include nodes, messages, topics, and services. Nodes are computational processes that communicate with each other by passing messages. A node publishes messages to specific topics, while other nodes can subscribe to these topics to receive data. Multiple publishers and subscribers can exist for a single topic, facilitating peer-to-peer communication that can be represented as a graph [40]. The camera captures the image as ROS messages that are converted to an RGB image for storage in a folder.

3.1. Data Collection Platform

We use the Gazebo simulator version 11 to conduct our research [37]. The Gazebo simulator is a widely used tool in robotics research, providing environments for real-world robotic development processes [41]. It is integrated with the ROS, allowing it to work alongside real robots’ robotics stacks [41]. Gazebo also offers a model library for sensors such as cameras, GPSs, and IMUs, enabling users to import environments from digital elevation models [42]. We created many environments in the Gazebo simulator, including environments such as those of KSQL airport, sand islands, runways, and grass, and many obstacles, such as buildings of different designs, trees, and cars, have been added to these environments to simulate real environments. We used a quadcopter equipped with an RGB camera as shown in Figure 2 to capture the image from the Gazebo simulator. Drones capture images of the surrounding environment from various heights, capturing obstacles such as the ground and the building, the middle of the building, or its top. An image of the top of a building is also important to determine whether it is likely to be an obstacle. In addition, drones capture images of buildings from higher altitudes. It is important to recognize the appearance of buildings from above and realize that they are not obstacles. Therefore, drones capture views from multiple heights to gather comprehensive data; this helps in obstacle detection and flying at appropriate altitudes.

3.2. Obstacle Filtration Python Algorithm

We developed an obstacle filtration algorithm, designated as Algorithm 1, in Python language version 3.11. In the first command line, we launch the world we created in the Gazebo simulator. In line 2, we connect with the drone that appears in the Gazebo simulator. Line 3 prepares the drone for command reception, while line 4 specifies the desired flight height. We utilize the ROS to process the data captured by the camera. In command line number 5, we create the publisher node to read the sensor camera data. Then, in the next line, we create a topic name to publish the camera sensor data in this topic in order to process these data using any subscriber node. In command line 7, the camera captures the image from the world and then, in command line 8, we publish these data in the topic name to be used by any node. In order to process the data, we create the subscriber node that is subscribed to this topic, which then displays the image. To benefit from these data, we convert this image obtained as ROS messages to the RGB format through command line number 11, as depicted in Figure 3. The CvBridge library in the ROS is used for conversion and the OpenCV library in Python is used to display and save images. In line 12, we save the data in the folder for each image type. If there is an obstacle, the image is saved in the obstacle folder. The no-obstacle folder stores the image if there are no obstacles present. If it is an image of the horizon, it is saved in the horizon folder.
Algorithm 1 Obstacle filtration Python algorithm
 1:
Launch the world
 2:
Connect to drone
 3:
Set drone at mode guided
 4:
Drone takeoff to a specific altitude
 5:
Initializing the ROS node publisher
 6:
Creating topic name for image of camera
 7:
Capture the image by RGB camera
 8:
Publish image of camera to topic name
 9:
Initializing the ROS node subscriber
10:
Subscribe to topic name to read the image
11:
Convert the image from ROS format to RGB format
12:
Save image on folder with label
13:
Set drone at mode land

3.3. Classification of Obstacles and Non-Obstacles

We used many worlds in the Gazebo simulator to collect all image data, as shown in Figure 4 and Figure 5. These figures explain our method for collecting data, where data are collected from different altitudes, at which buildings appear as different shapes. In image (a) of each figure, the drone is hovering at the ground level, displaying the building as an obstacle blocking the drone’s path. In image (b) of each figure, the middle of the building is shown, which still represents an obstacle. In image (c) of each figure, the top of the building is captured, which still represents an obstacle for the drone. In image (d) of each figure, it is clear that the drone has risen above the building; thus, the captured image does not represent an obstacle for the drone.
Figure 6 shows the images taken by a drone while hovering close to the ground, where images (a,b) show the obstacles along with the ground, while images (c,d) depict only the ground without obstacles. The drone moves upward to capture the images of the middle of the building in order to show its various forms in the dataset. Images (a,d) in Figure 7 show the middle of the building as an obstacle, while images (c,d) do not. Furthermore, our dataset includes images of the tops of buildings to identify whether the top either does or does not represent an obstacle for drones, as shown in Figure 8, where the tops represent an obstacle in images (a,b), while in images (c,d) the tops do not represent an obstacle.

3.4. Horizon Scene

The horizon is an important factor in an autonomous drone flight. If the drone’s altitude varies, then the horizon’s height varies in the scene captured by the drone. The drone must recognize all horizons and ensure that they do not obstruct its flight path. If the drone flies at high altitudes, as shown in Figure 9, then the scene captured by the drone’s camera becomes almost entirely a horizon. The horizon gets bigger as the drone gets higher until the whole scene becomes a horizon. Figure 10 shows the size of the horizon that appears based on the altitude of the drone. In image (a), the land is half of the scene, and the other half is the horizon. In image (b), the horizon is half the scene, and in image (c), it is two-thirds of the scene. The horizon continues to increase until it almost becomes the entire scene in image (d), and it is the entire scene in image (e). In the Gazebo simulator, the KSQL airport was utilized to simulate the city horizon, as shown in Figure 11. Image (a) displays the city with buildings and the horizon, which progressively expands in images (b), (c), and (d), making the buildings appear shorter. By image (e), the entire scene consists of just the horizon. This technique helps to visualize the city’s horizon from inside.
UAV instability can be caused by various disturbances such as wind, temperature, air pressure, and aerodynamic effects  [21]. Therefore, the design of altitude and position controllers for quadrotors presents a significant challenge due to their unstable nature [43]. Drones can be dynamically adjusted for roll, pitch, and yaw angles while in flight [44,45], as shown in Figure 12. Therefore, the scene may appear as just the horizon when the drone is flying at low altitudes. The rotation of the drone along the pitch angles can cause the horizon scene to constitute the entirety of the captured image, as depicted in Figure 13a. This can cause the drone to perceive the scene as an obstacle, resulting in an incorrect action. To prevent this, it is crucial to train the drone to view the horizon scene as a horizon rather than an obstacle.

3.5. Brightness

The Gazebo simulator allows users to alter the light in the environment to mimic the real world, allowing for day or night settings and adding spotlights in specific areas to simulate the real world. Figure 14 illustrates the variations in scene light, with image (a) depicting the night, image (b) showing the sun shining, and image (c) showing higher brightness, which allows us to simulate the real world in our database. Figure 15 displays image (a), which lacks brightness; image (b), which has high brightness; and image (c), which is extremely bright and, as such, in which some details of the building are hidden.

4. Dataset Evaluation

In this section, we describe the evaluation of our dataset using a CNN and a drone, which we used to perform four types of experiments in the Gazebo simulator, as shown in Figure 16. These evaluations include evaluating flying over obstacles, evaluating the horizon view, evaluating flying alongside an obstacle, and evaluating brightness. We explain each evaluation in the corresponding subsection.

4.1. CNN

A CNN model was developed to classify images into three categories: non-obstacle, obstacle, or horizon. The drone collected 39,960 images, and the dataset is organized into training, test, and validation sets, with each set containing three categories of images: obstacle images, no obstacle images, and horizon images. Figure 17 shows the CNN designed to classify images into three categories: no-obstacle, obstacle, and horizon. The images, initially captured at 640 × 640 pixels by an RGB camera, were resized to 200 × 200 pixels and normalized to map the pixel value in the range of 0–255 for faster processing. The first convolutional layer used 32 filters of size 3 × 3, followed by max pooling of size 2 × 2 to extract features and reduce the dimensions of the image. This process was repeated before the data were processed through fully connected layers, followed by hidden layers with 128 neurons utilizing the ReLU activation function. The output layer applied the SoftMax activation function for classification. The CNN was trained for 30 epochs, and the accuracy result was 99%, as shown in Figure 18a. The verification result was 98% using the validation data displayed in the confusion matrix in Figure 18b, where 0 indicates no obstacles, 1 indicates obstacles, and 2 indicates the horizon.

4.2. Evaluation of Flying over Obstacles Using a Drone

In this subsection, we describe the validation of the effectiveness of our dataset by navigating the drone in the Gazebo simulator using the CNN model. We developed a Python Algorithm 2 to carry out six experiments. Command line 1 of the code launches the simulation environment in Gazebo. In line 2, a connection is made with the drone to navigate it within the Gazebo simulator as well as to change the drone’s mode to receive commands. To process the camera sensor data, we create an ROS publisher node and a topic name to store the data for use with any ROS subscriber node. We then create a subscriber node. Lines 7 and 8 specify the target and drone location within the environment. To start the drone’s mission, line 10 creates a while loop that continues until the drone reaches the target. Lines 11 to 14 are responsible for capturing the image from the simulation environment in Gazebo, after which it is converted to the RGB format. Then, in line 15, the image is fed into the CNN model, which has been trained to predict whether the image is an obstacle, a non-obstacle, or a horizon. In lines 15 to 22, three actions are defined. For example. if there is an obstacle, the drone moves upward; if there is no obstacle, it moves forward to reach the target; and if there is a horizon, it goes downward because its altitude has become too high. Line 23 sends a command to the drone to execute in the Gazebo simulator. The drone continues the mission until it reaches the target.
Six experiments were carried out using Algorithm 2 to demonstrate the efficiency of the dataset in maintaining optimal flight altitudes. The tests involved detecting various obstacles at different heights and avoiding them while not flying too high. Figure 19 illustrates the first experiment. The target was placed after the bus to test the database’s ability to detect an obstacle and allow the drone to pass over it to reach the target. In the second experiment, shown in Figure 20, we changed the obstacle to trees and placed the target after the tree. We placed higher obstacles in the third experiment, shown in Figure 21. This building was higher than the bus and trees, and we tested whether the drone could cross the building and reach the target. In the fourth experiment, shown in Figure 22, we increased the distance the drone traveled by increasing the number of buildings in order to test the drone’s ability to cross this distance and reach the target. Figure 23 shows the fifth experiment, which featured a 15-meter-high school. The sixth experiment involved evaluating the drone’s navigation capabilities within an urban environment, as shown in Figure 24.
Algorithm 2 Autonomous navigation algorithm for flying over obstacles.
 1: Launch the world
 2: Connect to drone
 3: Set drone at mode guided
 4: Initializing the ROS node publisher
 5: Creating topic name for image of camera
 6: Initializing the ROS node subscriber
 7: Ldrone▹ the location of the drone
 8: Ltarget▹ the location of the target
 9: Takeoff at 1 m
10: while  L d r o n e L t a r g e t  do
11:      Capture the image by RGB camera
12:      publish image of camera to topic name
13:      Subscribe to topic name to read the image
14:      Convert the image from ROS format OpenCV with RGB format
15:       R e s u l t C N N ( i m a g e ) ▹ input the image in CNN
16:      if  R e s u l t == n o o b s t a c l e  then
17:            A c t i o n f o r w a r d
18:      else if  R e s u l t == o b s t a c l e  then
19:            A c t i o n u p w a r d
20:      else  R e s u l t == H o r i z o n
21:            A c t i o n d o w n w a r d
22:      end if
23:       G a z e b o d r o n e ( A c t i o n )
24:      Ldrone▹ the location of the drone
25: end while

4.3. Horizon View Evaluation for Drone

In this subsection, we describe how three experiments were performed to evaluate horizon images and their ability to control drone altitude. Can these images, through training, be used to lower the altitude of the drone when it has reached a high altitude? In these experiments, we used the Gazebo simulator, a drone, and a trained CNN model. We used Algorithm 3, which is similar to Algorithm 2 but with one code line edited, i.e., line 9 in which the drone mission begins when it reaches an altitude specified in the algorithm. We make the drone reach this altitude, after which it begins heading towards the target. The rest of the algorithm is the same as Algorithm 2.
In the seventh experiment, shown in Figure 25, we allow the drone to reach an altitude of 100 m and then guide it toward a target at a distance of 30 m. This experiment tests if a drone can recognize its high altitude through camera view and can adjust its altitude accordingly. Moreover, we allow the drone to reach an altitude of 100 m in the eighth experiment, shown in Figure 26, but in another environment, a city environment, to test its recognition of the horizon of the city. In the ninth experiment, shown in Figure 27, we allow the drone to reach an altitude of 150 m to test its recognition of higher altitudes, assessing whether the drone realizes that it is at a high altitude and needs to descend to a lower altitude.
Algorithm 3 Autonomous navigation algorithm for reaching an appropriate altitude
 1: Launch the world
 2: Connect to drone
 3: Set drone at mode guided
 4: Initializing the ROS node publisher
 5: Creating topic name for image of camera
 6: Initializing the ROS node subscriber
 7: Ldrone▹ the location of the drone
 8: Ltarget▹ the location of the target
 9: Takeoff at altitude▹ altitude=100, altitude=150
10: while  L d r o n e L t a r g e t  do
11:      Capture the image by RGB camera
12:      publish image of camera to topic name
13:      Subscribe to topic name to read the image
14:      Convert the image from ROS format OpenCV with RGB format
15:       R e s u l t C N N ( i m a g e ) ▹ input the image in CNN
16:      if  R e s u l t == n o o b s t a c l e  then
17:            A c t i o n f o r w a r d
18:      else if  R e s u l t == o b s t a c l e  then
19:            A c t i o n u p w a r d
20:      else  R e s u l t == H o r i z o n
21:            A c t i o n d o w n w a r d
22:      end if
23:       G a z e b o d r o n e ( A c t i o n )
24:      Ldrone▹ the location of the drone
25: end while

4.4. Evaluation of Flying Alongside Obstacles

In this subsection, we describe how the tenth experiment was performed, as shown in Figure 28, to evaluate the avoidance of obstacles by flying alongside the obstacle and passing through a narrow gap to reach the target. We use Algorithm 4, which is the same as Algorithm 2, but if there is an obstacle, instead of choosing upward movement, the algorithm chooses right movement. These experiments evaluate the efficiency of the database in training the drone to recognize all aspects of the obstacle. In the tenth experiment, we set a target 15 m from the launch point and include walls and a narrow gap between them to test the drone’s ability to pass through the narrow gap.
Algorithm 4 Autonomous navigation algorithm for flying alongside obstacles.
 1: Launch the world
 2: Connect to drone
 3: Set drone at mode guided
 4: Initializing the ROS node publisher
 5: Creating topic name for image of camera
 6: Initializing the ROS node subscriber
 7: Ldrone▹ the location of the drone
 8: Ltarget▹ the location of the target
 9: Takeoff at 3 m
10: while  L d r o n e L t a r g e t  do
11:      Capture the image by RGB camera
12:      publish image of camera to topic name
13:      Subscribe to topic name to read the image
14:      Convert the image from ROS format OpenCV with RGB format
15:       R e s u l t C N N ( i m a g e ) ▹ input the image in CNN
16:      if  R e s u l t == n o o b s t a c l e  then
17:            A c t i o n f o r w a r d
18:      else if  R e s u l t == o b s t a c l e  then
19:            A c t i o n R i g h t
20:      else  R e s u l t == H o r i z o n
21:            A c t i o n d o w n w a r d
22:      end if
23:       G a z e b o d r o n e ( A c t i o n )
24:      Ldrone▹ the location of the drone
25: end while

4.5. Brightness Evaluation

We evaluated the ability of the drone to recognize obstacles and the target in bright scenes. In the experiment shown in Figure 29, we placed a spotlight in front of the drone so that the scene in front of it appeared bright and tested whether the drone was able to recognize obstacles and reach the target. In this experiment, we used Algorithm 4. Furthermore, to evaluate navigation under different lighting conditions, the fifth experiment evaluated the drone’s nighttime navigation capabilities, as is shown in Figure 23.

4.6. Results and Discussion

Figure 19 shows the first experiment in which the drone avoids a bus obstacle, flies over it, and then reaches the target. The drone was able to detect the middle and top of the bus as an obstacle, and while crossing over the bus, the drone did not have to rise higher but rather maintained a suitable height that allowed it to pass over the bus. In the second experiment, as shown in Figure 20, we tested the efficiency of the dataset using another type of obstacle, i.e., trees. The trees were higher than the bus, as shown in Table 2. However, the drone was able to detect the trees as an obstacle, pass over them, and reach the target. Detection involved the drone recognizing branches and leaves as obstacles. In the third experiment, shown in Figure 21 the drone was able to detect the building, representing an obstacle, while flying over it. It recognized the middle of the building as an obstacle as well as its top. In the fourth experiment, as depicted in Figure 22, we added more than one building to test the drone’s ability to avoid these buildings and recognize obstacles at different heights. It succeeded in avoiding these buildings and reaching the target while maintaining a suitable flight height. In the fifth experiment, as depicted in Figure 23, the drone flew at an altitude of 0.5 m above a 15-meter-high school while navigating over it. In the sixth experiment, as shown in Figure 24, the drone successfully navigated within the city, flew over buildings, and reached a target located 60 m from the starting point.
Table 2 shows the details of the experiments in which the drone successfully reached the target without collisions. This table shows that the drone was able to avoid obstacles of different heights and types and also traveled different distances while maintaining an appropriate height that allowed it to avoid obstacles and reach the target. The drone consistently maintained a small distance between the obstacle and the drone’s maximum altitude in all six experiments, with distances varying from 0.5 m more than the obstacle length in the first, second, and fifth experiments; 1 m in the third and sixth experiments; and 2 m in the fourth experiment.
Figure 25 shows the implementation of the seventh experiment. Image (a) shows the start of the experiment, with the drone at an altitude of 100 m. The drone did not start heading toward the target but instead started lowering its altitude because it realized that it was at a high altitude, as shown in images (b–d). When it reached an altitude of 76 m, it started heading toward the target, as it realized through the trained CNN model that it had reached a suitable altitude, as shown in image (e). It subsequently reached the target at an altitude of 67 m, as shown in image (f). Moreover, the trained CNN model lowered the drone’s altitude from 100 m to 76 m, as depicted in the eighth experiment shown in Figure 26, which proves the efficacy of our database in recognizing the city horizon. The greatest altitude drop occurred in the ninth experiment, where the drone dropped from an altitude of 150 to 76 m before starting to head toward the target, which was 30 m away, as shown in Figure 27. These three experiments demonstrated the effectiveness of the dataset in training the drones to perceive the horizon, which enables them to perceive the height they have reached and, based on this perception, determine whether they should descend or remain at the same height.
Table 3 shows the details of the horizon perception experiments. In the seventh and eighth experiments, the drone descended 24 m before heading to the target, which it reached when it was at an altitude of 67 m in the seventh experiment and 69 m in the eighth experiment. For the ninth experiment, the drone descended 74 m before heading to the target, which it reached when its altitude was 69 m. Table 3 shows the efficiency of the dataset in making the drone fly at the appropriate height.
The tenth experiment is shown in Figure 28, in which the drone detected that the wall was an obstacle in its path, so it headed to the right until it found a narrow gap between the two walls and was able to pass through it to reach the target. Table 4 shows the details of the tenth experiment, which demonstrates the ability of the dataset to train the drone to avoid obstacles by flying alongside them and passing through narrow gaps. This experiment demonstrated the effectiveness of the dataset in recognizing all aspects of the obstacle.
Table 5 provides detailed information on navigation experiments conducted under various light conditions. Figure 23 showcases the drone’s night navigation capabilities based on various training data collected during the daytime and evening. Figure 29 shows the drone’s ability to distinguish obstacles despite the brightness of the scene captured by the camera. This is due to the database that trained the drone in bright scenes. The drone was able to avoid collisions and cross the narrow gap to reach the target.
During the experiments, these algorithms ran on the screen, and we took a screenshot to show the execution data that they displayed. Therefore, to provide clarity on the implementation details in all experiments, Figure 30 shows the detailed implementation of Algorithms 2 and 3, showing the result of each movement made by the drone. This figure also shows the result of the CNN’s prediction of the image captured by the camera. We note in Figure 30a that the result is 1, indicating that the CNN predicted that there was an obstacle; thus, the drone moved upward. In Figure 30b, the result is 2, indicating that the CNN predicted that there was a horizon; thus, the drone moved downward. In addition, the location and altitude of the drone are shown in Figure 30a,b. This study shows that running the CNN on a laptop with an Intel(R) Core(TM) i7-10750H CPU at 2.60 GHz takes 48 ms, as shown in Figure 30. This quick processing time indicates that the algorithm can effectively operate on a drone in the real world. Furthermore, experiments have shown that applying the algorithm to a drone moving at a speed of 0.3 m per second makes it capable of navigating and avoiding any collision with an obstacle.
The dataset detects the shapes of obstacles at different altitudes and detects the horizon, which helps to control the altitude of the drone. Therefore, based on these experiments that prove the efficiency of our database, we hope that researchers use our database to develop a method for controlling drones based on the task the drones are programmed to execute. Our experiments demonstrate that our dataset enables autonomous navigation in a 3D environment, unlike other datasets mentioned in Table 1, which only support autonomous navigation in a 2D environment. Additionally, only one article [11] has proposed adjusting the altitude of a drone during flight, and the authors in this study mentioned that they will use cameras in their future work to increase the perception of environment, as the distance sensor they used only perceived small points of the environment. In contrast, our database can make drones more perceptive of their environment and assist them in adjusting their altitude.
The experiments indicate that, if the drone rotates around its pitch axis, the horizon could appear at low altitudes, whereas if the drone rotates around its roll axis, the CNN algorithm could receive data that were not covered in its training, as shown in Figure 31. Therefore, to navigate in this mode, the drone must be trained on images captured during rotation around its roll axis.

5. Conclusions and Future Work

This study introduces a new dataset for autonomous drone navigation in 3D environments to address the lack of resources for drone training in these environments. The currently available datasets are primarily for self-driving cars or for indoor navigation. Our dataset enables drones to avoid obstacles and fly at an appropriate altitude during their mission. We developed an algorithm to collect images from the Gazebo simulator by capturing different views of obstacles using a drone, including their base, middle, and top. A drone might perceive the horizon as an obstacle during 3D navigation, leading to misdirection. Hence, we added the horizon image to our dataset in order to train the drone to perceive this image as a horizon instead of an obstacle. Furthermore, we used horizon images to modify the drone’s altitude. We classified the images in our dataset into three categories: no-obstacle, obstacle, and horizon images. A CNN model validated data quality, achieving a prediction score of 98%. Furthermore, eleven experiments performed using the Gazebo simulator demonstrated the ability of the drone to avoid obstacles, fly over them, and reach its target while maintaining appropriate altitudes throughout the flight using the dataset. The first six experiments show that our database enables the drone to detect obstacles of different shapes from various heights and successfully avoid them by flying over them. Moreover, experiments seven to nine demonstrate that our database enables the drone to adjust its altitude based on the horizon scene. The tenth experiment shows the efficiency of our database by enabling the drone to detect all aspects of obstacles and avoid collisions by passing beside them and passing through a narrow gap. To test the drone’s capability to navigate under various lighting conditions, the eleventh experiment showcases the drone’s capability to navigate in bright scene conditions, and the fifth experiment showcases the drone’s capability to navigate at night. Experiments revealed flaws in the drone’s performance due to the images displayed during its roll angle rotation, which are not included in our dataset. In future work, we will add images to the dataset to enable the drone to navigate when rotating around its roll angle.

Author Contributions

Conceptualization, T.A.; Methodology, T.A., M.K. and F.E.; Software, T.A.; Validation, T.A. and M.K.; Formal analysis, K.J.; Resources, T.A.; Writing—original draft, T.A.; Writing—review & editing, K.J., M.K. and F.B.; Visualization, T.A. and F.B.; Supervision, K.J. and M.K.; Project administration, F.E. All authors have read and agreed to the published version of the manuscript.

Funding

The project was funded by KAU Endowment (WAQF) at king Abdulaziz University, Jeddah, Saudi Arabia. The authors, therefore, acknowledge with thanks WAQF and the Deanship of Scientific Research (DSR) for technical and financial support.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
UAVunmanned aerial vehicle
DLdeep learning
2Dtwo dimensions
3Dthree dimensions
IoTInternet of things
CNNconvolution Neural Networks
ROSrobot operating system
URDFunified robot description format
IMUInertial Measurement Unit
GPSglobal Positioning System

References

  1. Alsamhi, S.H.; Shvetsov, A.V.; Kumar, S.; Shvetsova, S.V.; Alhartomi, M.A.; Hawbani, A.; Rajput, N.S.; Srivastava, S.; Saif, A.; Nyangaresi, V.O. UAV computing-assisted search and rescue mission framework for disaster and harsh environment mitigation. Drones 2022, 6, 154. [Google Scholar] [CrossRef]
  2. Shirabayashi, J.V.; Ruiz, L.B. Toward UAV Path Planning Problem Optimization Considering the Internet of Drones. IEEE Access 2023, 11, 136825–136854. [Google Scholar] [CrossRef]
  3. Ariante, G.; Del Core, G. Unmanned Aircraft Systems (UASs): Current State, Emerging Technologies, and Future Trends. Drones 2025, 9, 59. [Google Scholar] [CrossRef]
  4. Zeng, Y.; Wu, Q.; Zhang, R. Accessing From the Sky: A Tutorial on UAV Communications for 5G and Beyond. Proc. IEEE 2019, 107, 2327–2375. [Google Scholar] [CrossRef]
  5. Aggarwal, S.; Kumar, N. Path planning techniques for unmanned aerial vehicles: A review, solutions, and challenges. Comput. Commun. 2020, 149, 270–299. [Google Scholar] [CrossRef]
  6. Chandran, N.K.; Sultan, M.T.H.; Łukaszewicz, A.; Shahar, F.S.; Holovatyy, A.; Giernacki, W. Review on type of sensors and detection method of anti-collision system of unmanned aerial vehicle. Sensors 2023, 23, 6810. [Google Scholar] [CrossRef]
  7. Mikołajczyk, T.; Mikołajewski, D.; Kłodowski, A.; Łukaszewicz, A.; Mikołajewska, E.; Paczkowski, T.; Macko, M.; Skornia, M. Energy sources of mobile robot power systems: A systematic review and comparison of efficiency. Appl. Sci. 2023, 13, 7547. [Google Scholar] [CrossRef]
  8. Pandey, P.; Shukla, A.; Tiwari, R. Aerial path planning using meta-heuristics: A survey. In 2017 Second International Conference on Electrical, Computer and Communication Technologies (ICECCT); Publishing House: Tamil Nadu, India, 2017; pp. 1–7. [Google Scholar]
  9. Xie, R.; Meng, Z.; Wang, L.; Li, H.; Wang, K.; Wu, Z. Unmanned Aerial Vehicle Path Planning Algorithm Based on Deep Reinforcement Learning in Large-Scale and Dynamic Environments. IEEE Access 2021, 9, 24884–24900. [Google Scholar] [CrossRef]
  10. Tan, C.S.; Mohd-Mokhtar, R.; Arshad, M.R. A comprehensive review of coverage path planning in robotics using classical and heuristic algorithm. IEEE Access 2021, 9, 119310–119342. [Google Scholar] [CrossRef]
  11. Chronis, C.; Anagnostopoulos, G.; Politi, E.; Dimitrakopoulos, G.; Varlamis, I. Dynamic Navigation in Unconstrained Environments Using Reinforcement Learning Algorithms. IEEE Access 2023, 11, 117984–118001. [Google Scholar] [CrossRef]
  12. Elmokadem, T.; Savkin, A.V. Towards fully autonomous UAVs: A survey. Sensors 2025, 21, 6223. [Google Scholar] [CrossRef] [PubMed]
  13. Chang, Y.; Cheng, Y.; Murray, J.; Huang, S.; Shi, G. The hdin dataset: A real-world indoor uav dataset with multi-task labels for visual-based navigation. Drones 2022, 6, 202. [Google Scholar] [CrossRef]
  14. Loquercio, A.; Maqueda, A.I.; Del-Blanco, C.R.; Scaramuzza, D. Dronet: Learning to fly by driving. IEEE Robot. Autom. Lett. 2018, 3, 1088–1095. [Google Scholar] [CrossRef]
  15. Geiger, A.; Lenz, P.; Stiller, C.; Urtasun, R. Vision meets robotics: The kitti dataset. Int. J. Robot. Res. 2013, 32, 1231–1237. [Google Scholar] [CrossRef]
  16. Silva, M.; Seoane, A.; Mures, O.A.; López, A.M.; Iglesias-Guitian, J.A. Exploring the effects of synthetic data generation: A case study on autonomous driving for semantic segmentation. Vis. Comput. 2025, 10, 1–19. [Google Scholar] [CrossRef]
  17. Li, F.; Sun, F.; Zhang, T.; Zou, D. VisFly: An Efficient and Versatile Simulator for Training Vision-based Flight. arXiv 2024, arXiv:2407.14783. [Google Scholar]
  18. Barisic, A.; Petric, F.; Bogdan, S. Sim2air-synthetic aerial dataset for uav monitoring. IEEE Robot. Autom. Lett. 2022, 7, 3757–3764. [Google Scholar] [CrossRef]
  19. Tobin, J.; Fong, R.; Ray, A.; Schneider, J.; Zaremba, W.; Abbeel, P. Domain randomization for transferring deep neural networks from simulation to the real world. In Proceedings of the 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Vancouver, BC, Canada, 24–28 September 2017; pp. 23–30. [Google Scholar]
  20. Doukhi, O.; Lee, D.J. Deep reinforcement learning for autonomous map-less navigation of a flying robot. IEEE Access 2022, 10, 82964–82976. [Google Scholar] [CrossRef]
  21. Gomez, V.; Gomez, N.; Rodas, J.; Paiva, E.; Saad, M.; Gregor, R. Pareto optimal pid tuning for px4-based unmanned aerial vehicles by using a multi-objective particle swarm optimization algorithm. Aerospace 2020, 7, 71. [Google Scholar] [CrossRef]
  22. Silberman, N.; Hoiem, D.; Kohli, P.; Fergus, R. Indoor segmentation and support inference from rgbd images. In Proceedings of the Computer Vision–ECCV 2012: 12th European Conference on Computer Vision, Florence, Italy, 7–13 October 2012; pp. 746–760. [Google Scholar]
  23. Padhy, R.P.; Verma, S.; Ahmad, S.; Choudhury, S.K.; Sa, P.K. Deep neural network for autonomous UAV navigation in indoor corridor environment. Procedia Comput. Sci. 2018, 133, 643–650. [Google Scholar] [CrossRef]
  24. Kouris, A.; Bouganis, C.S. Learning to fly by myself: A self-supervised cnn-based approach for autonomous navigation. In Proceedings of the 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Madrid, Spain, 1–5 October 2018; pp. 1–9. [Google Scholar]
  25. Garcia, A.; Mittal, S.S.; Kiewra, E.; Ghose, K. A convolutional neural network feature detection approach to autonomous quadrotor indoor navigation. In Proceedings of the 2019 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Macau, China, 3–8 November 2019; pp. 74–81. [Google Scholar]
  26. Yang, Z.; Zhang, Y.; Yu, J.; Cai, J.; Luo, J. End-to-end multi-modal multi-task vehicle control for self-driving cars with visual perceptions. In Proceedings of the 2018 24th International Conference on Pattern Recognition (ICPR), Beijing, China, 20–24 August 2018; pp. 2289–2294. [Google Scholar]
  27. Udacity. Public Driving Dataset. Available online: https://www.udacity.com (accessed on 7 March 2017).
  28. Schafer, H.; Santana, E.; Haden, A.; Biasini, R. A commute in data: The comma2k19 dataset. arXiv 2018, arXiv:1812.05752. [Google Scholar]
  29. Huang, X.; Cheng, X.; Geng, Q.; Cao, B.; Zhou, D.; Wang, P.; Lin, Y.; Yang, R. The apolloscape dataset for autonomous driving. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, Salt Lake City, UT, USA, 18–22 June 2018; pp. 954–960. [Google Scholar]
  30. Guizilini, V.; Ambrus, R.; Pillai, S.; Raventos, A.; Gaidon, A. 3d packing for self-supervised monocular depth estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 14–19 June 2020; pp. 2485–2494. [Google Scholar]
  31. Zhang, N.; Nex, F.; Vosselman, G.; Kerle, N. End-to-End Nano-Drone Obstacle Avoidance for Indoor Exploration. Drones 2024, 8, 33. [Google Scholar] [CrossRef]
  32. Arshad, M.A.; Khan, S.H.; Qamar, S.; Khan, M.W.; Murtza, I.; Gwak, J. Drone navigation using region and edge exploitation-based deep CNN. IEEE Access 2022, 10, 95441–95450. [Google Scholar] [CrossRef]
  33. Singla, A.; Padakandla, S.; Bhatnagar, S. Memory-based deep reinforcement learning for obstacle avoidance in UAV with limited environment knowledge. IEEE Trans. Intell. Transp. Syst. 2019, 22, 107–118. [Google Scholar] [CrossRef]
  34. Kulkarni, M.; Nguyen, H.; Alexis, K. Semantically-enhanced deep collision prediction for autonomous navigation using aerial robots. In Proceedings of the 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Detroit, MI, USA, 1–5 October 2023; Publishing House: Detroit, MI, USA, 2023; pp. 3056–3063. [Google Scholar]
  35. Han, L.; Wu, L.; Liang, F.; Cao, H.; Luo, D.; Zhang, Z.; Hua, Z. A novel end-to-end model for steering behavior prediction of autonomous ego-vehicles using spatial and temporal attention mechanis. Neurocomputing 2022, 490, 295–311. [Google Scholar] [CrossRef]
  36. Cho, E.; Kim, H.; Kim, P.; Lee, H. Obstacle Avoidance of a UAV Using Fast Monocular Depth Estimation for a Wide Stereo Camera. IEEE Trans. Ind. Electron. 2025, 72, 1763–1773. [Google Scholar] [CrossRef]
  37. Koenig, N.; Howard, A. Design and use paradigms for Gazebo, an open-source multi-robot simulator. In Proceedings of the 2004 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) (IEEE Cat. No.04CH37566), Sendai, Japan, 28 September–2 October 2004; Volume 3, pp. 2149–2154. [Google Scholar]
  38. Tola, D.; Corke, P. Understanding urdf: A dataset and analysis. IEEE Robot. Autom. Lett. 2024, 9, 4479–4486. [Google Scholar] [CrossRef]
  39. Singh, M.; Kapukotuwa, J.; Gouveia, E.L.S.; Fuenmayor, E.; Qiao, Y.; Murray, N.; Devine, D. Comparative Study of Digital Twin Developed in Unity and Gazebo. Electronics 2025, 14, 276. [Google Scholar] [CrossRef]
  40. Quigley, M.; Gerkey, B.; Conley, K.; Faust, J.; Foote, T.; Leibs, J.; Berger, E.; Wheeler, R.; Ng, A. ROS: An open-source Robot Operating System. In Proceedings of the ICRA Workshop on Open Source Software, Kobe, Japan, 12–17 May 2009; Volume 3, p. 5. [Google Scholar]
  41. Zhao, W.; Queralta, J.P.; Westerlund, T.A. Sim-to-real transfer in deep reinforcement learning for robotics: A survey. In Proceedings of the 2020 IEEE Symposium Series on Computational Intelligence (SSCI), Canberra, Australia, 1–4 December 2020; pp. 737–744. [Google Scholar]
  42. Collins, J.; Chand, S.; Vanderkop, A.; Howard, D. A review of physics simulators for robotic applications. IEEE Access 2021, 9, 51416–51431. [Google Scholar] [CrossRef]
  43. Cardenas, J.A.; Carrero, U.E.; Camacho, E.C.; Calderon, J.M. Intelligent position controller for unmanned aerial vehicles (UAV) based on supervised deep learning. Machines 2023, 11, 606. [Google Scholar] [CrossRef]
  44. Farid, U.; Khan, B.; Mehmood, C.A.; Ali, M.; Shi, Y. Coordinated Heterogeneous UAVs for Trajectory Tracking and Irregular Payload Transportation Using Sliding Mode Contro. Drones 2025, 9, 314. [Google Scholar] [CrossRef]
  45. Giernacki, W.; Gośliński, J.; Goślińska, J.; Espinoza-Fraire, T.; Rao, J. Mathematical modeling of the coaxial quadrotor dynamics for its attitude and altitude control. Energies 2021, 14, 1232. [Google Scholar] [CrossRef]
Figure 1. Dataset creation framework.
Figure 1. Dataset creation framework.
Drones 09 00406 g001
Figure 2. The images are collected from the Gazebo simulator using a quadcopter equipped with an RGB camera.
Figure 2. The images are collected from the Gazebo simulator using a quadcopter equipped with an RGB camera.
Drones 09 00406 g002
Figure 3. The image processing path obtained with the ROS and Python. Publisher node 1 captures data from a camera sensor and publishes it to the “webcam/images” topic. Subscriber node 2 subscribes to this topic to process the images. CvBridge is an ROS library that serves as an interface between the ROS and OpenCV, enabling image conversion from ROS to RGB.
Figure 3. The image processing path obtained with the ROS and Python. Publisher node 1 captures data from a camera sensor and publishes it to the “webcam/images” topic. Subscriber node 2 subscribes to this topic to process the images. CvBridge is an ROS library that serves as an interface between the ROS and OpenCV, enabling image conversion from ROS to RGB.
Drones 09 00406 g003
Figure 4. Images (ad) show the drone hovering at different altitudes to capture images from the runway.
Figure 4. Images (ad) show the drone hovering at different altitudes to capture images from the runway.
Drones 09 00406 g004
Figure 5. Images (ad) show the drone hovering at different altitudes to capture images from KSQL airport.
Figure 5. Images (ad) show the drone hovering at different altitudes to capture images from KSQL airport.
Drones 09 00406 g005
Figure 6. Images were captured by a drone hovering close to the ground. In the dataset, images (a,b) showing trees and walls are labeled with the number 1 to indicate obstacles for the drone, while images (c,d) of the building are labeled with 0 to signify no obstacles.
Figure 6. Images were captured by a drone hovering close to the ground. In the dataset, images (a,b) showing trees and walls are labeled with the number 1 to indicate obstacles for the drone, while images (c,d) of the building are labeled with 0 to signify no obstacles.
Drones 09 00406 g006
Figure 7. Images of the middle of a building are captured as a drone ascends slightly above the ground. Images (a,b) are labeled with the number 1 to signify obstacles for the drone in our dataset. Images (c,d) are labeled with 0 to signify no obstacles.
Figure 7. Images of the middle of a building are captured as a drone ascends slightly above the ground. Images (a,b) are labeled with the number 1 to signify obstacles for the drone in our dataset. Images (c,d) are labeled with 0 to signify no obstacles.
Drones 09 00406 g007
Figure 8. The images were captured by a drone hovering close to the top of the obstacles. In the dataset, images (a,b) are labeled with the number 1 to indicate obstacles for the drone, while images (c,d) are labeled with 0 to signify no obstacles.
Figure 8. The images were captured by a drone hovering close to the top of the obstacles. In the dataset, images (a,b) are labeled with the number 1 to indicate obstacles for the drone, while images (c,d) are labeled with 0 to signify no obstacles.
Drones 09 00406 g008
Figure 9. A quadcopter capturing a horizon scene.
Figure 9. A quadcopter capturing a horizon scene.
Drones 09 00406 g009
Figure 10. The horizon is half of the scene in image (a), and it expands in the following images until the horizon is the entire scene in image (e). Images (a,b) are labeled with the number 0 to indicate no obstacles for the drone, while images (ce) are labeled with 2 to signify the horizon.
Figure 10. The horizon is half of the scene in image (a), and it expands in the following images until the horizon is the entire scene in image (e). Images (a,b) are labeled with the number 0 to indicate no obstacles for the drone, while images (ce) are labeled with 2 to signify the horizon.
Drones 09 00406 g010
Figure 11. The horizon is half of the scene in image (a), and it expands in the following images until the horizon is the entire scene in image (e). Images (a,b) are labeled with the number 0 to indicate no obstacles for the drone, while images (ce) are labeled with 2 to signify the horizon.
Figure 11. The horizon is half of the scene in image (a), and it expands in the following images until the horizon is the entire scene in image (e). Images (a,b) are labeled with the number 0 to indicate no obstacles for the drone, while images (ce) are labeled with 2 to signify the horizon.
Drones 09 00406 g011
Figure 12. Drone rotation during flight. The yaw angle is the rotation around the Z-axis. The roll angle is the rotation around the X-axis. The pitch angle is the rotation around the Y-axis.
Figure 12. Drone rotation during flight. The yaw angle is the rotation around the Z-axis. The roll angle is the rotation around the X-axis. The pitch angle is the rotation around the Y-axis.
Drones 09 00406 g012
Figure 13. In image (a), the horizon represents the entire scene captured by the camera due to the rotation of the drone around the Y-axis. In image (b), the view captured by the camera includes the ground as well as the horizon because the drone is not rotating around the Y-axis.
Figure 13. In image (a), the horizon represents the entire scene captured by the camera due to the rotation of the drone around the Y-axis. In image (b), the view captured by the camera includes the ground as well as the horizon because the drone is not rotating around the Y-axis.
Drones 09 00406 g013
Figure 14. The database includes images captured during the day and the night. Image (a): a night scene; image (b): a scene with sunlight; image (c): a high-brightness scene.
Figure 14. The database includes images captured during the day and the night. Image (a): a night scene; image (b): a scene with sunlight; image (c): a high-brightness scene.
Drones 09 00406 g014
Figure 15. The database includes an image with high brightness. In image (a), the scene is not bright. In image (b), the right side of the building is bright. In image (c), the brightness on the right side of the building hides its details.
Figure 15. The database includes an image with high brightness. In image (a), the scene is not bright. In image (b), the right side of the building is bright. In image (c), the brightness on the right side of the building hides its details.
Drones 09 00406 g015
Figure 16. Four types of experiments were conducted to evaluate flying over obstacles, the horizon view, flying alongside an obstacle, and brightness.
Figure 16. Four types of experiments were conducted to evaluate flying over obstacles, the horizon view, flying alongside an obstacle, and brightness.
Drones 09 00406 g016
Figure 17. The architecture of the CNN used to classify images into three categories: no-obstacle, obstacle, and horizon.
Figure 17. The architecture of the CNN used to classify images into three categories: no-obstacle, obstacle, and horizon.
Drones 09 00406 g017
Figure 18. (a) The accuracy of ANNs. (b) The confusion matrix for image classification using the validation dataset, where 0 indicates no obstacles, 1 indicates obstacles, and 2 indicates the horizon.
Figure 18. (a) The accuracy of ANNs. (b) The confusion matrix for image classification using the validation dataset, where 0 indicates no obstacles, 1 indicates obstacles, and 2 indicates the horizon.
Drones 09 00406 g018
Figure 19. The first experiment: The drone successfully flies over a bus and arrives at its target. In image (a), the drone detects the bus is in its path, so it moves upward. In image (b), the drone detects that the top of the bus is still an obstacle, so it moves upward. In images (c,d), the drone passes over the obstacle. In images (e,f), the drone reaches the target and lands on the ground.
Figure 19. The first experiment: The drone successfully flies over a bus and arrives at its target. In image (a), the drone detects the bus is in its path, so it moves upward. In image (b), the drone detects that the top of the bus is still an obstacle, so it moves upward. In images (c,d), the drone passes over the obstacle. In images (e,f), the drone reaches the target and lands on the ground.
Drones 09 00406 g019
Figure 20. The second experiment: The drone successfully flies over the trees and arrives at its target roof. In image (a), the drone detects that trees are in its path, so it moves upward. In images (b,c), the drone detects that tree branches and leaves are still obstacles, so it moves upward In images (d,e), the drone passes over the trees. In image (f), the drone reaches the target and lands on the ground.
Figure 20. The second experiment: The drone successfully flies over the trees and arrives at its target roof. In image (a), the drone detects that trees are in its path, so it moves upward. In images (b,c), the drone detects that tree branches and leaves are still obstacles, so it moves upward In images (d,e), the drone passes over the trees. In image (f), the drone reaches the target and lands on the ground.
Drones 09 00406 g020
Figure 21. The third experiment: The drone successfully flies over the building and arrives at its target. In image (a), the drone detects that the middle of the building is in its path, so it moves upward. In image (b), the drone detects that the top of the building is an obstacle, so it moves upward. In images (c,d), the drone passes over the building. In images (e,f), the drone reaches the target and lands on the ground.
Figure 21. The third experiment: The drone successfully flies over the building and arrives at its target. In image (a), the drone detects that the middle of the building is in its path, so it moves upward. In image (b), the drone detects that the top of the building is an obstacle, so it moves upward. In images (c,d), the drone passes over the building. In images (e,f), the drone reaches the target and lands on the ground.
Drones 09 00406 g021
Figure 22. The fourth experiment: The drone successfully flies over the buildings and arrives at its target roof. In image (a),the drone detects that the middle of the building is in its path, so it moves upward. In image (b), the drone detects that the top of the building is an obstacle, so it moves upward. In images (c,d), the drone passes over the buildings. In images (e,f), the drone reaches the target and lands on the ground.
Figure 22. The fourth experiment: The drone successfully flies over the buildings and arrives at its target roof. In image (a),the drone detects that the middle of the building is in its path, so it moves upward. In image (b), the drone detects that the top of the building is an obstacle, so it moves upward. In images (c,d), the drone passes over the buildings. In images (e,f), the drone reaches the target and lands on the ground.
Drones 09 00406 g022
Figure 23. The fifth experiment: The drone successfully flies over the school, navigates at night, and arrives at its target roof. In image (a), the drone detects that the middle of the school is in its path, so it moves upward. In image (b), the drone detects that the top of the school is an obstacle, so it moves upward. In images (c,d), the drone passes over the school. In images (e,f), the drone reaches the target and lands on the ground.
Figure 23. The fifth experiment: The drone successfully flies over the school, navigates at night, and arrives at its target roof. In image (a), the drone detects that the middle of the school is in its path, so it moves upward. In image (b), the drone detects that the top of the school is an obstacle, so it moves upward. In images (c,d), the drone passes over the school. In images (e,f), the drone reaches the target and lands on the ground.
Drones 09 00406 g023
Figure 24. The sixth experiment: The drone successfully flies over the buildings of the city and arrives at its target. In image (a), the drone detects that the middle of building is in its path, so it moves upward. In image (b), the drone detects that the top of the building is an obstacle, so it moves upward. In images (ce), the drone passes over the school. In image (f), the drone reaches the target and lands on the ground.
Figure 24. The sixth experiment: The drone successfully flies over the buildings of the city and arrives at its target. In image (a), the drone detects that the middle of building is in its path, so it moves upward. In image (b), the drone detects that the top of the building is an obstacle, so it moves upward. In images (ce), the drone passes over the school. In image (f), the drone reaches the target and lands on the ground.
Drones 09 00406 g024
Figure 25. The seventh experiment: The drone succeeds in lowering its altitude due to its awareness of the horizon. In image (a), the drone reaches an altitude of 100 m. In image (b), the algorithm lowers the drone’s altitude to 95 m due to the view of the horizon. In image (c), the algorithm lowers the drone’s altitude to 91 m due to the view of the horizon. In image (d), the algorithm lowers the drone’s altitude to 82 m due to the view of the horizon. In image (e), at an altitude of 76 m, the drone begins to head toward its target. In image (f), at an altitude of 69 m, the drone reaches the target.
Figure 25. The seventh experiment: The drone succeeds in lowering its altitude due to its awareness of the horizon. In image (a), the drone reaches an altitude of 100 m. In image (b), the algorithm lowers the drone’s altitude to 95 m due to the view of the horizon. In image (c), the algorithm lowers the drone’s altitude to 91 m due to the view of the horizon. In image (d), the algorithm lowers the drone’s altitude to 82 m due to the view of the horizon. In image (e), at an altitude of 76 m, the drone begins to head toward its target. In image (f), at an altitude of 69 m, the drone reaches the target.
Drones 09 00406 g025
Figure 26. The eighth experiment: The drone succeeds in lowering its altitude due to its awareness of the horizon. In image (a), the drone reaches an altitude of 100 m. In image (b), the algorithm lowers the drone’s altitude to 95 m due to the view of the horizon. In image (c), the algorithm lowers the drone’s altitude to 91 m due to the view of the horizon. In image (d), the algorithm lowers the drone’s altitude to 82 m due to the view of the horizon. In image (e), at an altitude of 76 m, the drone begins to head toward its target. In image (f), at an altitude of 67 m, the drone reaches the target.
Figure 26. The eighth experiment: The drone succeeds in lowering its altitude due to its awareness of the horizon. In image (a), the drone reaches an altitude of 100 m. In image (b), the algorithm lowers the drone’s altitude to 95 m due to the view of the horizon. In image (c), the algorithm lowers the drone’s altitude to 91 m due to the view of the horizon. In image (d), the algorithm lowers the drone’s altitude to 82 m due to the view of the horizon. In image (e), at an altitude of 76 m, the drone begins to head toward its target. In image (f), at an altitude of 67 m, the drone reaches the target.
Drones 09 00406 g026
Figure 27. The ninth experiment: The drone succeeds in lowering its altitude due to its awareness of the horizon. Image (a), the drone reaches an altitude of 150 m. In image (b), the algorithm lowers the drone’s altitude to 130 m due to the view of the horizon. In image (c), the algorithm lowers the drone’s altitude to 110 m due to the view of the horizon. In image (d), the algorithm lowers the drone’s altitude to 90 m due to the view of the horizon. In image (e), at an altitude of 76 m, the drone begins to head toward its target. in image (f), at an altitude of 69 m, the drone reaches the target.
Figure 27. The ninth experiment: The drone succeeds in lowering its altitude due to its awareness of the horizon. Image (a), the drone reaches an altitude of 150 m. In image (b), the algorithm lowers the drone’s altitude to 130 m due to the view of the horizon. In image (c), the algorithm lowers the drone’s altitude to 110 m due to the view of the horizon. In image (d), the algorithm lowers the drone’s altitude to 90 m due to the view of the horizon. In image (e), at an altitude of 76 m, the drone begins to head toward its target. in image (f), at an altitude of 69 m, the drone reaches the target.
Drones 09 00406 g027
Figure 28. The tenth experiment: The drone successfully avoids collisions with obstacles by flying alongside them and passing through a narrow gap. In images (a,b), the drone detects the obstacle and turns right. In image (c), the drone detects that there is a narrow gap through which it can pass. In images (d,e), the drone passes through the narrow gap to reach the target. In image (f), the drone reaches the target, which is 15 m away from the launch point.
Figure 28. The tenth experiment: The drone successfully avoids collisions with obstacles by flying alongside them and passing through a narrow gap. In images (a,b), the drone detects the obstacle and turns right. In image (c), the drone detects that there is a narrow gap through which it can pass. In images (d,e), the drone passes through the narrow gap to reach the target. In image (f), the drone reaches the target, which is 15 m away from the launch point.
Drones 09 00406 g028
Figure 29. The eleventh experiment: The drone successfully avoids collision with obstacles by flying alongside them and passing through a narrow gap despite the brightness of the scene. In images (a,b), the drone detects the obstacle and turns right. In image (c), the drone detects that there is a narrow gap through which it can pass. In images (d,e), the drone passes through the narrow gap to reach the target. In image (f), the drone reaches the target, which is 15 m away from the launch point.
Figure 29. The eleventh experiment: The drone successfully avoids collision with obstacles by flying alongside them and passing through a narrow gap despite the brightness of the scene. In images (a,b), the drone detects the obstacle and turns right. In image (c), the drone detects that there is a narrow gap through which it can pass. In images (d,e), the drone passes through the narrow gap to reach the target. In image (f), the drone reaches the target, which is 15 m away from the launch point.
Drones 09 00406 g029
Figure 30. The results of implementation of the algorithms used in our experiments. In image (a), after implementing Algorithm 2, the CNN prediction result is 1, indicating that the CNN detected an obstacle; thus, the drone moved upward. It traveled a distance of y = 52.09 m, and its altitude was z = 6.14 m. In image (b), after implementing Algorithm 3, the CNN prediction result is 2, which means that the CNN detected a horizon, and therefore, the drone moved downward. It traveled a distance of y = 8.15 m, and its altitude was z = 77.7 m.
Figure 30. The results of implementation of the algorithms used in our experiments. In image (a), after implementing Algorithm 2, the CNN prediction result is 1, indicating that the CNN detected an obstacle; thus, the drone moved upward. It traveled a distance of y = 52.09 m, and its altitude was z = 6.14 m. In image (b), after implementing Algorithm 3, the CNN prediction result is 2, which means that the CNN detected a horizon, and therefore, the drone moved downward. It traveled a distance of y = 8.15 m, and its altitude was z = 77.7 m.
Drones 09 00406 g030
Figure 31. The image captured by the drone’s camera while the drone rotated around its roll axis.
Figure 31. The image captured by the drone’s camera while the drone rotated around its roll axis.
Drones 09 00406 g031
Table 1. The comparison of databases used in drone navigation in terms of the environment and labeling.
Table 1. The comparison of databases used in drone navigation in terms of the environment and labeling.
ReferenceDatasetEnvironmentNavigationLabels
[13]HDINInside buildings2DForward speed and steering control
[14]Collision-sequenceRoad of cars2DOn collisions and non-collisions
[15]KITTIRoad of cars2DObject detection
[22]NYUInside buildings2DSegmenting images into regions that correspond to individual objects
[23]ICLInside buildings2DLeft, right, and forward
[24]- - -Inside buildings2DCollision distance for each image
[25]- - -Inside buildings2DPredict steering angle
[26]SAICRoad of cars2DDetermine speed and steering angle
[27]UdacityRoad of cars2DPredict steering angles
[28]Comma2k19Road of cars2DPosition and orientation
[29]ApolloScapeRoad of cars2DLabeling for lane detection, trajectory prediction, object detection
[30]DDADRoad of cars2DPredict monocular depth of scene
Our dataset- - -Outdoor3DNo obstacles, obstacles, and the horizon
Table 2. The results of the experiments in terms of the type of obstacle, obstacle height, maximum drone altitude, and distance to target.
Table 2. The results of the experiments in terms of the type of obstacle, obstacle height, maximum drone altitude, and distance to target.
ExperimentObstacle TypeObstacle HeightMaximum Altitude of DroneDistance to Target
1bus4.5 m5 m6 m
2Trees7 m7.5 m16 m
3Building7.5 m8.5 m13 m
4Buildings9 m11 m40 m
5School15 m15.5 m30 m
6City18.5 m19.5 m60 m
Table 3. The horizon view evaluation experiments focused on three key metrics: attaining the required altitude, lowering altitude, and reaching the target.
Table 3. The horizon view evaluation experiments focused on three key metrics: attaining the required altitude, lowering altitude, and reaching the target.
ExperimentTakeoff to AltitudeDescend to an AltitudeReaching the Target at Altitude
7100 m76 m67 m
8100 m76 m69 m
9150 m76 m69 m
Table 4. The results of the evaluation of flying alongside an obstacle and the brightness evaluation in terms of the type of obstacle and the distance to the target.
Table 4. The results of the evaluation of flying alongside an obstacle and the brightness evaluation in terms of the type of obstacle and the distance to the target.
ExperimentFirst ObstacleSecond ObstacleDistance to Target
10Narrow gapWalls15 m
Table 5. The results of the brightness evaluation and navigation at night.
Table 5. The results of the brightness evaluation and navigation at night.
ExperimentObstacleLighting ConditionsDistance to Target
5SchoolNavigation at nigh30 m
11Narrow gapBrightness15 m
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Alotaibi, T.; Jambi, K.; Khemakhem, M.; Eassa, F.; Bourennani, F. Outdoor Dataset for Flying a UAV at an Appropriate Altitude. Drones 2025, 9, 406. https://doi.org/10.3390/drones9060406

AMA Style

Alotaibi T, Jambi K, Khemakhem M, Eassa F, Bourennani F. Outdoor Dataset for Flying a UAV at an Appropriate Altitude. Drones. 2025; 9(6):406. https://doi.org/10.3390/drones9060406

Chicago/Turabian Style

Alotaibi, Theyab, Kamal Jambi, Maher Khemakhem, Fathy Eassa, and Farid Bourennani. 2025. "Outdoor Dataset for Flying a UAV at an Appropriate Altitude" Drones 9, no. 6: 406. https://doi.org/10.3390/drones9060406

APA Style

Alotaibi, T., Jambi, K., Khemakhem, M., Eassa, F., & Bourennani, F. (2025). Outdoor Dataset for Flying a UAV at an Appropriate Altitude. Drones, 9(6), 406. https://doi.org/10.3390/drones9060406

Article Metrics

Back to TopTop