# A Closed-Form Method for Simultaneous Target Localization and UAV Trajectory Optimization
## 4 Simulations, Experiments and Results Analysis
### Field Experiment  
To validate the effectiveness of the proposed method in the field applications, field experiments were conducted in this subsection. The platform we used was the DJI M100, a platform for developers as shown in Figure 11, which was modified to output the attitude angles of the camera, but the precision of the camera attitude was low with a standard deviation of about 5 degrees. The onboard IMU can output the UAV attitude angles with error levels ranging from 1 degree to 5 degrees, and we assumed them as zero mean Gaussian noises, for which the standard deviations are shown in Table 2.  
Figure 11: Hardware device. (**a**) Top view; (**b**) side view. Figure 10: RMSE errors of target localization for the moving target with constant acceleration. The target-tracking video algorithm, which can detect and track a pre-specified target was incorporated into the main board of the UAV. The optimized waypoints for UAV were generated by the proposed method, which were then the input index for the internal control algorithm and linear model predictive control (LMPC) algorithm [29]. The control algorithm, together with the information of the current UAV state, was responsible for controlling the UAV to arrive the index point. We designed the experiment to track and localize an outdoor car, as shown in Figure 12. The car performed an approximately constant velocity motion (5 m/s along the \(X^{g}\) direction), and the covariance for the process noise were set as \(\textbf{{I}}_{2\times 2}\) (i.e., the motion uncertainty in each direction was set as 1 m; the flight altitude is set as about 100 m; UAV had the initial position as (0 m, 100 m, 100 m)). According to the constraints of UAV motion, the experiments were conducted in two scenarios. The first scenario was with the UAV minimum and maximum velocities set as 0 m/s and 9 m/s, respectively; the second scenario was with the UAV minimum and maximum velocity set as 5 m/s and 9 m/s, respectively. In each iteration, after the optimized waypoint is computed, the onboard control algorithm guided the UAV to the indexed waypoint. Therefore, we achieved the actual UAV trajectory result, but not the planned trajectory. The actual trajectory results were obtained as Figure 13a,b. Figure 14 is the relative trajectory result for the scenario with the minimum velocity of 5 m/s, and as the relative trajectory of Figure 13a is trivial, it was neglected. From Figure 13a, we can see that the optimized trajectory nearly coincided with the car trajectory in the horizontal plane in the scenario with the zero minimum velocity constraint. The underlying reason is that the allowable minimum velocity is 0, and the optimal waypoint above the target location can be retained. Figures 13b and 14 show that after being imposed, the nonzero minimum velocity constraint and the relative UAV trajectory still tends to circle the target at a constant height, but the circle was not standard, and instead, the UAV hovered along the \(Y\) direction. The difference between the field test results and the simulation results can be explained as follows. In the field test, the resulting UAV waypoints, which are the direct consequence of the LMPC algorithm, are not the output from the waypoint optimization algorithm. Hence, the trajectory result also contains imperfections or the influence of the control algorithm. In the simulation examples, the UAV waypoints were all the direct outputs of the trajectory optimization \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **Roll Angle** & **Pitch Angle** & **Yaw Angle** & **Azimuth** & **Elevation** \\ \hline SYM & \(\phi\) & \(\theta\) & \(\varphi\) & \(\alpha\) & \(\beta\) \\ STD (degree) & 1.5 & 1.5 & 2 & 5 & 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Measurement noise setting. Figure 12: Tracking and localization of a car. algorithm, and thus the waypoints are the result under the ideal condition.