Manuscript Offprint
arXiv:2610.32645Monte Carlo-Based Indoor UAV Localization in Dynamic Environments Using Only Four Onboard Range Sensors
Mohammad Reza Ranjbar Divkoti and A. Pedro Aguiar
Abstract—Indoor UAV localization with minimal onboard sensing remains challenging, particularly in dynamic environments. We propose augmented filtered Monte Carlo localization (AF-MCL) for 2D localization using only four single-point range sensors and measured heading. AF-MCL rejects range measurements inconsistent with the known static map and adaptively injects particles to recover from localization divergence and kidnapping. Beam classification is performed only at the previous position estimate, making its ray-casting cost independent of the particle count. The particle distribution additionally provides an online measure of localization uncertainty. Real-world experiments in a m environment yield mean position errors of 6.4–7.7 cm under static and dynamic conditions. Simulations in m and m environments yield 4.5–5.2 cm mean errors; under dynamic obstacles, standard MCL reaches 12.3 cm and reliable MCL 7.7 cm. The results show that robust indoor localization under dynamic obstacles is achievable with only four single-point range measurements and heading.
I. INTRODUCTION
Unmanned Aerial Vehicles (UAVs) are increasingly deployed for inspection, inventory monitoring, environmental sensing, and search-and-rescue missions. Their operation indoors requires accurate and low-latency localization despite confined geometry, clutter, and the absence of a reliable global positioning signal [1]-[4].
Existing indoor localization solutions typically trade sensing and computational complexity for accuracy. UWB-based methods require external infrastructure and remain sensitive to multipath and non-line-of-sight conditions [5]–[7], while vision- and LiDAR-based approaches provide rich environmental information at higher sensing and computational cost [8]–[12]. Visual-inertial methods reduce dependence on external infrastructure but accumulate drift, motivating fusion with additional sensing modalities [4], [13], [14]. These limitations motivate localization using the sparse, lightweight range sensing available on small UAV platforms.
A closely related approach is [15], which performs onboard Monte Carlo localization on a nano-UAV using a pair of 64-zone time-of-flight (ToF) sensors and a parallel ultra-low-power processor. Although computationally efficient, each

