# A Closed-Form Method for Simultaneous Target Localization and UAV Trajectory Optimization
## 2 Target Localization Based on Visual Platform  
### System Structure and Preliminaries  
The referred UAVs in our project were equipped with an inertial measurement unit (IMU), a high precision global positioning system (GPS) with real-time kinematic (RTK) technique, and a visual tracking platform. The target localization workflow is shown in Figure 1. In the target localization process, the target is first detected and recognized by the video processing unit once the target is captured by the camera, and the video algorithm localizes the pixel centroid of the target and outputs the pixel position as the control block's input. The camera control module drives the pan/tilt servo motor to change the camera's azimuth and elevation angle through pulse width modulation, so as to lock the target image in the center of the camera's field of view (FOV). Meanwhile, the camera attitude sensors output the relative angles between the UAV and the camera. Combining the synchronized measurement data (MEA) from the GPS, IMU, and camera attitude sensors, the target can be localized in real time. Note that in the localization process, some prior information may be available such as the known height of the target to be localized. To introduce the proposed method concisely, we avoid discussing the observability of the moving target by guaranteeing the observability of the target (i.e., it is assumed that the target height is known while the related angle measurements are achieved). In many applications, the target usually moves in a limited area so that the ground can be considered as flat [3]. To illustrate the target localization procedure in detail, several coordinate frames should be introduced.  
(1) Global coordinate frame, notated as \(C^{g}\), where, the axes \(X^{g},Y^{g}\) point to the east and north directions, respectively, which together with axis \(Z^{g}\) form a right hand Cartesian frame and the origin \(O^{g}\) is set at a fixed point, as shown in Figure 2.  
(2) UAV geographical coordinate frame, notated as \(C^{u}\), which has the same directions as \(C^{g}\) over three axes except that the origin of the \(C^{u}\) is at the center position of mass of the UAV.  
(3) UAV body fixed coordinate frame, notated as \(C^{b}\), where, the axes \(X^{b}\),\(Y^{b}\) point to the front and left directions of the UAV, respectively, which together with axis \(Z^{b}\) form a right hand Cartesian frame, with the origin coinciding with \(O^{b}\).  
(4) Camera coordinate frame, represented by \(C^{c}\), which coincides with \(C^{b}\) when the attitude angles of the camera are kept at the initial positions (i.e., the azimuth angle and elevation angle are both zero). Note that using the control block, as shown in Figure 1, the positive direction of the \(Z^{c}\)-axis always points to the UAV from the target, as shown in Figure 2. As the point of mass of the UAV is very close to the optical center of the camera, the origins of \(C^{u}\) and \(C^{b}\) can be assumed to be at the optical center.  
Figure 1: Target localization workflow.  
Figure 2: Illustration of coordinate frames.