# A Trajectory Generation Method for Multi-Rotor UAV Based on Adaptive Adjustment Strategy
## 4 Experiment and Result
### Simulation  
This section verifies through simulation the effectiveness of the trajectory optimization method proposed in this paper. The simulation tests include two scenarios. The first scenario is a wall obstacle scenario. The second is a column obstacle scenario. The wall and column obstacles are typical types of multi-rotor UAV autonomous motion planning tasks. Two different shape obstacle scenarios can thoroughly test the effectiveness of the trajectory generation method. The size of the test environment is 10 m \(\times\) 6 m \(\times\) 3 m, and the coordinate ranges of \(X\), \(Y\), and \(Z\) axes are [0 m, 10 m], [\(-\)3 m, 3 m], [0 m, 3 m], respectively. In the two scenes, the initial and end positions are the same. The initial position of the multi-rotor UAV is [1.0 m, 0.0 m, 1.0 m], and the end position is [9.0 m, 0.0 m, 2.0 m]. The trajectory generation needs to consider the dynamics settings of the multi-rotor UAV. In the two tests, the maximum speed is set to 2.5 m/s, and the maximum acceleration is 5 m/s\({}^{2}\). In the experiment, the \(A^{*}\) method [2] is used to search the initial path for trajectory optimization. This test uses MATLAB to complete the implementation and testing of the proposed method. The MATLAB version is 2021B. The test environment is a laptop with a Windows10 system equipped with an i7-11700H processor and 16 GB RAM. On hundred tests were conducted in both environments. In each test, we use the \(A^{*}\) method to search for the approximate optimal path and then generate a safe and smooth trajectory based on the trajectory generation method proposed in this paper. The test uses the trajectory generation method in the reference [17] as the comparison method, which is widely used in the trajectory generation task of multi-rotor UAVs. In order to conduct a quantitative analysis of the trajectory, this paper uses four variables, namely planning time, trajectory running time, length, and smoothness, as evaluation indicators. The smoothness of the trajectory is the mean value of the absolute value of the acceleration. The results are shown in Table 3. It can be seen from the results in the table that, compared with Fast-Planner, the proposed method adds safety distance calculation and dynamic adjustment steps. Hence, the planning time is slightly longer than Fast-Planner, but both can meet the real-time requirements of multi-rotor UAV motion planning. Compared with the trajectory obtained by Fast-Planner, the motion time of the trajectory obtained by the proposed method is reduced by 16.2% compared with Fast-Planner, the trajectory length is reduced by 16.25%, and the average acceleration is reduced by 16.25%. Figure 4: Generated trajectory comparison in scenario 1. (**a**) Generated trajectories comparison. (**b**) Projection of the trajectories on the \(X\)–\(Y\) plane. Figure 5: Trajectory velocity curve comparison. (**a**) Proposed Method. (**b**) Fast-Planner. Figure 6: Trajectory acceleration curve comparison. (**a**) Proposed Method. (**b**) Fast-Planner. by 7.98%. Therefore, the trajectory planned by the proposed method can make the UAV reach the target point more quickly and move more smoothly. In scenario 2, the trajectory generation method is shown in Figure 7. The blue dotted line is the initial path found by \(A^{*}\), the solid red line is the trajectory optimized by Fast-Planner, and the green dash-dotted line is the trajectory obtained by the proposed method. In scenario 2, Fast-Planner and the proposed method get a safe and smooth trajectory. Figures 8 and 9 show the planned trajectory velocity and acceleration curves of Fast-Planner and the proposed method in scenario 2. The experiment results show that the velocity and acceleration of the trajectory meet the dynamic requirements, the starting point and end point of the speed and acceleration meet the preset values, and the velocity and acceleration do not exceed the maximum limits of 2 m/s and 10 m/s\({}^{2}\). Therefore, both trajectories are dynamically feasible.