Fig. 1: UAV localization with four directional range sensors in a known static map and unknown dynamic obstacles.
multizone sensor provides substantially more spatial information than a single-point range measurement, and the method is evaluated in static environments. The problem considered here is therefore more sensing-constrained: can reliable indoor localization be achieved from only four single-point range measurements and heading when individual measurements may also be corrupted by unknown moving obstacles?
We address this problem using four single-point range sensors oriented front, back, left, and right. The UAV position is estimated relative to a known initial position in a known static map, using the four range measurements and measured heading . Unknown dynamic obstacles may enter the sensor beams and generate ranges inconsistent with the static map, as illustrated in Fig. 1. No external localization infrastructure is used.
To address this setting, we propose AF-MCL. AF-MCL identifies and rejects range measurements inconsistent with the static map before particle weighting, and adaptively injects particles when filter divergence is detected. Crucially, beam classification is evaluated only at the previous position estimate rather than independently at every particle, eliminating particle-count dependence from the classification ray-casting stage. The particle distribution additionally provides an online measure of localization uncertainty.
The contribution is threefold. First, we demonstrate 2D indoor UAV localization using only four single-point ranges and measured heading under both static and dynamic obstacles. Second, AF-MCL combines dynamic-beam filtering with adaptive particle injection for robustness to corrupted measurements and localization failures, while requiring only one classification ray cast per sensor, independent of the particle count. Third, simulation and real-world experiments evaluate the contributions of filtering and augmentation, recovery from kidnapping, computational scaling, retained-beam geometry, and localization performance. Mean errors of 4.5–5.2 cm are obtained in the simulated m and m environments, while real-world flights in a m environment yield 6.4–7.7 cm mean error.
Authors are with SYSTEC-ARISE Research Center for Systems and Technologies, Faculty of Engineering, University of Porto 4200-465 Porto, Portugal.
This work, conducted under the FCT doctoral scholarship with reference number 2023.01812.BD, was partially supported by R&D Unit SYSTEC-Systems and Technologies Center (UID/00147, DOI 10.54499/UID/00147/2025) and Associate Laboratory ARISE-Advanced Production and Intelligent Systems (DOI 10.54499/LA/P/0112/2020), both funded by Fundação para a Ciência e a Tecnologia (FCT), through the national funds. This work has been submitted to the IEEE for possible publication. Copyright may be transferred without notice, after which this version may no longer be accessible.
A. Monte Carlo Localization for Static Indoor Environments
State representation: Let the UAV’s 2D pose at time step be defined as , where is its global position. The yaw orientation is measured directly by an onboard sensor (e.g., an IMU) and treated as a known measurement rather than an estimated state variable.
The belief over the 2D position at time step is represented by a set of weighted particles . The state hypothesis of the -th particle is given by , where the position components are estimated, while the orientation is not estimated and is set directly to the UAV's current measured yaw. Each particle has a normalized importance weight such that .
Particle Set initialization: Particles are sampled around the known initial position using a 2D Gaussian distribution , where is the initial position covariance. All weights are set uniformly to .
Bayesian formulation: Following the recursive Bayes filter formulation, at time step , the belief distribution is updated as , where is a normalization constant, is the sensor measurement vector at time step , and represents the global occupancy grid map. The control input consists of the UAV's body-frame linear velocities at time step .
Motion update: Each particle’s position is updated by projecting body-frame velocities into the global frame using measured yaw , , , where is the 2D rotation matrix and is Gaussian noise with motion covariance .
Measurement model: Let index the four distance sensors (front, left, back, right) mounted on the UAV, where each sensor has a fixed mounting offset and yields a measured distance at time step . For each sensor , the beam's global endpoint . The measurement likelihood is then evaluated via the map's Euclidean Distance Transform (EDT)
where returns the shortest distance from the endpoint to the nearest obstacle, and is the sensor noise standard deviation.
Weight update: Assuming independent sensor beams, the joint likelihood for particle is the product of individual beam likelihoods . In practice, this is
Algorithm 1 AF-MCL Update at Time Step (Dynamic Indoor Environments)
Input: Map , previous particle set , previous estimate , motion input , measured yaw , range measurements , running likelihood averages , decay rates , injection cap , beam threshold
Output: Updated particle set , estimated position , covariance , uncertainty , updated
Static-beam classification (at previous estimate):
for each sensor do
end for
Motion update:
for each particle do
end for
if then
motion-only update
; unchanged
else
unnormalized
normalize
Divergence detection (unnormalized likelihoods):
Augmented resampling:
,
reset weights
end if
Estimate and uncertainty (final particle set):
,
return , , , , ,
evaluated in log-space as for numerical stability. The weights are subsequently normalized such that .
Resampling and estimation: Resampling is triggered whenever the effective sample size falls below the threshold , where is a predefined hyperparameter. Systematic low-variance sampling is used to draw the new particle set. The estimated 2D position is calculated as the weighted particle mean .
B. Augmented Filtered Monte Carlo Localization (AF-MCL) for Dynamic Indoor Environments
Algorithm 1 extends the MCL algorithm by incorporating dynamic obstacle handling, a recovery mechanism, and an online estimate of localization uncertainty. The following subsections describe these additional stages.
Static-beam classification: To handle unknown dynamic obstacles, an inline beam-filtering mechanism is applied before weight updates. For each sensor , a ray is cast through the map from the previous estimated pose along direction to determine the expected static range . Since the UAV's displacement between consecutive time steps is short (less than half of the UAV's diameter), using in place of per-particle ray casting, which is computationally infeasible under onboard hardware constraints, is an acceptable approximation. The received measurement is evaluated against a sensor mixture model , where and are mixing weights. The component densities are defined as
where is the exponential decay rate parameter modeling unexpected obstacle occurrences, and is a normalization factor. Max-range ( ) and random noise ( ) components are retained with fixed weights so that all four mixing weights sum to 1; they contribute only to the denominator of the classification ratio and thus make the test slightly more conservative. Let be the valid beam set. A sensor beam is valid and retained for particle weighting (added to the ) if its posterior hit probability satisfies
where is a decision threshold. Otherwise, the beam is classified as dynamic and excluded. Evaluating solely at the previous pose estimate keeps the ray-casting overhead at per beam.
Divergence detection: To recover from global localization failures or kidnapping, an augmented recovery mechanism dynamically injects random particles when filter divergence is detected. For each particle, the unnormalized likelihood computed over the valid beams is , and the normalized importance weights are obtained as . Since normalized weights always satisfy , the health of the filter is evaluated from the absolute average measurement likelihood across valid beams , computed before normalization as . Two exponential moving averages of are maintained
where and are decay parameters satisfying , and both averages are initialized with the first computed value of . When the filter performs poorly, drops below , signaling divergence. The probability of injecting random particles, , is dynamically computed as , where caps the maximum proportion of random particles injected per iteration. The averages are updated only when .
Augmented resampling: When filter divergence is detected, recovery particles are sampled from a 2D uniform distribution covering the entire map , where denotes the uniform distribution over the map , ensuring recovery particles are spread across the full extent of the environment, with drawn poses constrained to unoccupied space in the map .
Given injected recovery particles and systematic resampled particles, the updated particle set is constructed as
Online localization uncertainty: Besides the position estimate, AF-MCL outputs an online measure of how reliable that estimate is, computed at every time step from the particle set at negligible additional cost. The particle set approximates the posterior bel( ), so its spread quantifies the remaining positional uncertainty. The estimate and its uncertainty are computed from the final particle set. The particles injected for recovery are therefore included, so the uncertainty increases when recovery particles are injected, which signals that the estimate is less trustworthy. The mean and covariance of particles , are and . The covariance matrix has the form , where and are the variances of the particle positions along the and axes, and is their covariance. It is summarized by the scalar uncertainty , where denotes the matrix trace, i.e., the sum of the diagonal entries. Thus, is the root-mean-square spread of the particles around the estimate. A small indicates a concentrated belief, whereas a large or growing indicates insufficient measurement correction (e.g., many rejected beams) or filter divergence. Since particle filters tend to be overconfident, is interpreted as the uncertainty reported by the filter rather than a guaranteed error bound. describes how uncertain the filter currently is. The pair can be passed to downstream modules (e.g., a controller or planner).
Empty beam set : If all beams are rejected, the geometric-mean likelihood is undefined and the update becomes motion-only. Particles are propagated, weights are reset to , and resampling is skipped. Since no valid measurement likelihood is available, the running likelihood averages remain unchanged and , so no recovery particles are injected. Consequently, persistent beam rejection caused by a large localization error may delay recovery, since the divergence detector receives no valid likelihood update. This case occurred rarely in our experiments. A possible extension is to monitor consecutive empty-beam updates and, after a threshold, temporarily include all in-range beams in weighting and divergence detection to enable recovery.
III. THEORETICAL ANALYSIS
AF-MCL classifies beams only at the previous position estimate, avoiding particle-wise ray casting but potentially reducing the geometric information available after inconsistent beams are rejected. We characterize these effects through computational complexity and the rank and conditioning of the retained measurement geometry. The latter analysis is local and is not a convergence analysis of the particle filter. Let M and N denote the numbers of sensors and particles, the retained beam set, and the cost of one ray cast. The cost of an Euclidean distance transform lookup and single-beam likelihood evaluation are assumed to have bounded cost independent of N.
A. Computational Complexity
AF-MCL classifies each beam once at , rather than independently at every particle.
Proposition 1 (Computational complexity of AF-MCL): One AF-MCL update has complexity
In contrast, particle-wise beam classification requires . Thus, the proposed strategy reduces the ray-casting cost from to .
Proof: Classification performs ray casts and costs . Particle propagation and the remaining particle-wise operations cost , while weighting costs . Combining these terms gives the stated complexity, with . Particle-wise classification instead requires ray casts, yielding the stated cost.
Hence, the additional ray-casting cost introduced by beam classification is independent of N. With M = 4, AF-MCL performs four classification ray casts per update.
B. First-Order Geometry of the Retained Beams
Filtering removes measurements inconsistent with the static map, but also changes the geometric information available for localization. Let . Since is measured, the map-predicted range of sensor can be written locally as . For the retained set, define
Because ray-cast ranges are piecewise smooth, the following analysis applies locally where the map boundary intersected by each retained beam remains unchanged and the corresponding are continuously differentiable.
We call the position first-order geometrically identifiable at if implies .
Proposition 2 (First-order geometric identifiability): The position is first-order geometrically identifiable at if and only if
equivalently, if two retained beams have non-collinear gradients, .
Proof: First-order identifiability is equivalent to null , which, for a two-dimensional position, holds if and only if . Since the rows of are the transposed range gradients, this is equivalent to at least two non-collinear retained gradients.
Thus, the number of retained beams alone does not determine the available geometric information. For example, retaining only the front and back beams can yield anti-parallel gradients and rank , leaving one position direction unresolved to first order. In particular, cannot provide rank two, while may still be rank deficient if the retained gradients are collinear.
C. Conditioning and Local Measurement Sensitivity
Full rank establishes first-order identifiability but not its conditioning. The smallest singular value quantifies the weakest geometric constraint, with values approaching zero indicating increasing sensitivity to measurement perturbations.
Consider , where includes range noise, map error, and residual measurement inconsistency. For a local position , define and .
Proposition 3 (Local sensitivity of the retained measurements): Under the assumptions of Proposition 2, if , then, as ,
For an exact local fit (r = 0), the numerator of the leading term reduces to .
Proof: A Taylor expansion about gives
and therefore
Since has full column rank, . Left-multiplication by and the triangle inequality yield (1).
Proposition 3 shows that larger corresponds to stronger geometric constraints, whereas values approaching zero imply greater sensitivity to measurement perturbations; at zero, the retained geometry is rank deficient. This characterizes the instantaneous retained measurement geometry, not the AF-MCL estimation error, which also depends on prior and motion information.
IV. RESULTS AND DISCUSSION
The MCL, A-MCL (augmentation only), F-MCL (beam filtering only), R-MCL (Reliable MCL [8]), and the full AF-MCL algorithms are evaluated in simulation, and AF-MCL is further validated in real-world experiments. The UAV follows its nonlinear dynamics under low-level PID control, with constant altitude, forward velocity, zero lateral velocity, and angular velocity references.
TABLE I: Simulation parameters.
| N | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 100 | 0.1 | 0.1 | 0.7 | 0.2 | 0.5 | 4.0 | 0.03 | 0.15 | 0.001 | 0.9 | 0.4 | 0.3 |

