# A Real-Time Simulator for Navigation in GNSS-Denied Environments of UAV Swarms
## 3 Configuration of Simulator  
### Ultrawideband Model  
A UWB sensor is a range sensor that can measure the distance between each object within the measurement range. Each UAV is equipped with a UWB sensor, so that each UAV can measure the other UAV's position in its frame without accessing a central computational unit. The UWB workflow is as follows.  
Benefiting from the fact that the time of flight (ToF) measurement does not require clock synchronization between two UWB sensors, the UWB sensor can work with high update rates. In the measurement loop, all UAVs are equipped with UWBs with incremental IDs from I to N. All UAVs' UWB modules work in receiver mode, except for the first UAV, which is in sender mode. Then, the first UAV obtains the distance from 2 to N and changes into receiver mode, while the second UAV changes into sender mode and starts its own measurement. In this way, the range measurement can be run on an arbitrary number of UAVs, as shown in Figure 6.  
When the UWB works in line-of-sight (LOS) propagation conditions, the UWB's simplified measurement model can be described as  
\[r_{k}=r_{k}^{0}+n_{k} \tag{20}\]  
where \(r_{k}\) is the measured value, \(r_{k}^{0}\) is the ground truth and \(n_{k}\) is white noise.  
Figure 5: Camera imaging plane.  
Figure 6: Measurement scheme for multiple UWB nodes in an infinite loop.  
However, there are obstacles and other interferers between the emitter and the receiver, which will lead to non-line-of-sight (NLOS) situations. In this work mode, the measurement error will increase. The NLOS error follows an exponential distribution as a random variable, with its probability density function represented by  
\[p(t_{k,N})=\left\{\begin{array}{cc}0&,t_{k,N}<0\\ \frac{1}{\tau_{k,rms}}\exp\Bigl{(}-\frac{t_{k,N}}{\tau_{k,rms}}\Bigr{)}&,t_{k,N }\geq 0\end{array}\right. \tag{21}\]  
where \(\tau_{k,rms}\) represents the root-mean-square delay spread determined based on the channel, following a log-normal distribution. The calculation formula is as follows:  
\[\tau_{k,rms}=T_{k}d_{k}^{2}\xi \tag{22}\]  
In the IEEE 802.15.4a channel model, for the non-line-of-sight (NLOS) environment, the root-mean-square delay spread \(T_{k}\approx 19 ns\), and \(\varepsilon\) is a constant within a certain range \([0.5,1]\). \(\xi\) is a random variable following a Gaussian distribution with a mean of zero. Therefore, the non-line-of-sight distance error model can be expressed as follows:  
\[r_{k}=r_{k}^{0}+n_{k}+W_{k} \tag{23}\]  
where \(W_{k}\) is the error from NLOS, which follows an exponential distribution.  
The received signal strength indicator (RSSI) is an important metric in evaluating signal quality. The signal's path loss is directly proportional to the transmission distance. As the signal propagates further, the path loss increases, resulting in lower signal strength. In practical localization scenarios, the presence of obstacles such as walls introduces multipath interference and non-line-of-sight errors in signal propagation. To account for environmental factors and distance-related energy losses, a propagation energy loss model can be constructed, as shown in Equation (24).  
\[P_{r}(d)=P_{0}+10n_{p}\lg\left(\frac{d}{d_{0}}\right)+S \tag{24}\]  
where \(d_{0}\) represents the distance as a reference, \(d\) represents the actual distance, \(P_{r}(d)\) represents the energy loss at a distance \(d\) from the radiation source, \(P_{0}\) represents the energy loss at the reference distance \(d_{0}\), \(n_{p}\) represents the environment-dependent channel attenuation factor and \(S\) represents the standard deviation of Gaussian white noise signals.