# Quadrotor UAV Dynamic Visual Servoing Based on Differential Flatness Theory
## 3 Tracking Strategy
### Loop 2: Trajectory Generation
#### 3.2.1 Characteristics of the Descriptor  
The tracking problem using a camera as a visual sensor is a 2D dynamic visual servoing problem. In this case, tracking is guaranteed if we manage to keep the vehicle (the target) centered in the image plane, as shown in Figure 3.  
According to the behavior of the dynamics proposed in Equation (6), the knowledge of the displacements (\(\Delta x_{r}\), \(\Delta y_{r}\)) according to the axes \(X_{w}\) and \(Y_{w}\) makes it possible to deduce the orientation \(\psi\) along the \(Z_{w}\)-axis. In effect,  
\[\psi=atan\left(\frac{\Delta y_{r}}{\Delta x_{r}}\right). \tag{7}\]  
Since we know \(z_{c}=z=z_{d}\), we can deduce the displacements (\(\Delta x_{r}\), \(\Delta y_{r}\)) from the coordinates of a single point, \(P\), of the vehicle (the target). This point can be chosen in an arbitrary way, belonging to the vehicle but other than that which coincides with the center of projection of the camera because it is invariant to the rotation according to the axis \(Z_{w}\).  
It is interesting here to take the point, \(P\), on the horizontal axis, \(H\), of the image (Figure 3) passing through the center of projection, \(o\), because all the points located on this axis are invariant to displacement along \(Z_{w}\). To simplify the task of extraction, this point can represent the center of gravity of the vehicle or even the center of gravity of the vehicle hood, as shown in Figure 3. Let \(\mathbf{X}=(X_{c},Y_{c},Z_{c}=z_{d}=constant)\), the coordinates of the point, \(P\), in the 3D Cartesian coordinate system; the projection of this point on the image plane is done in \(p\) of coordinates \((x_{m},\ y_{m})\) expressed in millimeters. The visual information considered in this work is \(S=(x_{m},\ y_{m})\). The expressions of these coordinates are given by the following relations:  
\[\left\{\begin{array}{l}x_{m}=\frac{\chi_{c}}{Z_{c}}=\frac{(u-c_{o})}{f\,a_{ u}}\\ y_{m}=\frac{\chi_{c}}{Z_{c}}=\frac{(v-c_{o})}{f\,a_{v}}\end{array}\right., \tag{8}\]  
where \((u,v)\) represents the coordinates of the point \(p\) of the image expressed in pixels. \(a=(c_{u},c_{v},f,a_{u},a_{v})\) is the set of intrinsic parameters of the camera with \((c_{u},c_{v})\), the  
Figure 3: Image coordinate system.  
coordinates of the principal point of the image; \(f\) is the focal length; and \((\alpha_{u},\alpha_{v})\) are the vertical and horizontal scale factors expressed in pixel/mm. By performing the derivation with respect to the time of the projection equations in (8) we obtain:  
\[\dot{\mathbf{S}}=l_{s}.V, \tag{9}\]  
where \(V\) is the kinematic torsor of the camera formed by the translation velocities, \(v_{c}\), and the rotation velocities, \(\omega_{c}\). \(L_{s}\) denotes the interaction matrix, also known as the Jacobian of the image, and is given by:  
\[L_{s}=\begin{bmatrix}-\frac{1}{z_{d}}&0&\frac{x_{m}}{z_{d}}&x_{m}y_{m}&-\left( 1+x_{m}^{2}\right)&y_{m}\\ 0&-\frac{1}{z_{d}}&\frac{y_{m}}{z_{d}}&1+y_{m}^{2}&-x_{m}y_{m}&-x_{m}\\ \end{bmatrix}. \tag{10}\]  
Since the movement of the robot is assumed to be in a plane and, using Equation (7), we can conclude that if we know the translational speed along the \(X_{c}\)-axis and the rotational speed along the \(Z_{c}\)-axis we can deduce the translation speed along the \(Y_{c}\) -axis. The interaction matrix can be reformulated as follows:  
\[L_{s}=\begin{bmatrix}-\frac{1}{z_{d}}&y_{m}\\ 0&-x_{m}\\ \end{bmatrix}. \tag{11}\]  
Equation (9) can be rewritten in the following form:  
\[\begin{pmatrix}\dot{x}_{m}\\ \dot{y}_{m}\\ \end{pmatrix}=\begin{pmatrix}-\frac{1}{z_{d}}&y_{m}\\ 0&-x_{m}\\ \end{pmatrix}\begin{pmatrix}v_{r}\\ \omega_{r}\\ \end{pmatrix}. \tag{12}\]