Fig. 2: Webots simulation environment showing the Crazyflie UAV, static walls, and the dynamic obstacles used to test localization robustness.
A. Simulation Setup
Simulations were run using a Crazyflie 2.1 model in Webots 2024a on Ubuntu 24.04 LTS (Intel Core i7, 16 GB RAM). The UAV flew at a constant altitude of 0.3 m with linear and angular velocities of 0.3 m/s and 0.4 rad/s, respectively. The filter was updated at 10 Hz ( s) on an occupancy grid with 2 cm resolution, and the EDT was truncated at the sensor range limit m. The four range sensors were mounted at the UAV center with offsets , , , rad (front, left, back, right), and the heading was taken noise-free from the simulator. Range measurements were corrupted with additive Gaussian noise with a standard deviation of 2 cm to emulate realistic sensor uncertainty; missing, non-finite, non-positive, or out-of-range ( ) readings were discarded before weighting. Particles were initialized from around the known start position with uniform weights. The simulation environment is shown in Fig. 2; parameters, determined empirically by manual tuning, are listed in Table I. and are isotropic and specified by their standard deviations (in m and m/ , respectively). The slow and fast decay rates satisfy , is set above the sensor noise to tolerate map discretization and pose error, and caps the injection so that most particles are always importance-resampled.
B. Ablation and Comparative Study
To evaluate each component's contribution, standard MCL, A-MCL (augmentation only), F-MCL (filtering only), the proposed AF-MCL, and R-MCL (Reliable MCL [8]) were evaluated using a 4-range LiDAR setup across square and S-shaped trajectories in and environments with dynamic obstacles (Fig. 3, Table II).
Beam filtering drives accuracy under dynamic obstacles: F-MCL and AF-MCL achieve the lowest errors in both map sizes. Augmentation adds no measurable accuracy in this regime (AF-MCL and F-MCL differ by m). Standalone augmentation (A-MCL) is harmful: readings from dynamic obstacles lower the likelihoods and trigger false divergence recovery, which scatters the particles. Filtering removes these readings, so injection is triggered mainly by genuine divergence. Augmentation therefore serves as a recovery mechanism for kidnapping or genuine filter failure, not as a source of accuracy during normal operation. The online uncertainty is a reliable indicator only when beams are filtered. For F-MCL, AF-MCL, and R-MCL (except the m S-shape case), is of the same magnitude as the mean error, so it provides a usable estimate of the localization uncertainty without ground truth. For standard MCL, stays at about 0.04–0.05 m while the error reaches 0.12 m (about underestimated), so the particle cloud is overconfident when dynamic obstacles corrupt the likelihood. For A-MCL, false injections inflate to 0.5–1.3 m in three of four cases, which flags the unreliable estimate, but in the m S-shape case stays low despite a large error. While R-MCL is more accurate than MCL and faster than AF-MCL, it requires extensive offline map preprocessing and memory-intensive lookup tables, making AF-MCL more suitable for onboard execution on resource-constrained micro-UAVs.

