3.1. Traditional DWA
The DWA is a local path planning algorithm based on velocity space sampling [
35]. Its core mechanism lies in generating a large number of candidate velocity pairs
within the velocity space satisfying multiple constraints in each sampling period
, and these candidate velocity pairs collectively constitute a dynamic window. The construction of this window requires sequentially considering two types of constraints, and then through steps including trajectory deduction, multi-objective evaluation, and optimal selection, the robot’s motion state at the next moment is ultimately determined.
- •
Constraint Construction
The constraint construction of the dynamic window follows a logical progression from physical feasibility to environmental safety and sequentially encompasses the following two types of constraints:
Firstly, from the perspective of physical feasibility, based on the kinematic limits (maximum/minimum linear velocity) and dynamic constraints (maximum acceleration/maximum deceleration) of the robot, the range of admissible linear and angular velocities is defined:
Admissible Linear Velocity Set:
where
and
represent the lower and upper bounds of
, respectively;
denotes the current linear velocity of the robot; and
signifies the maximum linear acceleration/deceleration of the robot.
Admissible Angular Velocity Set:
where
and
represent the lower and upper bounds of
, respectively;
denotes the current angular velocity of the robot; and
signifies the maximum angular acceleration/deceleration of the robot.
Secondly, to ensure safety, environmental safety constraints need to be introduced. The velocity pairs
filtered above only ensure the physical feasibility of linear and angular velocities, and do not account for environmental safety. This constraint ensures the robot has reliable emergency braking capability at any point on the predicted trajectory by requiring its braking distance to be less than the minimum distance to obstacles (denoted as
). The mathematical expression is as follows:
- •
Trajectory Deduction
For each retained candidate velocity pair
, trajectory deduction is performed based on the robot’s kinematic model (Equation (6)) to predict the motion trajectory within a future time period
, as shown in
Figure 2.
where
and
represent the positions of the robot at time
and
, respectively;
and
denote the yaw angles of the robot at time
and
, respectively; and
is the sampling period.
For each candidate velocity pair , the complete trajectory deduction calculation follows the following steps:
(1) Initialization: Take the robot’s current global pose as the starting point for the simulation. Set the sampling period and the total simulation time , so the total number of simulation steps is . Initialize the trajectory sequence .
(2) Iterative prediction: Perform a loop on :
① Let the current pose be denoted as .
② Calculate the pose at the next moment based on the kinematic model (6).
③ Add the new pose to the trajectory sequence: .
(3) Output trajectory: After the loop ends, the predicted trajectory is obtained, which consists of number of discrete pose points and represents the robot’s motion path within future time interval under the control of speed .
- •
Multi-Objective Evaluation
After completing the trajectory deduction for all candidate velocity pairs, a multi-objective evaluation function (Equation (7)) is used to quantitatively assess these predicted trajectories, in order to select the optimal speed pair.
where
,
, and
are weight coefficients used to adjust the relative importance of various indicators.
,
, and
represent the normalized values of
,
, and
, respectively.
The definitions of each evaluation sub-function are as follows:
Guidance sub-function
: represents the alignment degree of the trajectory end with the target direction [
36], with its value being as follows:
where
is the azimuth angle from the trajectory end to the Target point, and
is the yaw angle of the robot at the trajectory end.
Safety sub-function : Takes the distance from the end of the current predicted trajectory to the nearest obstacle.
Velocity sub-function : Takes the current linear velocity .
Finally, the velocity pair with the highest score in the evaluation function is selected as the linear and angular velocities of the mobile robot for the next moment.
3.2. Initial Heading Angle Setting
At the beginning of the first iteration of the DWA, an initial heading angle must be set for the robot, which directly determines the starting direction of the first batch of simulated trajectories. In traditional DWA for path planning, the initial heading angle is usually assigned a fixed value (such as 0°, +90°, or 180°). However, this setting has obvious drawbacks: when the Target point is located on the side or behind the robot’s initial orientation, the robot often needs to waste time rotating in place or taking local detours to gradually adjust to the target direction, thereby significantly reducing the execution efficiency of path planning. As shown in
Figure 3, due to the large deviation between the initial heading angle and the target direction, the robot’s planned trajectory exhibits significant local detours in the initial stage, requiring additional path adjustments to correct the direction of travel. This intuitively reflects the decrease in execution efficiency under this strategy.
To address this issue, some studies have proposed an improved scheme, which sets the initial heading angle by calculating the azimuth between the starting point and the global target point [
37]. Although this method incorporates global target information, it ignores the real-time constraints of the local environment, which may lead to serious consequences in complex scenarios. For instance, if an obstacle lies on the line connecting the starting point and the global target point and is adjacent to the starting point, the preset heading angle will guide the evaluation function to prioritize trajectories along this line, which directly points toward the obstacle. This not only poses a collision risk but may also lead to the planning process falling into local deadlock and failing. As shown in
Figure 4, there is an obstacle in the direction of the global target point, the trajectory approaches the obstacle area at the initial stage and incurs a significant collision with the obstacle during the planning process.
To tackle the deficiencies of the aforementioned two methods, this paper proposes an initial heading angle optimization strategy based on global path guidance. Firstly, the enhanced A* algorithm proposed in this paper is utilized for global path planning in a known static map, generating an optimal path composed of a series of key intermediate transition points, which is
. Subsequently, in the initialization phase of DWA local planning, the first intermediate transition point
of the global path is set as the initial local goal, and the azimuth angle between Start and
is calculated. This angle is directly adopted as the initial heading angle for the first iteration of the DWA algorithm. This improvement ensures that from the first planning cycle onwards, the starting direction of the simulated trajectory points toward the first intermediate transition point of the global optimal path, thereby providing a correct and efficient initial search direction for the subsequent iterative planning of the dynamic window. As shown in
Figure 5, the trajectory follows the extension trend of the global path from its starting position, thereby ensuring that the planning is both globally optimal and safe from the initial stage.
3.3. Evaluation Function Optimization
In local path planning for mobile robots based on the DWA, the safety sub-function
plays a crucial role in ensuring collision-free navigation for the robot [
38]. The traditional DWA algorithm has three limitations in the design of this sub-function: Firstly, when calculating the distance from the trajectory endpoint to the nearest obstacle, it only considers the impact of static obstacles and does not incorporate the distance evaluation of dynamic obstacles. Secondly, the sub-function always adopts the Euclidean distance from the trajectory endpoint to the obstacle as the evaluation score. In open environments, this distance value is likely to be excessively large, disrupting the balance between the guidance evaluation and velocity evaluation, leading to an overly conservative planning strategy and thus sacrificing navigation efficiency. Thirdly, its safety evaluation weight β is usually set as a fixed value and cannot be adaptively adjusted according to the congestion degree of the local environment [
39], resulting in a lack of flexibility in the planning strategy.
In response to the aforementioned issues, this paper has made three targeted improvements to the safety sub-function:
- •
Integration of a Dynamic Obstacle Model
To enhance the algorithm’s obstacle avoidance capability in dynamic environments, this paper extends the obstacle model. In traditional methods, the obstacle set only includes static obstacles. This study expands it to the union of static and dynamic obstacles, that is, . When calculating the safety sub-function for the current predicted trajectory, the algorithm will search for the minimum value in the extended obstacle set. This improvement enables the robot to perceive and respond to moving obstacles, thereby enhancing the foresight and safety of the navigation process.
- •
Establishment of a Safety Distance Saturation Mechanism
To address the issue of evaluation function imbalance caused by an excessively large value of in open environments, this paper introduces a saturation mechanism: First, set a saturation threshold (here set to ). When the calculated is greater than this threshold, the value of is limited to this saturation threshold. The core purpose of this mechanism is to prevent the safety evaluation term from occupying an absolutely dominant position in the overall evaluation function, thereby ensuring that the guidance evaluation term and the velocity evaluation term can play their due roles in the decision-making process and maintaining the balance of the algorithm in multi-objective optimization.
To verify the rationality and optimality of the safety distance saturation threshold, this study designs a parameter sensitivity comparison experiment: in the same map scenario, other algorithm parameters are fixed, and only the safety distance saturation threshold is adjusted. A total of six sets of variables are set, which are 0.5 times, 1 time, 2 times, 3 times, 4 times, and 5 times the safety distance, respectively. Each group of experiments is run independently 30 times. The experimental results are presented in
Table 4, and the corresponding path planning results are illustrated in
Figure 6a–f.
Observations from
Table 4 reveal that as the safety distance saturation threshold increases from 0.5 times to 4 times, the data in the table shows a gradual decrease in planning time from 37.4450 s to 18.2190 s, while the path length increases from 17.0221 m to 23.4629 m.
Figure 6a–e visually demonstrate a continuous decrease in the fit between the planned path and the global optimal path. Specifically, the path at
is the shortest, but as evident from
Figure 6a, there are two collisions, posing serious safety risks and failing to meet application requirements; at the
, no collisions occur, and the path fits well with the global optimal path (
Figure 6b), but the planning time reaches 27.0140 s, indicating low efficiency; the planning times at the 3 and 4 times
are further shortened, but the path length significantly increases, and
Figure 6d,e show obvious path redundancy and poor fit with the global optimal path; at the
, due to a severe imbalance in the evaluation function, the robot rotates in place to maintain an excessively large safety distance, completely neglecting the core task of moving towards the target point. It did not generate a path to reach the target even after one minute. In contrast, the
achieves optimal balance among multiple objectives: firstly, the planned path is safely reachable, and secondly, the planning time is 23.2600 s (a reduction of 13.9% compared to
), and the path length is only 18.1070 m (an increase in only 3.3% compared to
). This unique advantage of simultaneously considering safety, efficiency, and path optimality fully validates the scientific and rational setting of the
saturation threshold.
- •
Design of an Adaptive Strategy for Safety Evaluation Weight
To enable the planning strategy to intelligently respond to environmental changes, this paper designs a weight adjustment strategy based on local environmental features. This design is inspired by the adaptive intelligence of natural animals such as antelopes and bats in dynamic obstacle avoidance—these creatures adjust their behavioral weights in real time based on local environmental features such as obstacle density and target distance when navigating complex environments. In open, low-threat scenarios with few obstacles, they prioritize increasing the weight of movement efficiency to quickly complete foraging or migration tasks. In scenarios with dense obstacles and imminent danger, they immediately emphasize the weight of obstacle avoidance safety, reduce movement speed, and precisely evade risks, ultimately achieving a dynamic balance between efficiency and safety [
40]. Inspired by this, this paper integrates this biological adaptive mechanism into the weight design of the dynamic window method. This strategy dynamically adjusts the weight coefficient
of the safety evaluation term by calculating the obstacle occupancy rate
of the 8-neighborhood grids around the endpoint of the current predicted trajectory. When
, it indicates that the robot is in a relatively complex area; at this time, the weight is increased according to (Equation (9)) to enhance obstacle avoidance:
Otherwise, the base weight is adopted to encourage efficient travel of the robot. This design enables the algorithm to autonomously adjust its behavioral strategy according to the congestion degree of the environment. In congested environments, the weight of the safety term is proactively increased, prompting the robot to adopt a more conservative obstacle avoidance strategy to ensure navigation safety; in open environments, the base weight provides the robot with greater motion freedom, achieving the synergistic improvement of target orientation and motion efficiency.
To verify the effectiveness of the proposed adaptive weight strategy, this paper designs four sets of comparative experiments in the same narrow corridor environment with multiple obstacles. The experiments maintain the core parameters, such as the fixed basic weight and the obstacle occupancy calculation rule, unchanged. By setting differentiated safety weight adjustment strategies, the performance differences between the fixed weight and adaptive weights with different adjustment magnitudes are compared. The safety weight calculation rules for the four sets of experiments are as follows:
Fixed weight strategy: (no adaptive adjustment is performed throughout the process, maintaining the base weight.)
Adaptive adjustment strategy 1:
Adaptive adjustment strategy 2 (adopted in this paper):
Adaptive adjustment strategy 3:
Each set of experiments was independently run 30 times. The quantitative experimental results are presented in
Table 5, the corresponding path planning results are illustrated in
Figure 7, and the time-series variations in the robot’s linear velocity are depicted in
Figure 8.
From the perspective of navigation safety, the fixed weight strategy (
) resulted in three significant collisions in the high-risk areas of ODZ (ODZ, Obstacle Danger Zone—refers to key areas with high collision risks for robots to pass through, uniformly marked with orange boxes in
Figure 7a–d). Its extremely high collision risk renders it completely impractical for real-world applications. Although the adaptive strategy 1 (
) was adjusted based on the obstacle occupancy rate, the adjustment magnitude was insufficient, and collisions still occurred in the aforementioned high-risk areas (as shown
Figure 7b), thus failing to deliver adequate safety assurance. However, both strategy 2 and strategy 3 achieved zero collisions, successfully avoiding the collision risks in all high-risk areas of ODZ (see
Figure 7c,d).
From the perspective of planning efficiency, as shown in
Figure 8, the fixed weight strategy maintains a constant safety weight throughout the process without introducing a dynamic weight adjustment mechanism, and makes no targeted adjustments even when passing through the areas of ODZ. Therefore, it traverses the narrow corridor at a relatively high speed, achieving the highest average speed of 0.4435 m/s and the shortest planning time of 23.5620 s. However, the high speed directly leads to a sharp increase in collision risk. Strategy 1, owing to a slight increase in safety weight in accordance with the obstacle occupancy rate, travels through the narrow corridor at a marginally lower speed than the fixed weight strategy, with the average speed dropping to 0.4209 m/s and the planning time increasing to 25.5870 s. Although the speed is reduced, the collision problem is not solved. Adaptive adjustment strategy 3, due to excessive adjustment of safety weight, causes the algorithm to overly focus on obstacle avoidance safety in path planning, maintaining a very low speed throughout the process, with an average speed of only 0.2745 m/s and a planning time of up to 39.8800 s. Although safety is guaranteed, efficiency is excessively sacrificed, severely restricting the robot’s operational efficiency. Adaptive adjustment strategy 2 tends to be conservative when passing through the narrow corridor, with an average speed of 0.3825 m/s and a planning time of 29.6180 s. Compared to the fixed strategy, the path length increases by 5.6% and the planning time increases by 25.7%, with the efficiency loss being within a controllable range. Compared to strategy 3, the average speed increases by 39.3% and the planning time decreases by 25.7%. While achieving zero collisions, it significantly improves operational efficiency, truly achieving a balanced trade-off between safety and efficiency. In summary, this paper selects the adaptive adjustment strategy 2.