# High-Fidelity Drone Simulation with Depth Camera Noise and Improved Air Drag Force Models
## 3 Rotor Drag Force Model Implementation
### Rotor Drag Force Model  
The air drag force model calculates the air friction in simulation. In Gazebo and Airsim simulator, the air drag force model [43] is implemented using the equation below. \[\mathbf{F_{a}}=-\mathbf{D}\mathbf{R}^{\mathbf{T}}\mathbf{v} \tag{5}\]  
where \(\mathbf{F_{a}}\) is the air drag force, \(\mathbf{D}\) is the coefficient matrix, \(\mathbf{R}\) is the rotation matrix of a drone, and \(\mathbf{V}\) is the velocity of a drone. However, Equation (5) is too simplified for high-speed drone flight. To accurately simulate high-speed drone flight, we calculate more realistic aerodynamic forces by considering the forces acting on the drone's rotor. The following equation demonstrates how air drag force acts on one rotor [44]:  
\[\mathbf{F_{a}^{i}}=-\sqrt{T_{i}}c_{d1}\mathbf{\pi_{e3}}\mathbf{V}_{a}^{i} \tag{6}\]  
where \(T_{i}\) is the thrust generated by rotor \(i\), \(\mathbf{V}_{a}^{i}\) is relative air velocity expressed in the body frame, \(\mathbf{\pi_{e3}}=\mathbf{I}-\mathbf{e_{3}}\mathbf{e_{3}^{i}}\), and \(\mathbf{e_{3}}\) is \([0\quad 0\quad 1]\). Due to \(\sqrt{T_{i}}\) in Equation (6), the rotor drag force does not satisfy differential flatness [45]. As shown in Figure 11, to satisfy differential flatness, \(\sqrt{T}\) is linearized as below. \[\sqrt{T_{i}}\approx kT_{i}+b,\qquad k,b>0 \tag{7}\]  
where \(k\) and \(b\) are coefficients. Using the approximation in Equation (7), we can write Equation (6) as below:  
\[\mathbf{F_{a}^{i}}=-(kT_{i}+b)c_{d1}\mathbf{\pi_{e3}}\mathbf{V}_{a}^{i} \tag{8}\]  
Figure 11: Linearization of \(\sqrt{T}\) to \(kT+b\). Since there are four rotors in a quadrotor, and the total air drag force can be expressed as follows. \[\mathbf{F_{a}}=\sum_{i=1}^{4}\mathbf{F_{a}^{i}}=\sum_{i=1}^{4}-(kT_{i}+b)c_{d1} \boldsymbol{\pi_{e3}}\mathbf{V}_{a}^{i} \tag{9}\]  
where \(\mathbf{F_{a}}\) is the total air drag force acting on the quadrotor. The position vector of each rotor, represented as \(\mathbf{d}_{i}\), is a combination of the horizontal position vector \(\mathbf{d}_{(x,y,i)}\) and the vertical position vector \(\mathbf{d}_{(z,i)}\). By incorporating this information, Equation (9) can be expressed in the following form:  
\[\mathbf{F_{a}}=\sum_{i=1}^{4}\mathbf{F_{a}^{i}}=\sum_{i=1}^{4}-(kT_{i}+b)c_{d1 }\boldsymbol{\pi_{e3}}(\mathbf{R^{T}V_{a}}+\boldsymbol{\omega}\times(\mathbf{ d}_{i})) \tag{10}\]  
\[\mathbf{F_{a}}=\sum_{i=1}^{4}\mathbf{F_{a}^{i}}=\sum_{i=1}^{4}-(kT_{i}+b)c_{d1 }\boldsymbol{\pi_{e3}}(\mathbf{R^{T}V_{a}}+\boldsymbol{\omega}\times(\mathbf{ d}_{x,y,i}+\mathbf{d}_{z,i})) \tag{11}\]  
where \(\boldsymbol{\omega}\) is angular velocity of quadrotor. It is common practice to place rotors symmetrically around the center of gravity and at the same height. This arrangement implies the use of an even number of rotors. According to [46], the effect of the wind, with speeds below 4 m/s, on the drone's position can be considered negligible. In our experiments, the wind speed was consistently below 4 m/s, so we assumed there was no wind. Therefore, Equation (11) can be simplified as below:  
\[\mathbf{F_{a}}=-(kT+b)c_{d1}\boldsymbol{\pi_{e3}}\mathbf{v}-kc_{d1} \boldsymbol{\pi_{e3}}\sum_{n/2}^{i=1}(T_{i}-T_{i+n/2})(\boldsymbol{\omega} \times\mathbf{d}_{x,y,i}) \tag{12}\]  
where \(\mathbf{v}\) is the quadrotor's velocity. Since the thrust difference is primarily used to adjust the thrust vector when there is a change in the trajectory direction, it is assumed to be significantly smaller compared to the total thrust, which is responsible for hovering and following the trajectory. Equation (12) can then be rewritten as below:  
\[\mathbf{F_{a}}=-(kT+b)c_{d1}\boldsymbol{\pi_{e3}}\mathbf{v} \tag{13}\]  
As shown in Figure 12, to implement rotor drag force in Airsim simulation, PX4 and Airsim program are used. The PX4 program subscribes to thrust, rotation, velocity topics published from Airsim. And we use the information from the topics to calculate the air drag force in our air drag force ROS package following Equation (13).