# Path Planning of Mobile Robots with an Improved Grey Wolf Optimizer and Dynamic Window Approach
## 4 Improved Dynamic Window Approach  
### Standard Dynamic Window Approach  
Dynamic Window Approach (DWA) is a local path planning algorithm. Its core idea is to assess the robot's surroundings and sample candidate linear and angular velocities, simulate the resulting trajectory for the next time step, and subsequently select a safe and efficient path by evaluating these trajectories using an evaluation function [36].  
The mobile robot kinematic model is shown in Formula (22):  
\[x(t) =x(t-1)+v(t)\Delta t\cos(\theta(t-1))\] \[y(t) =y(t-1)+v(t)\Delta t\sin(\theta(t-1)) \tag{22}\] \[\theta(t) =\theta(t-1)+\omega(t)\Delta t\]  
where \(x(t)\), \(y(t)\), and \(\theta(t)\) are the current pose information of the mobile robot, \(v(t)\) and \(\omega(t)\) are the current linear and angular velocities of the mobile robot, and \(\Delta t\) is the time interval. The mobile robot is constrained by linear and angular velocities as shown in Formula (23):  
\[V_{T}=\left\{(v,w)|v_{\min}\leq v\leq v_{\max},w_{\min}\leq w\leq w_{\max}\right\} \tag{23}\]  
Due to the limited motor torque, the robot is constrained by its capability, as shown in Formula (24):  
\[V_{D}=\left\{(v,w)\middle|v_{c}-\dot{v}\Delta t\leq v\leq v_{c}+\dot{v}\Delta t,w_{c}-\dot{w}\Delta t\leq w\leq w_{c}+\dot{w}\Delta t\right\} \tag{24}\]  
where \(v_{c}\) and \(w_{c}\) are the linear and angular velocities of the mobile robot at the current time, and \(\dot{v}\) and \(\dot{w}\) are the maximum linear acceleration and maximum angular acceleration due to the motor. To ensure collision-free path planning, the mobile robot must maintain a predefined safety margin when navigating near obstacles, with the constraint relationship expressed in the following Formula (25):\[V_{A}=\left\{(v,w)_{\
u}\left|v\leq\sqrt{2\text{dist}(v,w)\dot{v}},w\leq\sqrt{2 \text{dist}(v,w)\dot{w}}\right.\right\} \tag{25}\]  
where \(\text{dist}(v,w)\) is the distance evaluation function, which calculates the distance between the mobile robot and the obstacle. The mobile robot must satisfy the aforementioned three constraints, and after sampling, the motion trajectory is computed. Subsequently, the evaluation function is applied to the motion trajectory to determine the optimal path, and the standard evaluation function is shown in Formula (26):  
\[G(v,w)=\lambda_{1}\text{heading}(v,w)+\lambda_{2}\text{dist}(v,w)+\lambda_{3} \text{velocity}(v,w) \tag{26}\]  
where \(\text{heading}(v,w)\) is the azimuth evaluation function, denoting the angle difference between the mobile robot's heading and the target point at the current time; \(\text{velocity}(v,w)\) is the velocity evaluation sub-function, denoting the speed of the current robot trajectory; and the weights for the three evaluation criteria are represented by \(\lambda_{1}\), \(\lambda_{2}\), and \(\lambda_{3}\), respectively.  
We found that the conventional DWA algorithm still exhibits some shortcomings, and we have introduced the following improvements to address them:  
1. Global Optimization Strategy  
Instead of using only the endpoint as the goal--which can cause the robot to become trapped in local optima--we combine DWA with PAGWO. The globally optimal path generated by PAGWO is decomposed into several local goal points, guiding the robot step-by-step toward the final destination.
2. Dynamic Heading Angle  
Rather than relying on a fixed heading angle based solely on the start-to-target direction, we now adjust the robot's heading based on the next waypoint provided by PAGWO. This dynamic adjustment enables the robot to respond more effectively to environmental changes and to follow the optimal path.
3. Conflict Avoidance Strategy  
We have implemented a new conflict avoidance mechanism that assesses the relative positions and angles between the robot and dynamic obstacles. If a frontal conflict is detected, the robot accelerates to bypass the obstacle; if a non-frontal conflict is identified, it stops and waits. This tailored response improves overall navigation efficiency by better handling dynamic obstacles.