1. Introduction
In recent decades, Unmanned Aerial Vehicles (UAVs) have been successfully applied in various sectors to perform a variety of tasks, such as inspection and maintenance of civil structures [
1], search and rescue operations during disasters [
2], surveillance [
3], agricultural tasks [
4], environmental monitoring [
5], wildlife surveys [
6], space exploration [
7], and many others [
8,
9]. One of the main challenges for autonomous operation in these environments is ensuring the safe navigation of UAVs in complex environments without colliding with static and dynamic obstacles.
Designing a collisionfree path within a dynamic environment poses a formidable challenge, requiring substantial computational resources. The onboard processing capacity of UAVs is limited by multiple constraints such as battery power, weight, and space. One popular approach is to offload complex tasks with no hard realtime deadlines from an autonomous vehicle’s onboard computers to a cloud server [
10,
11]. Recent advances in wireless communication technology and cloud computing make it possible to offload noncritical complex tasks [
12]. The primary benefit of offloading computations is the enhancement of overall efficiency, as it reduces the workload on the onboard computer. However, reliance on cloud computing in dynamic environments can present difficulties such as latency and realtime constraints. In response to these challenges, we endeavour to tackle them by proposing a viable strategy tailored for Unmanned Aerial Vehicles (UAVs) operating in dynamic space.
There are various approaches in the literature to path planning for UAVs [
13]. Recent works are classified into two groups: global path planning and reactive (local) path planning. Global path planning typically utilizes a complete map of the 3D space to provide an optimal path, making it more suitable for known environments with static barriers. However, when deployed in dynamic environments, global path planning requires the additional burden of replanning. Major prominent contributions include rapidly exploring random tree (RRT) and its variants [
14], the A* algorithm and its variants [
15], machine learning techniques [
16,
17], metaheuristic strategies [
18], and various Dynamic Programmingbased algorithms [
19]. Each of these approaches exhibits distinct strengths and weaknesses. To illustrate, within the A* algorithm family, the selection of appropriate heuristics plays an important role in the outcomes. These heuristic approaches excel in providing satisfactory solutions for UAV path planning with singleobjective objectives, and have proven suitable for static environments characterized by diverse constraints. However, they do not consistently reach optimal solutions and tend to generate suboptimal results when tasked with UAV path planning involving multiple objectives, frequently falling into local optima [
15]. Within the RRT algorithm family, the optimality of the resulting trajectory is dependent upon the scale of the randomly sampled points. They yield favourable outcomes, offering efficient path optimization, rapid solution generation, and time efficiency when applied to static environments featuring straightforward obstacles. Nevertheless, they are susceptible to shortcomings with respect to local minima, and provide no assurance of optimality in their results due to the imposition of constraints [
14]. Machine learning techniques can produce optimal results encompassing path length, smoothness, time efficiency, and collision avoidance. These intelligent approaches are particularly wellsuited for dynamic environments prone to sudden changes. Nevertheless, they come with a drawback in that they demand substantial environmental datasets in order to furnish optimal solutions, particularly in the context of supervised learning. Furthermore, they entail extensive training sessions before achieving an accurate final model [
16]. Metaheuristic strategies deliver commendable outcomes for UAV path planning involving multiobjective objectives. They exhibit reasonable execution times and offer intelligent solutions that are relatively straightforward to implement. Nonetheless, they are less suitable for realtime planning, as they require meticulous control parameter tuning and substantial resource allocations. Additionally, they lack a robust theoretical converging property [
18]. Dynamic Programming can produce optimal results, although it can be computationally expensive. Cloud computing can provide the excess computational power required to achieve optimal outcomes. However, Dynamic Programming can be challenging for realtime applications due to the latency involved in wireless communications. Consequently, using local path planning with onboard sensors can be a potential solution to this problem [
19].
Reactive or local path planning techniques for Unmanned Aerial Vehicles (UAVs) typically operate without a comprehensive environmental map for navigation. One prevalent category of local path planning involves ‘sense and avoid algorithms’, sometimes referred to as ‘reactive algorithms’. These algorithms use the data acquired from onboard sensors to evade encountered obstacles. In terms of computational complexity, they are generally more costefficient than the alternatives. Consequently, reactive strategies facilitate fast realtime responsiveness for UAVs in dynamic environments.
Conventional reactive algorithms for twodimensional (2D) environments encompass dynamic windows, velocity obstacles, collision cones, and other similar approaches [
13]. Another set of methods for obstacle avoidance stems from biologicallyinspired concepts [
13]. In a prior research work [
20], a range of Sliding Modebased Controllers (SMCs) were deployed. SMCs are favoured for their ease of implementation and reduced computational resource requirements. Furthermore, their inherent robustness in the face of disturbances and model uncertainties makes them a good choice [
21,
22]. Consequently, reactive algorithms are preferred for local path planning, enabling UAVs to avoid obstacles in dynamic environmental settings.
In this research paper, we introduce an innovative hybrid global/reactive algorithm designed for Unmanned Aerial Vehicle (UAV) path planning within unfamiliar and dynamic settings. Combining global path planning and reactive control approaches in hybrid strategies can overcome the aforementioned drawbacks and lead to more efficient navigation. We combine a dynamic programmingbased global path planning algorithm with a Sliding Mode Control (SMC)based reactive (local) algorithm. The dynamic programmingbased global path planner ensures that the UAV navigation algorithm operates in a timeoptimal manner, whereas the SMCbased reactive path planning makes the proposed strategy able to operate in unknown dynamic 3D spaces. Moreover, using SMCbased navigation grants the proposed path planning algorithm robustness against uncertainties in the environment, including both unknown motion of moving obstacles and unmodelled dynamics of the UAV. The trajectory may become suboptimal in realtime obstacle scenarios, a tradeoff that is vital for obstacle avoidance. UAV efficiency is improved by offloading complex computations to remote systems. It reduces onboard computational demands, which benefits UAVs with limited resources such as battery power, memory space, and computational power. Additionally, the utilization of Sliding Mode Control (SMC) ensures swift UAV response. In summary, our approach balances optimal path planning with computational ease and agility to collectively enhance UAV efficiency. Unlike many other papers in the field, we consider nonplanar 3D environments as well as both steady and dynamic (moving) obstacles.
This paper is divided into five major parts.
Section 2 is about related work, discussing a significant body of literature on various hybrid approaches used by different researchers for path planning.
Section 3 describes the proposed system and presents the problem statement.
Section 4 provides a concise overview of the solution and introduces the technique that addresses the specified problem.
Section 5 presents the results of computer simulations. Finally,
Section 6 provides concluding remarks.
2. Related Work
In the general literature, hybrid approaches encompass combinations of different preexisting path planning strategies. In this section, we discuss recent developments in hybrid algorithms. Quite often, twodimensional work is augmented to include threedimensional space. Several notable contributions have been made in twodimensional path planning using hybrid algorithms. Xu et al. combined Artificial Potential Field with a Genetic Algorithm for path planning and collision avoidance [
23]. Hank et al. focused on generating neartimeoptimal trajectories during the preprocessing phase. Their approach combines optimal trajectories with a reactive module comprising three fuzzy logicbased submodules [
24]. Yi Zhu et al. proposed a DHBug (Distance Histogram Bug) reactive algorithm, which was fused with the A* algorithm while ensuring robust convergence [
25]. Jose et al. utilized the A* algorithm to find waypoints. To find collisionfree paths, they used a probabilistic roadmap guided by a potential field map function [
26]. Taha et al. leveraged the RRTConnect algorithm for path planning and introduced a sliding modebased controller for obstacle avoidance in cluttered environments with simple geometrical obstacles [
27]. Pablo et al. implemented their work on an Ackermanbased model car, employing Dijkstra’s algorithm as a global planner and enhancing it with a Time Elastic Band mechanism to avoid obstacles [
28]. In another study by Jian et al., an iterative optimization method was utilized in the global planning stage, while a samplingevaluation strategy was adopted in the local planning stage [
29]. Woojin et al. integrated the Dynamic Window Approach with pregenerated waypoints for mobile robots with constrained velocity and acceleration [
30]. Louis et al. proposed the Parallel Elliptic LimitCycle (PELC) approach for global planning along with its variant based on multicriteria optimization to form a reactive component for obstacle avoidance [
31].
Next, we discuss recent advancements in hybrid algorithm approaches for the 3D path planning landscape. Wzorek et al. incorporated a probabilistic path planning algorithm with a reactive Optimal Reciprocal Collision Avoidance (ORCA) controller. Rapidly Exploring Random Tree (RRT) was used for global path planning, while the ORCA controller was used to avoid collisions with obstacles [
32]. Kwangjin et al. used RRT for path planning and its variant with linear Model Predictive Control for obstacle avoidance and pathfollowing [
33]. Lin et al. showed that clusterbased UAV navigation path planning is possible through a combination of modified Artificial Potential Methods and evolutionary algorithms [
34]. Matthias et al. designed realtime planning solutions for microaerial vehicles. Their proposed solution combined the A* algorithm for global path planning with a gridbased method for obstacle avoidance [
35]. Vincent et al. provided pathplanning solutions for fixedwing UAVs by fusing Particle Swarm Optimization with a Genetic Algorithm [
36]. Xiobing et al. developed a hybrid approach based on the Grey Wolf Optimizer (GWO) and Differential Evolution (HGWODE) algorithms to provide an optimised solution for UAV path planning [
37]. Chengzhi et al. [
38] introduced a novel approach called RLGWO, which combines Grey Wolf Optimization (GWO) with Reinforcement Learning (RL), to address the challenging UAV path planning problem. The performance of RLGWO was evaluated through simulations in three distinct case studies within a 3D space in the presence of eight stationary obstacles. In a study by Soheila et al. [
39], a novel approach named TLBO* was introduced based on the fusion of Teaching–Learningbased Optimization (TLBO) and Genetic Algorithm techniques Research work by Qu et al. [
40] combined three distinct algorithms: the Dijkstra Algorithm, Genetic Algorithm (GA), and Artificial Potential Field (APF). The Dijkstra algorithm was employed to determine the shortest path, while the APF algorithm identified a feasible path by guiding the UAV towards smoother regions while avoiding potential threats. A GA algorithm was then applied to further optimize the path generated by the other two algorithms. Veronica et al. employed a hybrid approach to tackle multiple objectives, which they achieved by including PDDL for task planning, Bayesian Networks (BN) for feasibility evaluation, and the KNearest Neighbors (KNN) algorithm for path planning and obstacle avoidance selection [
41].
Mobile robot path planning in two dimensions is known to be an NPhard problem [
42], and the complexity of 3D path planning is further escalated by the extra dimension. Increased complexity arises from the expansion of the search space. This has significant implications, particularly for small UAVs, as these must swiftly respond to new information despite their limited computational capabilities. If the environment of the UAVs is discretized, the volume of points to be taken into account experiences a substantial surge in 3D space. Furthermore, when seeking better accuracy, if more points are generated more densely then the complexity escalates even further. The significance of devising efficient mechanisms becomes even more pronounced when tackling path planning challenges with dynamic objects in 3D space. In the majority of current research, the complete computational processing is carried out onboard. Moreover, most existing research has only considered static obstacles. In contrast, in our research we suggest a method for enhancing UAV efficiency through cloud computing and wireless technology. In order to offload computing effort around optimal path computation, the UAV wirelessly connects to cloud computing infrastructure using the Software as a Service (SaaS) model.
3. System Description and Investigated Problem
We examine a nonholonomic Unmanned Aerial Vehicle (UAV) navigating within a confined 3D space denoted as
$\mathcal{S}$, where
$\mathcal{S}\subset {\mathbb{R}}^{3}$. In the Cartesian coordinate system at
$\tau $ time,
${P}_{uav}\left(\tau \right):=[{x}_{u}\left(\tau \right),\phantom{\rule{0.277778em}{0ex}}{y}_{u}\left(\tau \right),\phantom{\rule{0.277778em}{0ex}}{z}_{u}\left(\tau \right)]$ describes the UAV’s location within the environment. The UAV’s motion is expressed as
${\dot{P}}_{uav}\left(\tau \right)$, and is characterized as follows [
20].
The orientation angles of the UAV, namely, the yaw (
${\theta}_{\alpha}$) and pitch (
${\theta}_{\beta}$) angles, are measured in the anticlockwise direction. The UAV’s rolling motion is not included in the calculation. While the roll angle is essential for certain types of aircraft (e.g., fixedwing aircraft), it may not be as crucial for nonholonomic UAVs, such as quadcopters, which primarily rely on variations in thrust and rotor speeds to control their movement. We assume that the UAV’s roll angle remains within acceptable limits to preserve altitude stability. As incorporating roll control would introduce added complexity, it was avoided. The variable
${v}_{uav}\left(\tau \right)$ represents the UAV’s speed, where
${v}_{uav}\left(\tau \right)\in \mathbb{R}$ and
${v}_{uav}\left(\tau \right)>0$. The control signal
${c}_{uav}\left(\tau \right)$ modulates the UAV’s pitch and yaw angles. A comprehensive description is provided below:
where
${Q}_{d}\left(\tau \right)$ and
${c}_{uav}\left(\tau \right)$ are threedimensional vectors (
${Q}_{d}\left(\tau \right)\in {\mathbb{R}}^{3}$ and
${c}_{uav}\left(\tau \right)\in {\mathbb{R}}^{3}$) with
$\left\right{Q}_{d}\left(\tau \right)\left\right=1$ for all the values for time
$\tau $ (
$\tau >0$). Setting the norm of
${Q}_{d}$ to 1 guarantees that the UAV’s overall speed remains constant while allowing for variations in the direction of motion. Additionally, the following conditions must be met for all the values of
$\tau $:
where
${C}_{uav}$ is a constant provided by the user. The notation
$\left\right.\left\right$ signifies the Euclidean norm,
$(\ast ,\ast )$ represents the scalar dot product, and the minimum turning radius, denoted as
${R}_{s}$, is determined as follows.
The environment $\mathcal{S}$ encompasses both discrete known obstacles and unknown obstacles, denoted as $\mathcal{H}=\{{\mathcal{H}}_{1},\dots ,$ ${\mathcal{H}}_{i},\dots ,{\mathcal{H}}_{n}\}$. We denote ‘${K}_{s}$’, where $({K}_{s}\le n)$ known static obstacles can take on various shapes, including convex and nonconvex. In the case of unknown obstacles ${\mathcal{H}}_{i}$, it is assumed that each obstacle can be contained within a finite sphere of radius ${\mathtt{A}}_{i}$. The unknown obstacles can either be stationary or in motion; in the latter case, they are characterized by velocities ${\mathtt{S}}_{h}=\{{\mathtt{s}}_{1},\dots ,{\mathtt{s}}_{i},\dots ,{\mathtt{s}}_{n}\}$.
The UAV is equipped with an onboard sensor system capable of detecting obstacles ${\mathcal{H}}_{i}$ when they enter its sensing range ${\mathtt{A}}_{d}$. Furthermore, it can compute the shortest Euclidean distance ${d}_{i}$ between itself and these obstacles.
The primary objective is to ensure collisionfree navigation for a nonholonomic UAV commencing from an initial position ${\mathtt{P}}_{\mathtt{start}}$ and finishing at a fixed target position ${\mathtt{P}}_{\mathtt{goal}}$. This navigation should be achieved within an optimal time while avoiding collisions with both static and dynamic obstacles and while maintaining a minimum safe distance ${D}_{safe}$ from the obstacles. This objective holds true as long as $\{{\mathtt{P}}_{\mathtt{start}},{\mathtt{P}}_{\mathtt{goal}}\}$ are within the set $\mathcal{N}$, defined as $\mathcal{N}:=\mathcal{S}\setminus \mathcal{H}$.
Assumption 1. The velocity of dynamic obstacles is assumed to be constant and slower than that of the UAV, i.e., ${\mathtt{S}}_{h}<{V}_{a}<{V}_{max}$, where ${V}_{a}$ is a given positive constant and ${V}_{max}$ is the maximum speed attainable by the UAV.
Assumption 2. For any dynamic obstacle ${\mathcal{H}}_{i}$, the UAV possesses knowledge about its velocity ${\mathtt{s}}_{i}$ and the radius of its sphere ${\mathtt{A}}_{i}$.
The Livox AVIA solidstate lidar system is a good fit for putting Assumption 2 into practice. It has multiple benefits specific to aerial applications, such as its light weight and adaptable size for smallscale UAVs. Thanks to its low false alarm rate, it has an extended object detection range that makes identifying obstacles during fast flight more feasible. Moreover, it is capable of up to 2500 Hz data output, enabling prompt identification of moving objects. Even in stationary operation, its nonrepetitive scanning technology provides improved resolution. Incorporating the Livox AVIA enhances the practicality and precision of the proposed navigation strategy, ensuring accurate determination of obstacle locations and speed vectors in realworld UAV missions [
43].
4. Global/Reactive UAV Path Planning Algorithm
The planning methodology, as illustrated in
Figure 1, consists of three fundamental constituents: global path planning, reactive control, and transition guidelines. The sequence commences with the UAV transmitting its initial and destination positions to the cloud computing facility through a wireless communication channel. Subsequently, the remote computer computes the optimal route and relays the trajectory waypoints to the UAV. The UAV adheres to these waypoints with the assistance of a trajectorytracking algorithm. If the UAV is unable to locate the global path after an obstacle avoidance manoeuvre, it will stop the motion and safely land. Alternatively, the UAV may attempt to rejoin the original global path if it remains feasible. The choice of action in such situations is based on factors such as the proximity to the original path, the presence of additional obstacles, and realtime computational capabilities.
During the trajectory tracking phase, if obstacles are detected by the UAV’s onboard sensors, it switches to the reactive controller. The reactive controller is responsible for executing obstacle avoidance manoeuvres. When an obstacle has been successfully avoided, the UAV reverts to the global planning algorithm and resumes following the trajectory waypoints.
It is important to note that this method assumes accurate localization of the UAV within the environment. The global planner operates on the remote computing facility, while the reactive controller is executed by the UAV’s onboard computing facility.
Global Path Planning. The first step is to calculate the shortest collisionfree path between the starting point
${\mathtt{P}}_{\mathtt{start}}$ and the destination point
${\mathtt{P}}_{\mathtt{goal}}$, with static barriers while satisfying condition (
2). In this paper, the Dynamic Programming algorithm (see, e.g., [
44,
45]) is utilised to achieve the objective. Dynamic programming leverages the principle of optimality to efficiently find optimal solutions. In our case, it finds the optimal path by breaking the space down into a grid. Each grid cell represents a state, and dynamic programming is employed to find the optimal path by recursively updating the costtocome values for each state while adhering to the principles of optimality and constraint. This method efficiently finds the best path by considering intermediate points and backtracking from the goal state. It is particularly effective for gridbased environments, although it may encounter scalability issues in highdimensional spaces. Its curse of dimensionality is overcome through the use of cloud computing facilities. In order to efficiently solve dynamic programming problems in realtime, highperformance computing resources are often necessary. This typically involves dedicated servers, cloud computing instances, or clusters equipped with powerful processors and substantial memory. Services offered by cloud providers such as Amazon Web Services, Microsoft Azure, and Google Cloud are commonly utilized to access scalable and highperformance computing resources. The choice of hardware specifications should align with the specific computational requirements of the application’s realtime constraints. The UAV should complete the journey within a finite time limit of
${\mathtt{T}}_{\mathtt{g}}$ while operating inside environment
$\mathcal{S}$.
In
Figure 2, the shaded regions represent barriers within the environment
$\mathcal{S}$. The space
$\mathcal{S}$ undergoes discretization into a grid consisting of
$\mathtt{N}$ nodes. Provided that there are no obstacles impeding their connection, every node establishes connections with its neighboring nodes. Two specific nodes, denoted as
${\mathtt{P}}_{\mathtt{start}}$ and
${\mathtt{P}}_{\mathtt{goal}}$, are introduced into this grid. For any given point with coordinates
$({x}_{k},{y}_{k},{z}_{k})$, we designate
${\mathtt{P}}_{\mathtt{k}}$ as the nearest node. The cost of traversing from node
${\mathtt{P}}_{\mathtt{k}}$ to its neighbouring node is computed through the Euclidean distance formula. The function
${F}_{k}({x}_{u}\left(\tau \right),{y}_{u}\left(\tau \right),{z}_{u}\left(\tau \right))$ serves as a vital model for evaluating the proximity of a UAV to the closest point of a static obstacle
k. In this context, the variable
k spans from 1 to
${K}_{s}$ and the function
${F}_{k}(\xb7)$ adheres to the constraint
$0\le {F}_{k}({x}_{u},{y}_{u},{z}_{u})\le 1$. A value of 0 for
${F}_{k}({x}_{u},{y}_{u},{z}_{u})$ indicates a significant distance between the UAV and a static obstacle
j. Conversely,
$0\le {F}_{k}({x}_{u},{y}_{u},{z}_{u})\le 1$ signifies that the static obstacle is within the UAV’s proximity, with the value of
${F}_{k}({x}_{u},{y}_{u},{z}_{u})$ indicating the degree of closeness. It is crucial to note that the function
${F}_{k}({x}_{u},{y}_{u},{z}_{u})$ is inherently a monotonically decreasing function, transitioning from a value of 1 to 0; this particular characteristic reflects the diminishing closeness of obstacles to the UAV as the value of
${F}_{k}({x}_{u},{y}_{u},{z}_{u})$ decreases. In environments characterized by dynamic obstacles, it is evident that maintaining a safe distance from static obstacles is of paramount importance when seeking to avoid potential collisions. To illustrate this we can define
${F}_{k}({x}_{u},{y}_{u},{z}_{u})$ for a static spherical obstacle as follows. Let the center of a given obstacle
k be represented by
${P}_{k}=({x}_{c},{y}_{c},{z}_{c})$. In this scenario, the 3D Euclidean distance between two points in 3D space is expressed as
${E}_{d}(.,.)$. Moreover, we define two constants:
$0<{r}_{1}<{r}_{2}$. The function
${F}_{k}({x}_{u},{y}_{u},{z}_{u})$ is characterized as follows: (1)
${F}_{k}({x}_{u},{y}_{u},{z}_{u})=1$ when
${E}_{d}({P}_{k},({x}_{u},{y}_{u},{z}_{u}))\le {r}_{1}$ and (2)
${F}_{k}({x}_{u},{y}_{u},{z}_{u})=0$ when
${E}_{d}({P}_{k},({x}_{u},{y}_{u},{z}_{u}))\ge {r}_{2}$. For the intermediate range where
${r}_{1}\le {E}_{d}({P}_{k},({x}_{u},{y}_{u},{z}_{u}))\le {r}_{2}$, we can express
${F}_{k}({x}_{u},{y}_{u},{z}_{u})$ as any monotonically decreasing function that transitions from 1 to 0. The specific form of this function depends on the spatial relationship between the point
$({x}_{u},{y}_{u},{z}_{u})$ and the given static obstacle
k. The optimal trajectory
$\mathtt{T}\left(\tau \right)$ of the UAV adheres to the condition that
$\mathtt{T}\left(0\right)={\mathtt{P}}_{\mathtt{start}}$ at
$\tau =0$ seconds and that
$\mathtt{T}\left({t}_{f}\right)={\mathtt{P}}_{\mathtt{goal}}$ at
$\tau ={t}_{f}$ seconds, where
$0<{t}_{f}\le {\mathtt{T}}_{\mathtt{g}}$.
The cost function for evaluating the trajectory cost of the UAV is as follows:
The aim is to minimize a given function as specified in (
3). We can consider a given positive integer, denoted as
M, and define
$\sigma $ as
$\sigma :=\frac{{\mathtt{T}}_{\mathtt{g}}}{M}$. For all
$a=\{0,1,\dots ,m,\dots ,M\}$, we introduce sets
$\mathcal{P}\left(a\right)\subset \mathcal{S}$ as follows. The set
$\mathcal{P}\left(M\right)$ exclusively comprises the target point
${\mathtt{P}}_{\mathtt{goal}}$, expressed as
$\mathcal{P}\left(M\right):={\mathtt{P}}_{\mathtt{goal}}$. For all
$a<M$, the set
$\mathcal{P}\left(a\right)$ encompasses all points
$\widehat{E}\in \mathcal{S}$ that have a solution for (
2) over the interval
$[0,\sigma ]$, where
${v}_{uav}\left(\tau \right)={V}_{max}$ and
${c}_{uav}\left(\tau \right)$ remain constant for all
$\tau \in [0,\sigma ]$. Additionally, the set must satisfy the conditions
${P}_{uav}\left(0\right)=\widehat{E}$,
${P}_{uav}\left(\sigma \right)\in \mathcal{P}(m+1)$, and
${P}_{uav}\left(\tau \right)\in \mathcal{S}$ for all
$\tau \in [0,\sigma ]$.
The function
$R(a,\widehat{E})$ is defined on
$\mathcal{P}\left(a\right)$ for
$a=0,1,\dots ,M$ as follows:
Here, the minimum value is computed across all potential solutions. Additionally, we define
$\widehat{G}(a,\widehat{E})$ as the vector for which the minimum in (
4) (with
${P}_{uav}\left(0\right)=\widehat{E}$) is obtained with
${c}_{uav}\left(\tau \right)\equiv \widehat{G}(a,\widehat{E})$. We additionally introduce the set
$\mathcal{J}$, which consists of indexes
$a\in \{0,1,\dots ,M1\}$ such that
${\mathtt{P}}_{\mathtt{start}}\in \mathcal{P}\left(a\right)$. If
$\mathcal{P}$ is not empty, we designate
${a}_{0}\in \mathcal{J}$ as the index at which the minimum in
${min}_{a\in \mathcal{J}}R(a,{\mathtt{P}}_{\mathtt{start}})$ is achieved, i.e., for all
$a\in \mathcal{J}$,
$a={a}_{0}$.
Now, the UAV’s trajectory is constructed with an initial condition
${P}_{uav}\left(0\right)={\mathtt{P}}_{\mathtt{start}}$, and we utilize the following
${t}_{f}$ and control inputs:
for all
$\tau \in [(a{a}_{0})\sigma ,(a{a}_{0}+1)\sigma )$ and all
$a={a}_{0},{a}_{0}+1,\dots ,M1$.
The set of waypoint data, denoted as
$\mathcal{B}:=\{{B}_{1},{B}_{2},\dots ,{B}_{R}\}$, is generated and stored. The number of waypoints
${W}_{r}$ is userdefined and specifies the resolution of the trajectory data. When the UAV receives the dataset
$\mathcal{B}$, it begins to move. The summary of global navigation algorithm pseudo code is given by Algorithm 1. Global path planning is considered a noncritical task carried out through remote computers. Waypoints are wirelessly transferred to the UAVs; in the event that the UAV is unable to receive these waypoints, it will not commence its journey.
Algorithm 1 Global Navigation Algorithm Pseudocode 
Discretize the environment into a grid with $\mathtt{N}$ nodes. Define the starting point ${\mathtt{P}}_{\mathtt{start}}$ and the destination point ${\mathtt{P}}_{\mathtt{goal}}$. Calculate the cost of traversing between nodes using the Euclidean distance formula. Define the cost function to evaluate the trajectory cost of the UAV. Introduce sets $\mathcal{P}\left(a\right)$ representing points with solutions for the specified condition over a defined interval. Define function $R(a,\widehat{E})$ for cost evaluation and trajectory optimization across $\mathcal{P}\left(a\right)$. Construct the UAV’s trajectory with initial conditions, duration, and control inputs. Generate a set of waypoint data $\mathcal{B}$ with userdefined resolution. The UAV follows the trajectory and adjusts based on received waypoint data.