(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
Fig. 3: Ablation results under dynamic obstacles: (a–d) estimated vs. ground-truth paths for square and S-shaped trajectories in m (a, b) and m (c, d) environments; (e–h) corresponding position errors over time.
TABLE II: Position Error and Runtime Performance across Environments, Trajectories, and Methods
| Env. [m] | Traj. | Method | Mean Pos. Error [m] | Mean Runtime [ms] | Mean σ [m] |
|---|---|---|---|---|---|
| 6 × 6 | S-shape | MCL | 0.075 ± 0.041 | 0.68 ± 0.67 | 0.048 |
| A-MCL | 0.220 ± 0.187 | 1.60 ± 1.05 | 0.565 | ||
| F-MCL | 0.048 ± 0.032 | 2.73 ± 1.35 | 0.049 | ||
| R-MCL | 0.052 ± 0.018 | 2.10 ± 1.15 | 0.049 | ||
| AF-MCL | 0.047 ± 0.026 | 3.15 ± 1.26 | 0.051 | ||
| Square | MCL | 0.063 ± 0.034 | 1.04 ± 0.41 | 0.049 | |
| A-MCL | 0.356 ± 0.617 | 1.74 ± 0.70 | 0.541 | ||
| F-MCL | 0.043 ± 0.019 | 3.12 ± 0.92 | 0.048 | ||
| R-MCL | 0.052 ± 0.021 | 2.29 ± 1.01 | 0.050 | ||
| AF-MCL | 0.048 ± 0.023 | 3.48 ± 0.88 | 0.047 | ||
| 10×10 | S-shape | MCL | 0.116 ± 0.066 | 0.94 ± 1.41 | 0.038 |
| A-MCL | 0.127 ± 0.057 | 1.29 ± 2.61 | 0.038 | ||
| F-MCL | 0.046 ± 0.021 | 4.51 ± 2.80 | 0.049 | ||
| R-MCL | 0.077 ± 0.056 | 1.90 ± 1.97 | 0.149 | ||
| AF-MCL | 0.045 ± 0.018 | 5.03 ± 2.57 | 0.053 | ||
| Square | MCL | 0.123 ± 0.071 | 1.20 ± 1.76 | 0.039 | |
| A-MCL | 0.733 ± 1.048 | 1.83 ± 1.71 | 1.314 | ||
| F-MCL | 0.053 ± 0.019 | 4.81 ± 0.95 | 0.049 | ||
| R-MCL | 0.060 ± 0.033 | 2.41 ± 1.66 | 0.060 | ||
| AF-MCL | 0.052 ± 0.019 | 4.86 ± 1.71 | 0.050 |
readings, so injection is triggered mainly by genuine divergence. Augmentation therefore serves as a recovery mechanism for kidnapping or genuine filter failure, not as a source of accuracy during normal operation. The online uncertainty is a reliable indicator only when beams are filtered. For F-MCL, AF-MCL, and R-MCL (except the m S-shape case), is of the same magnitude as the mean error, so it provides a usable estimate of the localization uncertainty without ground truth. For standard MCL, stays at about 0.04–0.05 m while the error reaches 0.12 m (about underestimated), so the particle cloud is overconfident when dynamic obstacles corrupt the likelihood. For A-MCL, false injections inflate to 0.5–1.3 m in three of four cases, which flags the unreliable estimate, but in the m S-shape case stays low despite a large error. While R-MCL is more accurate than MCL and faster than AF-MCL, it requires extensive offline map preprocessing and memory-intensive lookup tables, making AF-MCL more suitable for onboard execution on resource-constrained micro-UAVs.

(a)

(b)

(c)
(d)
Fig. 4: Kidnapping scenario: (a) Trajectories and kidnapping window. (b) Position error over time. (c) particle injection. (d) and triggering recovery.
C. Kidnapping Recovery
A kidnapping scenario tests how quickly each filter recovers from a sudden, unmodeled displacement. A simulated office environment with two rooms and walls of varying widths is shown in Fig. 4. The UAV starts in one room; after 2 s, it is instantaneously "kidnapped" to a different location while the filter's belief still reflects the original position. The kidnapping lasts from 2 s to 12 s, once it ends, each algorithm must re-localize. Recovery time is defined as the time needed to reconverge to a low-error estimate after the kidnapping begins.
As shown in Fig. 4a, AF-MCL recovers in 2.9 s, compared to 16.9 s for MCL (nearly a 6x improvement). Fig. 4b shows the corresponding error over time: the mean estimation error during the trajectory is 0.191 m for AF-MCL versus 0.701 m for MCL. This gap is attributable to AF-MCL's augmentation strategy (injecting random particles when a divergence is detected), which lets it recover from sudden relocalization far faster than standard MCL.
Figs. 4c and 4d show the internal signals that drive this augmentation. During the recovery times, rises above 0, meaning the filter starts injecting random particles into the belief instead of relying only on resampled ones. This is triggered by the drop in below over the same times: a sudden fall in short-term average weight relative to the long-term average signals that the current particle set no longer explains the incoming measurements, i.e., the filter has lost track of the true state. Together, these two signals confirm that the augmentation strategy activates exactly when needed and is the mechanism responsible for AF-MCL's fast recovery.
D. Runtime vs. Number of Particles
To examine the complexity analysis of Proposition 1, we instrumented the AF-MCL update by stage and measured runtime, position error, and for along an S-shaped trajectory in a environment with two dynamic obstacles (Table III).
The measurements are consistent with Proposition 1. A increase in raises the total update time by only about . The classification time, of which ray casting accounts for about , stays within 1.8–2.1 ms for all , as expected from its -independent cost . The particle-dependent stages grow with : resampling increases about , weighting TABLE III: Runtime and position error vs. N. Mean stage times in ms: Cls = beam classification (incl. ray casting), Prp = propagation, Wgt = weighting, Rsm = resampling, Tot = total update time (mean ± std, ms); Err = position error (m); = online uncertainty (m).
| N | Cls | Prp | Wgt | Rsm | Tot | Err |
|---|---|---|---|---|---|---|
| 25 | 1.79 | 0.08 | 0.78 | 0.18 | ||
| 50 | 2.04 | 0.09 | 0.92 | 0.29 | ||
| 100 | 1.95 | 0.09 | 0.90 | 0.46 | ||
| 200 | 2.09 | 0.11 | 1.07 | 0.83 | ||
| 400 | 2.02 | 0.13 | 1.08 | 1.51 |

Fig. 5: (blue) and position error (red) along the S-shaped trajectory with dynamic obstacles. Drops in from beam rejection coincide with elevated localization error.
about , and propagation remains negligible. Classification is the largest single cost for every , but its share of the total falls from about at to at , where resampling becomes comparable. Hence, dynamic-beam handling does not add per-particle ray casting, in contrast to a particle-wise scheme with cost .
Position error shows no meaningful dependence on in this range, since the differences are well within one standard deviation, so already gives sufficient accuracy at lower cost in this setup.
E. Validation of the Geometric Analysis
To illustrate Propositions 2 and 3, we evaluate along an S-shaped trajectory in the arena. Four dynamic obstacles are placed so that beam rejection periodically leaves only the front and back sensors. Their range gradients are anti-parallel, and therefore Proposition 2 predicts and whenever only this pair is retained. Thus, filtering corrupted measurements can simultaneously reduce the geometric information available for localization.
Fig. 5 shows and the position error over time. The predicted degeneracy occurs around s, 7.6–8.5 s, and 18.2–18.5 s, where reaches zero. The largest error increase, reaching approximately 0.19 m, coincides with the 7.6–8.5 s interval, consistent with the weaker geometric constraints identified by Proposition 3. However, not every loss of instantaneous rank produces a large error, since AF-MCL also carries information from the prior belief and motion model. The experiment therefore illustrates the conditioning of the retained measurements rather than a direct relation between and the AF-MCL estimation error.
F. Real-World Experimental Results
The proposed method was validated using a Crazyflie 2.1 equipped with a Flow Deck v2 and a Multi-ranger Deck,

(a)
(b)
(c)
Fig. 6: (a) Crazyflie 2.1 with Flow Deck v2 and Multi-ranger Deck. (b) Crazyradio PA used for host-PC communication. (c) Eight Qualisys cameras supplied ground-truth position.
TABLE IV: AF-MCL localization performance
| Traj. | Scenario | Mean Pos. Error [m] | Mean Runtime[ms] | Mean σ [m] |
|---|---|---|---|---|
| S-shape | No Obstacle | 0.067 ± 0.012 | 1.43 ± 0.24 | 0.058 |
| Static Obstacles | 0.070 ± 0.009 | 1.21 ± 0.02 | 0.061 | |
| Static&Dynamic Obstacles | 0.064 ± 0.004 | 1.21 ± 0.01 | 0.068 | |
| Square | No Obstacle | 0.068 ± 0.009 | 1.26 ± 0.03 | 0.050 |
| Static Obstacles | 0.073 ± 0.006 | 1.21 ± 0.06 | 0.051 | |
| Static&Dynamic Obstacles | 0.077 ± 0.004 | 1.13 ± 0.02 | 0.053 |
which together provide four-directional range measurements (Fig. 6a). A Crazyradio PA (Fig. 6b) handled communication with the host PC, and eight Qualisys cameras supplied ground-truth position (Fig. 6c). The host PC runs Ubuntu 22.04.5 LTS on an Intel Core i7 CPU with 16 GB RAM. Velocity commands are transmitted every 100 ms; the official Crazyflie firmware converts these commands into motor outputs via PID control on the onboard STM32F405 microcontroller. The proposed localization method runs externally on the host PC; onboard execution on the Crazyflie was not evaluated. Prior to the real-world trials, the setup was first validated in Gazebo Garden using CrazySim [16].
Six scenarios were evaluated in a environment: S-shaped and square trajectories, each flown with no obstacles, with static obstacles only, and with combined static and dynamic obstacles. The four obstacle-containing configurations are shown in Fig. 7. Table IV reports the mean position error and mean runtime for all six scenarios.
Table IV shows that AF-MCL keeps the mean position error within a narrow range across all six scenarios, so its accuracy is largely insensitive to trajectory shape and obstacle configuration. For the S-shape trajectory the error is essentially flat across obstacle configurations, and for the square trajectory it grows slightly as obstacles are added, with a total increase under 1 cm. The online uncertainty has the same magnitude as the error, but it is lower than the error in five of the six scenarios, most clearly for the square trajectory. This is expected, since reflects only the spread of the particle set and does not include the map and ground-truth errors discussed below. The mean runtime stays well within the 100 ms command interval on the host computer, supporting real-time operation and motivating future onboard implementation. The runtime was measured on the host PC, so it does not demonstrate execution on the Crazyflie flight controller.
Figs. 8a–d compare the AF-MCL estimate with ground truth for the four obstacle-containing scenarios (S-shape and square, with static obstacles and with static and dynamic obstacles, respectively). In all cases the estimated path follows the ground truth without visible divergence or drift, even near obstacles. Figs. 8e–h show that the position error stays low and stable over time rather than growing, so AF-MCL does not accumulate drift. The square trajectory with dynamic obstacles (h) shows the highest error, consistent with Table IV.
The reported errors are also affected by two sources of measurement uncertainty outside the localization algorithm, each with an estimated engineering bound of approximately cm (not a measured RMS error or standard deviation, and not combined here). First, the occupancy grid map was built manually from measurements of the environment size and obstacle positions, which introduces map errors. The range sensors are also sensitive to surface color, and darker walls or obstacles produce noisier readings. Second, the Qualisys ground truth can degrade when the UAV is hidden behind obstacles. Because the surrounding walls are tall, fewer cameras see the markers at these positions, which reduces tracking accuracy. These errors contribute directly to the reported position error, so Table IV should be read as an accuracy estimate within these bounds.
To test the simulation findings on physical data, the logged real-world measurements (ranges, velocities, yaw, and ground truth) were replayed offline through MCL, A-MCL, F-MCL, and AF-MCL with identical parameters and map, using 5 random seeds per flight. The replay is open-loop, since the logged ranges come from flights run with AF-MCL. For the square trajectory with static and dynamic obstacles, standard MCL degrades to 0.096 m mean error, while beam filtering reduces it by about 23% (F-MCL and AF-MCL, 0.074 m). A-MCL is the worst (0.186 m), because corrupted likelihoods trigger false particle injection. Standard MCL's stays at 0.047 m despite its larger error, so it is overconfident, whereas A-MCL's inflates (0.169 m) with its error. For F-MCL and AF-MCL, (0.048 and 0.050 m) stays at the scale of the error. This agrees with the simulation ablation: filtering, not augmentation, is what protects accuracy under dynamic obstacles.
V. CONCLUSION
We presented AF-MCL for indoor UAV localization using only four single-point range sensors and measured heading. AF-MCL combines dynamic-beam filtering with adaptive particle injection for recovery from localization failures, while performing beam classification independently of the particle count. The particle distribution additionally provides an online measure of localization uncertainty. Real-world experiments achieved mean errors of 6.4–7.7 cm, while simulations in m and m environments achieved 4.5–5.2 cm, outperforming standard MCL under dynamic obstacles. The geometric analysis showed that beam rejection can leave the retained measurements poorly conditioned or rank deficient, increasing their sensitivity to measurement perturbations. Future work will exploit this information for geometry-aware filtering and uncertainty adaptation, and extend the approach to localization without a prior map.
https://github.com/bitcraze/crazyflie-firmware

(a)
(b)
(c)
(d)
Fig. 7: Real-world test environments: (a) S-shape trajectory with static obstacles, (b) S-shape trajectory with static and dynamic obstacles, (c) square trajectory with static obstacles, and (d) square trajectory with static and dynamic obstacles.

(a)
(b)
(c)
(d)

(e)
(f)
(g)
(h)
Fig. 8: Real-world scenario results. (a)–(d) AF-MCL position estimate versus ground truth for: (a) S-shape trajectory with static obstacles; (b) S-shape trajectory with static and dynamic obstacles; (c) square trajectory with static obstacles; (d) square trajectory with static and dynamic obstacles. (e)–(h) Corresponding position error over time for (a)–(d), with mean errors of 0.061 m, 0.059 m, 0.065 m, and 0.076 m, respectively.
REFERENCES
[1] A. Heidari, N. Jafari Navimipour, M. Unal, and G. Zhang, “Machine learning applications in internet-of-drones: Systematic review, recent deployments, and open issues,” ACM Computing Surveys, vol. 55, no. 12, pp. 1–45, 2023.
[2] A. D. Boursianis, M. S. Papadopoulou, P. Diamantoulakis, A. Liopa-Tsakalidi, P. Barouchas, G. Salahas, G. Karagiannidis, S. Wan, and S. K. Goudos, “Internet of things (iot) and agricultural unmanned aerial vehicles (uavs) in smart farming: A comprehensive review,” Internet of Things, vol. 18, p. 100187, 2022.
[3] A. F. G. G. Ferreira, D. M. A. Fernandes, A. P. Catarino, and J. L. Monteiro, “Localization and positioning systems for emergency responders: A survey,” IEEE Communications Surveys & Tutorials, vol. 19, no. 4, pp. 2836–2870, 2017.
[4] Y. Wu, J. Xu, D. Li, Y. Xie, H. Cao, F. Li, and Z. Yang, “Flytracker: Motion tracking and obstacle detection for drones using event cameras,” in IEEE INFOCOM 2023-IEEE Conference on Computer Communications, pp. 1–10, IEEE, 2023.
[5] W. Zhao, A. Goudar, and A. P. Schoellig, “Finding the right place: Sensor placement for uwb time difference of arrival localization in cluttered indoor environments,” IEEE Robotics and Automation Letters, vol. 7, no. 3, pp. 6075–6082, 2022.
[6] H. A. Hashim, A. E. Eltoukhy, and K. G. Vamvoudakis, “Uwb ranging and imu data fusion: Overview and nonlinear stochastic filter for inertial navigation,” IEEE Transactions on Intelligent Transportation Systems, vol. 25, no. 1, pp. 359–369, 2023.
[7] T. H. Nguyen, T.-M. Nguyen, and L. Xie, “Range-focused fusion of camera-imu-uwb for accurate and drift-reduced localization,” IEEE Robotics and Automation Letters, vol. 6, no. 2, pp. 1678–1685, 2021.
[8] N. Akai, “Reliable monte carlo localization for mobile robots,” Journal of Field Robotics, vol. 40, no. 3, pp. 595–613, 2023.
[9] Y. He and X. Zhang, “Vision-aided self-calibration of a wireless prop-
agation model for crowdsourcing-based indoor localization," Measurement, vol. 205, p. 112183, 2022.
[10] W. Lu, Y. Zhou, G. Wan, S. Hou, and S. Song, “L3-net: Towards learning based lidar localization for autonomous driving,” in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6389–6398, 2019.
[11] N. Zimmerman, L. Wiesmann, T. Guadagnino, T. Läbe, J. Behley, and C. Stachniss, “Robust onboard localization in changing environments exploiting text spotting,” in 2022 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 917–924, IEEE, 2022.
[12] T.-M. Nguyen, Y. Yang, T.-D. Nguyen, S. Yuan, and L. Xie, “Uloc: Learning to localize in complex large-scale environments with ultrawideband ranges,” in 2025 IEEE International Conference on Robotics and Automation (ICRA), pp. 5766–5772, IEEE, 2025.
[13] H. Chen, L. Zhang, D. Li, J. Xu, W. Yang, and Z. Yang, “Refloc: A resilient evolutionary fusion framework for robust indoor localization,” IEEE Transactions on Instrumentation and Measurement, vol. 73, pp. 1–13, 2024.
[14] F. Jiang, D. Caruso, A. Dhekne, Q. Qu, J. J. Engel, and J. Dong, “Robust indoor localization with ranging-imu fusion,” in 2024 IEEE International Conference on Robotics and Automation (ICRA), pp. 11963–11969, IEEE, 2024.
[15] H. Müller, N. Zimmerman, T. Polonelli, M. Magno, J. Behley, C. Stachniss, and L. Benini, “Fully on-board low-power localization with multi-zone time-of-flight sensors on nano-uavs,” in 2023 Design, Automation & Test in Europe Conference & Exhibition (DATE), pp. 1–6, IEEE, 2023.
[16] C. Llanes, Z. Kakish, K. Williams, and S. Coogan, “Crazysim: A software-in-the-loop simulator for the crazyflie nano quadrotor,” in 2024 IEEE International Conference on Robotics and Automation (ICRA), pp. 12248–12254, 2024.