# Obstacle Avoidance in a Three-Dimensional Dynamic Environment Based on Fuzzy Dynamic Windows
## 3 Proposed Dynamic Window Approach
### The Fuzzy Rule for the DF_DWA  
According to the evaluation function (26), the agent selects the best speed group in the predicted trajectory as the action command. The reward value in the evaluation function determines the weight of each evaluation term in the process of predicting the trajectory. Therefore, with different weight settings, the selected trajectories are also different. In the next paragraphs, we will discuss the impact of the weight settings on trajectory generation and obstacle avoidance, in which each reward value of the evaluation function will be set to zero or predominant parameter. Figure 7: Perception prediction planning architecture. To test the influence of the reward value weight in the evaluation function on the trajectory generation, we set scenarios as shown in Figures 8 and 9, and the test data is given in Table 1. The starting point of the agent is (0,0,0) and the goal point of the agent is (4,4). \(\alpha\) is the number of iterations in each case. \(\overline{v}\) and \(\overline{\omega}\) are the average linear velocity and the average angular velocity of the agent, respectively. Meanwhile, the variance of linear velocity (\(\sigma_{v}\)\({}^{2}\)) and angular velocity (\(\sigma_{\omega}\)\({}^{2}\)) is used to evaluate the smoothness of the trajectory. In the test, the speed of the agent is limited to 2 m/s (linear velocity) and 60 degree/s (angular velocity). The acceleration is limited to 0.5 m/s\({}^{2}\) (linear velocity) and 90 degree/s\({}^{2}\) (angular velocity). Figure 8: The path planning results with each reward value of the evaluation function being set to predominant weight: (**a**) front view (**b**) side view. It can be seen from Figure 8 that when \(\varepsilon_{obstalice}\) is set as the predominant weight, the planned trajectory can avoid obstacles. If other terms are set as the predominant weight, the trajectory can cross through obstacles, resulting in failure of obstacle avoidance. Meanwhile, Figure 9 shows that if the value of \(\varepsilon_{obstalice}\) is set to zero, the trajectory cannot avoid obstacles. When \(\varepsilon_{spend}\) is set as the predominant weight, it can be observed from Table 1 that the number of iterations is the least. If \(\varepsilon_{spend}\) is set to zero, although the agent can safely reach the target position, the number of iterations doubles. It can be observed from Figures 8 and 9 that the same situation occurs when \(\varepsilon_{handing}\) is set to zero or \(\varepsilon_{goal}\) is set as the predominant weight. In other words, the trajectory reaches the goal after a full circle, which increases the number of iterations and causes the trajectory to be not smooth enough. Figure 9: The path planning results with each reward value of the evaluation function being set to zero: (**a**) front view (**b**) side view. It can also be analyzed from Figure 9 that when there is no \(\varepsilon_{\textit{pitchreading}}\), the trajectory has a horizontal rotation, and when \(\varepsilon_{\textit{synchronading}}\) is absent, there is a vertical rotation. Therefore, the weight of these two evaluation items should not deviate too much when being set. In addition, Figure 9a shows that if \(\varepsilon_{\textit{goal}}\) is zero, the agent will fall into local minima. The above analysis shows that, in the evaluation function, a single or constant combination of reward values cannot guarantee the safety of the agent's trajectory. When the environment changes, the agent cannot make changes to adapt to the environment. Therefore, based on the traditional DWA, this paper introduces fuzzy rules to adjust the reward value. When setting a fuzzy rule to adjust the weights of parameters, the distance to the obstacle and the distance to the target are used as the inputs of the fuzzy rule, and the evaluation coefficients of the speed, distance to the goal, distance to the obstacle, and the direction to the goal are used as outputs. The fuzzy rule is shown in Figures 10 and 11. 1.