Reactive (Local) Path Planning. The proposed reactive (local) path planner utilizes a Sliding Mode Control (SMC)based reactive controller. SMC is based on the principles of the Lyapunov theory. It involves a “sliding surface” in a system’s state space. When the system’s state crosses this surface, the control strategy swiftly adjusts to maintain the system on this surface. This methodology ensures the desired system behaviour even when uncertainties and disturbances are present. The robustness of SMC in handling these challenges is a result of its reliance on the actual system state rather than a precise mathematical model.
As the UAV approaches a moving obstacle, it seamlessly transitions from its optimal path to an obstacleavoidance mode to avert collisions. The algorithm for avoiding collisions with obstacles is detailed below:
where the function
$\mathcal{K}$ is expressed as
where
K is defined as
In the above equation,
$\gamma $ and
$\xi $ are unit vectors. The expression
${L}_{i}^{\left(h\right)}\left(\tau \right)$ is described as
where
$j=1,2$, while
${\varphi}_{i}^{j}\left(\tau \right)$ is described as
where
${\delta}_{0}$ is the constant avoidance angle maintained by the UAV (illustrated in
Figure 3) and the angles
${\varphi}_{i}^{\left(1\right)}\left(\tau \right)$ and
${\varphi}_{i}^{\left(2\right)}\left(\tau \right)$ are obtained through measurements by the onboard sensors of the UAV. The expanded cone is formed by the two tangent lines extending from the UAV’s present location to the obstacle, as shown in
Figure 3.
Switching Rule. The “Switching Rule” dictates when the UAV should transition between optimal path following and obstacle avoidance and vice versa. When an obstacle $\mathcal{H}i$ is detected within the sensor’s sensing range ${\mathtt{A}}_{d}$, the switching action is initiated. Let the closest waypoint reached by the UAV be denoted as ${B}_{s}$. Assuming that the UAV can estimate the size of the dynamic obstacle, let ${B}_{s+z}$ represent the pseudotarget for the obstacle avoidance algorithm, where $s<s+z<{W}_{r}$. We define a positive constant ${D}_{safe}$ as the safe distance between the obstacle and the UAV. The distance to the nearest obstacle measured by the UAV’s onboard sensor is denoted as ${d}_{i}$. The switching modes are as follows:
SR1: when (
${d}_{i}<{D}_{safe}$) and (
${\dot{d}}_{i}<0$), this indicates that the UAV is approaching the object. In this scenario, the UAV transitions from following the path from the global planner to the one from the reactive planner using the control method (
6). The pseudotarget of the reactive control is set to
${G}_{o}:={B}_{s+z}$. The UAV attempts to reach a waypoint
${B}_{s+z}$ which is positioned
z units ahead of
${B}_{s}$.
SR2: the UAV switches from (
6) to (
7) when it is aligned toward
${G}_{o}$ and when (
${d}_{i}\le 1.1{w}_{i}$) [
20]. The parameter
${w}_{i}$ is defined as
where
${\mathtt{A}}_{i}$ is the radius of the sphere enclosing the obstacle.
SR3: the UAV transitions from (
7) to the global path tracking algorithm when it approaches sufficiently close to the interim target
${G}_{o}$ while satisfying the condition
${G}_{o}{P}_{uav}\left(\tau \right)<\Delta $, with
$\Delta $ being a small positive constant value defined by the user.
5. Computer Simulation Results
In this section, we present results obtained through simulations using the proposed navigation strategy. All of our simulations used MATLAB software. The 3D environment map depicted in
Figure 2 was accessible to the global path planning algorithm using dynamic programming. The values of the parameters used in the simulations are as follows:
$\mathtt{N}=500,M=100,{\mathtt{T}}_{\mathtt{g}}=200,{V}_{max}=0.5\phantom{\rule{0.166667em}{0ex}}\mathrm{m}/\mathrm{s},{C}_{d}=2\phantom{\rule{0.166667em}{0ex}}\mathrm{rad}/\mathrm{s},{R}_{s}=0.25\phantom{\rule{0.166667em}{0ex}}\mathrm{m},{\mathtt{P}}_{\mathtt{start}}=[5,5,5],{\mathtt{P}}_{\mathtt{goal}}=[47,39.1,11.4],{R}_{i}=0.8\phantom{\rule{0.166667em}{0ex}}\mathrm{m},{\delta}_{0}={30}^{\circ},{D}_{safe}=0.2\phantom{\rule{0.166667em}{0ex}}\mathrm{m}.$ The values of
z and
$\Delta $ were determined through a trial and error method. The function
${F}_{k}({x}_{u}\left(\tau \right),{y}_{u}\left(\tau \right),{z}_{u}\left(\tau \right))$ in
Section 4 was defined as
${F}_{k}({x}_{u}\left(\tau \right),{y}_{u}\left(\tau \right),{z}_{u}\left(\tau \right)):={E}_{d}\left({P}_{k}({x}_{u}\left(\tau \right),{y}_{u}\left(\tau \right),{z}_{u}\left(\tau \right))\right)\times (\frac{1}{{r}_{1}{r}_{2}}\frac{{r}_{2}}{{r}_{1}{r}_{2}})$. Both the UAV’s starting position and its target location were known for the purposes of cloud computing. It should be pointed out that slidingmode type algorithms similar in spirit to the algorithm in this paper have been successfully implemented with real UAVs in [
20,
46], where solutions to the real problems typical for such systems such as determining the locations of obstacles and their speed vectors were provided, as well as a real description of the actually implementation.
In this section, we describe the following two scenarios.
Scenario 1. In this simple scenario, the environment is devoid of dynamic obstacles. The UAV initiates the navigation process by transmitting its start and target points to a remote computer via wireless connection. The remote computer calculates the optimal route and returns trajectory waypoints. The UAV adeptly follows these waypoints, as illustrated in
Figure 4,
Figure 5 and
Figure 6. Throughout this journey, the UAV demonstrates its ability to navigate collisionfree around preknown static obstacles. RRT* is known for its effectiveness in path planning for holonomic vehicles. Thus, we compared our strategy with the RRT*type algorithm from [
47]. As our UAV was nonholonomic, we employed spline curves to accommodate the constraints in order to make a fair comparison possible.
Figure 7 represents the variation of the cost function for the proposed algorithm and the RRT* algorithm.
Figure 7 clearly demonstrates that our algorithm consistently maintains a lower cost function value throughout the UAV’s trajectory, highlighting its superiority in path planning and collision avoidance. Additionally, it is worth noting that our approach outperforms the RRT* algorithm in several other aspects. Our proposed algorithm significantly reduces the time required to reach the target, taking around 112 s compared to approximately 118 s with RRT*. A shorter distance is covered by the UAV when using the proposed algorithm, at approximately 55 m in contrast to roughly 59 m for RRT*. The total value of the cost function at the end of the trajectory is substantially lower for the proposed algorithm, measuring approximately 2015, while RRT* yields a higher value of approximately 2446. It is worth mentioning that the cost function was calculated at regular intervals of 0.125 s throughout the UAV’s journey. These additional metrics emphasize the superior performance of our proposed algorithm.
Scenario 2. In this scenario, multiple dynamic obstacles are introduced that intersect with the optimal path. When the UAV’s sensors detect the first obstacle, the switching rules are activated, as illustrated in
Figure 8. A zoomedin view is shown in
Figure 9. After UAV successfully avoiding an obstacle, the UAV resumes tracking the path (see
Figure 10). As the UAV continues to follow the waypoints, another moving obstacle approaches towards the UAV, attempting to intercept it, as shown in
Figure 10. The UAV successfully manoeuvres around the obstacle and continues moving toward the target. The entire trajectory is illustrated in
Figure 11 and
Figure 12. The trajectories in both scenarios exhibit similarity, with the exception of occasional deviations from the optimal path by the UAV that were necessary to avoid obstacles in Scenario 2. These results affirm the practicality and adaptability of our navigation strategy for UAVs in dynamic and obstacleladen environments. Furthermore, they underscore the robustness of our proposed strategy against realtime changes in the environment, highlighting its potential in a wide range of applications.