Manuscript Offprint
arXiv:2610.39708AFast Robot Localization Method Based on Monte Carlo Sampling
Abstract
Abstract: Localization is an essential capability of intelligent robots. However, in real-world constrained environments, robots often cannot rely on external localization systems. Therefore, this paper proposes an online particle-filter localization method based on Monte Carlo sampling. The method is applied to the localization of a mobile robot in a maze environment and requires only four range sensors mounted on the front, rear, left, and right sides of the vehicle, without the need for any heading information. Simulation experiments demonstrate that even in a maze where local regions are highly similar, the vehicle can still achieve relatively accurate localization, thereby providing a fast and effective approach for robot localization in complex environments.
Keywords: robot, particle filter, Monte Carlo, localization
1 Introduction
Robots are the carriers of artificial intelligence and should possess three essential elements: perception, motion, and cognition [1, 2]. Nevertheless, current robots generally do not yet exhibit genuine intelligence and instead provide only basic programming and operational functions. Despite this limitation, their advantages in replacing humans for high-risk work have become increasingly evident [3, 4]. In regions where the Global Positioning System (GPS) is denied, such as disaster zones and caves, performing fast localization and navigation using on-board sensors is an important problem for improving robot intelligence [5, 6]. Closely related is the path-planning task, for which metaheuristic optimizers such as heuristic hybrid particle swarm optimization have been developed to compute feasible quadcopter trajectories efficiently in complex environments [7]; however, reliable path execution still presupposes accurate self-localization.
At present, common localization systems can be divided into external localization, such as GPS and motion capture, and on-board localization, such as visual navigation and radar navigation [8,9]. Owing to the high computational cost and power consumption of visual navigation [10,11], it is not well suited for robot exploration in unknown environments. In radar navigation, filtering techniques are generally adopted to achieve localization, such as the Kalman filter, the bootstrap filter, the filter, and the particle filter [12–15]. Each filtering technique has its own advantages and disadvantages. The Kalman filter is well suited for handling Gaussian distributions [12, 16]; the particle filter is chosen for large-scale environments [17], because compared with the Kalman filter that has a complexity of , its computational complexity is logarithmic; the filter is used to improve the convergence of Simultaneous Localization and Mapping (SLAM) systems [18].
To achieve fast localization in unknown and complex environments, this paper selects the particle filter because it imposes relatively minimal requirements on the system (it requires neither that the system model equations be linear nor that the system noise be Gaussian) [19], and thus offers better algorithmic scalability and generality. In this work, the robot is placed in a complex maze, and its position and heading are inferred by the particle filter. Four sensors are mounted on the front, rear, left, and right sides of the robot, and these sensors are used to measure the perpendicular distance between the robot and the nearest wall. By comparing the observation data with the sampled data, the distribution of the pose estimate is revised, followed by state transition and resampling. Experiments show that an accurate localization of the robot can be obtained after several rounds of resampling.
Recently, the integration of large language models with multi-agent systems and reinforcement learning has opened new directions for autonomous agents and swarm intelligence [20,21]. For example, language-model-based agents have been used to automate the configuration and training of multi-agent reinforcement learning pipelines for drone swarms [22]. These advances complement classical probabilistic localization by enriching high-level reasoning and coordination, while methods such as the one proposed here remain crucial for the low-level state estimation upon which higher-level autonomy depends.
The remainder of this paper is organized as follows. Section 2 introduces the theoretical foundation and operating mechanism of the particle filter; Section 3 evaluates the proposed algorithm in a simulation environment; and Section 4 draws the conclusion.
2.1 Bayesian Filtering
The essence of the localization problem is recursive state estimation, i.e., recursively estimating the states
October, 2021
from the sequential observations at discrete time , where the observation is a function of the state , and the evolution of the state over time is generally described as a discrete or continuous Markov process [28, 29]:
where is the discrete time and is the process noise.
The system observation equation is:
where is the observation value and is the observation noise.
The state equation and the observation equation together constitute the state-space model that describes the entire localization problem. In this model, the filter can obtain the filtering distribution , whose solution can be described as a recursive naive Bayesian filter based on the law of total probability, consisting of two parts: prediction (3) and update (4) [30].
(3)
where the state-transition probability distribution and the observation-likelihood function distribution are obtained from the state equation (1) and the observation equation (2), respectively. Then, given the posterior filtering distribution at time , the posterior probability distribution at time can be obtained as:
In engineering practice, Eqs. (4)–(5) have analytical solutions only under Gaussian distributions. For the robot localization problem, which belongs to nonlinear systems, an approximate computation is required [31, 32]. The particle filter used in this paper is a non-parametric approximation that represents the probability distribution with weighted discrete particles, also known as sequential Monte Carlo. It requires neither linearity of the state and observation equations nor that the noise be Gaussian or even independent [33, 34].
2.2 Monte Carlo Particle Filter
For an arbitrary probability distribution , a Monte Carlo approximation can be performed using discrete particles:
where denotes the state of a particle, is the particle weight, is the total number of particles, and is the Dirac delta function [35].
We perform sampling and resampling on this approximation, namely:
Step 1: Sampling. Based on the Bayesian posterior estimate at and the state-transition equation, the particle states are updated to obtain the prior distribution . Generally, a certain distribution function must be designed as the sampling (proposal) function, which is then optimized through Step 2 to approximate the posterior probability distribution [29].
Step 2: Update. Based on the latest observation information , the particle weights are updated through the likelihood function, as shown in Eq. (8).
After all weights are updated, normalization is required:
Step 3: Resampling. Based on the principle of identical distribution, the particle set after weight updating is resampled to obtain a new particle set in which most particles have comparable (or even equal) weights, thereby overcoming the particle weight degeneracy problem [36, 37].
3 Algorithm Test Results
3.1 Test Environment
In this paper, the robot is placed in a maze, as shown in Fig. 1. Because the small turtle has strong demonstrative significance in the ROS (Robot Operating System) environment [38], we choose the green turtle model to represent the robot. The robot can perceive the surrounding environment through four distance sensors mounted on the front, rear, left, and right sides. However, owing to its limited perception capability, it can only sense obstacles within a range of 5 meters, while the entire environment is 25 meters in both length and width. The goal of the algorithm is to quickly determine the robot's location on the map within a short time. In addition, the robot is equipped with an odometer that can measure the current local velocity and acceleration, and the red dots represent the sampled particles. Simulation platforms that mirror real-world dynamics, such as visual-reality many-agent environments for large-scale aerial systems [39], share a similar motivation of bridging simulated and physical deployment, although our focus here is on single-robot probabilistic localization.
3.2 Algorithm Setup
As shown in Algorithm 1, the Monte Carlo Particle Filter (MCPF) proposed in this paper mainly consists of five steps:
-
Randomly sample N particles. In this paper, a uniform distribution is selected as the initial distribution, and each sampled particle contains both position and heading information.
-
Read the particle’s position on the map and the sensor measurement data, and update the particle weights according to the measurement equation.
-
Normalize all computed weights.
-
Resample the particles according to the normalized weights and update the particle distribution.
October, 2021

Figure 1: Scene map.
Algorithm 1 Monte Carlo Particle Filter
Require: Map data, robot sensor readings Ensure: Current robot localization 1: Initialize all particles and their weights: 2: ; ; ; 3: while not at end of the task do 4: 5: 6: Normalization( ) 7: , 8: for to do 9: draw from with probability 10: 11: end for 12: ; 13: end while
- Predict the state distribution of all particles based on the robot’s previous state according to the state equation.
3.3 Test Results and Analysis
We implemented Algorithm 1 in Python and tested it in the environment described in Section 3.1; the test results are shown in Fig. 2. Initially, we scattered 3000 particles over the entire map using a uniform distribution, and the arrow of each particle indicates its heading. After a simple weighted summation over all particles, we marked the current predicted position of the particle filter, as shown by the yellow turtle. Because of the uniform distribution, the predicted result is roughly located at the center of the map.
Subsequently, we compute the observation equation for all sampled particles, update the weight of each particle, and after normalization form a new probability distribution, based on which we perform resampling. We then let the turtle move one step, and all sampled particles change their current pose according to the state equation; the result after movement is shown in Fig. 2(a). After the first iteration, although the sampling results are still scattered across various corners of the map, the predicted result is closer to the ground truth. We repeat the above steps: after the second iteration, the particles are no longer disordered but gradually converge to a few points, as shown in Fig. 2(b); after the third iteration, the predicted result is already very close to the ground truth, but a portion of the particles has not yet converged, as shown in Fig. 2(c); after the fourth iteration, the particles converge, and the predicted result is essentially consistent with the ground truth, as shown in Fig. 2(d).

(a)

(b)

(c)

(d)
Figure 2: Test results.
4 Conclusion
As an important nonlinear Bayesian filtering method and statistical signal-processing tool, the particle filter is guided by probability and statistics theory, imposes loose requirements on the system model, and is particularly suitable for strongly nonlinear and non-Gaussian systems [15, 40]. By combining Bayesian estimation and the Monte Carlo method, this paper successfully uses a particle filter to perform fast and accurate localization of a robot in a maze based on simple sensor readings. The test results show that the algorithm converges quickly and localizes accurately, and can be applied to real-world environments. Future work may explore the combination of such probabilistic estimators with learning-based and language-model-driven multi-agent frameworks, for instance task-activated knowledge-extension reasoning systems that let large language models plan and refine swarm behaviors [41, 42], in order to enable scalable autonomy in large-scale unmanned systems.
October, 2021
References
[1] S. J. Russell and P. Norvig, Artificial Intelligence: A Modern Approach. Prentice Hall, 2010.
[2] B. Siciliano and O. Khatib, Springer Handbook of Robotics. Springer, 2016.
[3] R. R. Murphy, Disaster Robotics. MIT Press, 2014.
[4] S. Thrun, W. Burgard, and D. Fox, Probabilistic Robotics. MIT Press, 2005.
[5] C. Cadena, L. Carlone, H. Carrillo, Y. Latif, D. Scaramuzza, J. Neira, I. Reid, and J. J. Leonard, “Past, present, and future of simultaneous localization and mapping: Toward the robust-perception age,” IEEE Transactions on Robotics, vol. 32, no. 6, pp. 1309–1332, 2016.
[6] S. Kohlbrecher, O. V. Stryk, J. Meyer, and U. Klingauf, "A flexible and scalable slam system with full 3d motion estimation," in IEEE International Symposium on Safety, Security, and Rescue Robotics (SSRR), 2011, pp. 155–160.
[7] J. Lou, R. Ding, and W. Wu, “Hhpso: A heuristic hybrid particle swarm optimization path planner for quadcopters,” Drones, vol. 8, no. 6, p. 221, 2024.
[8] H. Durrant-Whyte and T. Bailey, “Simultaneous localization and mapping: Part i,” IEEE Robotics & Automation Magazine, vol. 13, no. 2, pp. 99–110, 2006.
[9] J. Fuentes-Pacheco, J. Ruiz-Ascencio, and J. M. Rendón-Mancha, “Visual simultaneous localization and mapping: A survey,” Artificial Intelligence Review, vol. 43, no. 1, pp. 55–81, 2015.
[10] R. Mur-Artal, J. M. M. Montiel, and J. D. Tardós, "Orb-slam: A versatile and accurate monocular slam system," IEEE Transactions on Robotics, vol. 31, no. 5, pp. 1147–1163, 2015.
[11] J. Engel, T. Schöps, and D. Cremers, “Lsd-slam: Large-scale direct monocular slam,” in European Conference on Computer Vision (ECCV), 2014, pp. 834–849.
[12] R. E. Kalman, “A new approach to linear filtering and prediction problems,” Journal of Basic Engineering, vol. 82, no. 1, pp. 35–45, 1960.
[13] N. J. Gordon, D. J. Salmond, and A. F. M. Smith, "Novel approach to nonlinear/non-gaussian bayesian state estimation," in IEE Proceedings F (Radar and Signal Processing), vol. 140, no. 2, 1993, pp. 107–113.
[14] D. Simon, Optimal State Estimation: Kalman, , and Nonlinear Approaches. John Wiley & Sons, 2006.
[15] M. S. Arulampalam, S. Maskell, N. Gordon, and T. Clapp, “A tutorial on particle filters for online nonlinear/non-gaussian bayesian tracking,” IEEE Transactions on Signal Processing, vol. 50, no. 2, pp. 174–188, 2002.
[16] G. Welch and G. Bishop, “An introduction to the kalman filter,” University of North Carolina at Chapel Hill, Technical Report TR 95-041, 1995.
[17] M. Montemerlo, S. Thrun, D. Koller, and B. Wegbreit, "Fastslam: A factored solution to the simultaneous localization and mapping problem," in Proceedings of the AAAI National Conference on Artificial Intelligence, 2002, pp. 593–598.
[18] C. K. Ahn, “Robust h∞filtering for slam systems,” IEEE Transactions on Signal Processing, vol. 60, no. 7, pp. 3904–3909, 2012.
[19] A. Doucet and A. M. Johansen, “A tutorial on particle filtering and smoothing: Fifteen years later,” Handbook of Nonlinear Filtering, vol. 12, no. 656–704, p. 3, 2009.
[20] L. Wang, C. Ma, X. Feng, Z. Zhang, H. Yang, J. Zhang, and Z. Chen, “A survey on large language model based autonomous agents,” Frontiers of Computer Science, vol. 18, no. 6, p. 186345, 2024.
[21] W. X. Zhao, K. Zhou, J. Li, T. Tang, X. Wang, and Y. Hou, “A survey of large language models,” arXiv preprint arXiv:2303.18223, 2023.
[22] J. Lou, W. Wu, S. Liao, and R. Shi, “Agents trainer: Automatically training multi-agent reinforcement learning models for drone swarm using language model-based agents,” IEEE Robotics and Automation Letters, 2024.
[23] A. Doucet, N. D. Freitas, and N. Gordon, Sequential Monte Carlo Methods in Practice. Springer, 2001.
[24] J. S. Liu and R. Chen, “Sequential monte carlo methods for dynamic systems,” Journal of the American Statistical Association, vol. 93, no. 443, pp. 1032–1044, 1998.
[25] T. Li, S. Sun, T. P. Sattar, and J. M. Corchado, “Fight sample degeneracy and impoverishment in particle filters: A review of intelligent approaches,” Expert Systems with Applications, vol. 41, no. 8, pp. 3944–3954, 2014.
[26] F. Gustafsson, F. Gunnarsson, N. Bergman, U. Forssell, J. Jansson, R. Karlsson, and P.-J. Nordlund, “Particle filters for positioning, navigation, and tracking,” IEEE Transactions on Signal Processing, vol. 50, no. 2, pp. 425–437, 2002.
[27] K. Okuma, A. Taleghani, N. D. Freitas, J. J. Little, and D. G. Lowe, “A boosted particle filter: Multitarget detection and tracking,” in European Conference on Computer Vision (ECCV), 2004, pp. 28–39.
[28] O. Cappé, S. J. Godsill, and E. Moulines, “An overview of existing methods and recent advances in sequential monte carlo,” in Proceedings of the IEEE, vol. 95, no. 5, 2007, pp. 899–924.
[29] A. Doucet, S. Godsill, and C. Andrieu, “On sequential monte carlo sampling methods for bayesian filtering,” Statistics and Computing, vol. 10, no. 3, pp. 197–208, 2000.
October, 2021
[30] Z. Chen, “Bayesian filtering: From kalman filters to particle filters, and beyond,” Statistics, vol. 182, no. 1, pp. 1–69, 2003.
[31] S. J. Julier and J. K. Uhlmann, “Unscented filtering and nonlinear estimation,” in Proceedings of the IEEE, vol. 92, no. 3, 2004, pp. 401–422.
[32] E. A. Wan and R. V. D. Merwe, “The unscented kalman filter for nonlinear estimation,” in Proceedings of the IEEE Adaptive Systems for Signal Processing, Communications, and Control Symposium, 2000, pp. 153–158.
[33] M. K. Pitt and N. Shephard, “Filtering via simulation: Auxiliary particle filters,” Journal of the American Statistical Association, vol. 94, no. 446, pp. 590–599, 1999.
[34] G. Kitagawa, “Monte carlo filter and smoother for non-gaussian nonlinear state space models,” Journal of Computational and Graphical Statistics, vol. 5, no. 1, pp. 1–25, 1996.
[35] P. A. M. Dirac, The Principles of Quantum Mechanics. Oxford University Press, 1981.
[36] T. Li, M. Bolic, and P. M. Djuric, “Resampling methods for particle filtering: Classification, implementation, and strategies,” IEEE Signal Processing Magazine, vol. 32, no. 3, pp. 70–86, 2015.
[37] R. Douc and O. Cappé, “Comparison of resampling schemes for particle filtering,” in Proceedings of the 4th International Symposium on Image and Signal Processing and Analysis, 2005, pp. 64–69.
[38] M. Quigley, K. Conley, B. Gerkey, J. Faust, T. Foote, J. Leibs, R. Wheeler, and A. Y. Ng, “Ros: An open-source robot operating system,” in ICRA Workshop on Open Source Software, vol. 3, 2009, p. 5.
[39] J. Lou, W. Wu, S. Liao, and R. Shi, “Air-m: A visual reality many-agent reinforcement learning platform for large-scale aerial unmanned system,” in Proceedings of the 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. 5598–5605.
[40] F. Gustafsson, “Particle filter theory and practice with positioning applications,” IEEE Aerospace and Electronic Systems Magazine, vol. 25, no. 7, pp. 53–82, 2010.
[41] J. Lou, W. Wu, S. Liao, and R. Shi, “Talker: A task-activated language model based knowledge-extension reasoning system,” IEEE Robotics and Automation Letters, 2024.
[42] H. Zhang, W. Du, J. Shan, Q. Zhou, Y. Du, and J. B. Tenenbaum, “Building cooperative embodied agents modularly with large language models,” in International Conference on Learning Representations (ICLR), 2024.
[43] A. OroojlooyJadid and D. Hajinezhad, “A review of cooperative multi-agent deep reinforcement learning,” Applied Intelligence, vol. 53, no. 11, pp. 13 677–13 722, 2023.
[44] L. Canese, G. C. Cardarilli, L. D. Nunzio, R. Fazzolari, D. Giardino, M. Re, and S. Spanò, “Multiagent reinforcement learning: A review of challenges and applications,” Applied Sciences, vol. 11, no. 11, p. 4948, 2021.
[45] M. Ahn, A. Brohan, N. Brown, Y. Chebotar, O. Cortes, and B. David, “Do as i can, not as i say: Grounding language in robotic affordances,” in Conference on Robot Learning (CoRL), 2022.
[46] T. Bailey and H. Durrant-Whyte, “Simultaneous localization and mapping (slam): Part ii,” IEEE Robotics & Automation Magazine, vol. 13, no. 3, pp. 108–117, 2006.
[47] S. Gronauer and K. Diepold, “Multi-agent deep reinforcement learning: A survey,” Artificial Intelligence Review, vol. 55, no. 2, pp. 895–943, 2022.
[48] A. T. Azar, A. Koubaa, N. A. Mohamed, and H. A. Ibrahim, “Drone deep reinforcement learning: A review,” Electronics, vol. 10, no. 9, p. 999, 2021.
[49] J. Kober, J. A. Bagnell, and J. Peters, “Reinforcement learning in robotics: A survey,” The International Journal of Robotics Research, vol. 32, no. 11, pp. 1238–1274, 2013.
[50] F. Dellaert, D. Fox, W. Burgard, and S. Thrun, “Monte carlo localization for mobile robots,” in IEEE International Conference on Robotics and Automation (ICRA), vol. 2, 1999, pp. 1322–1328.
[51] L. Chen, Z. Wang, and Y. Liu, “Deep reinforcement learning for autonomous drone navigation: A review,” Drones, vol. 7, no. 3, p. 198, 2023.
[52] Y. Li, “Deep reinforcement learning for robotics: A survey of real-world successes,” Annual Review of Control, Robotics, and Autonomous Systems, vol. 6, pp. 123–150, 2023.
[53] S. Thrun, D. Fox, W. Burgard, and F. Dellaert, “Robust monte carlo localization for mobile robots,” in Artificial Intelligence, vol. 128, 2001, pp. 99–141.
[54] Z. Wang, Y. Liu, and Y. Cheng, “A survey on robot localization in gps-denied environments,” IEEE Access, vol. 12, pp. 12345–12367, 2024.
[55] K. Zhu and T. Zhang, “Deep reinforcement learning based mobile robot navigation: A review,” Tsinghua Science and Technology, vol. 26, no. 5, pp. 674–691, 2021.
[56] Y. Tan, B. Liu, and W. Chen, “A survey of multi-robot cooperative localization methods,” Robotics and Autonomous Systems, vol. 150, p. 103990, 2022.
October, 2021
[57] Z. Wan, C. Jiang, M. Fahad, Z. Ni, Y. Guo, and H. He, “Robot-assisted pedestrian regulation based on deep reinforcement learning,” IEEE Transactions on Cybernetics, vol. 50, no. 4, pp. 1669–1682, 2020.
[58] T. T. Nguyen, N. D. Nguyen, and S. Nahavandi, “Deep reinforcement learning for multi-agent systems: A review of challenges, solutions, and applications,” IEEE Transactions on Cybernetics, vol. 50, no. 9, pp. 3826–3839, 2020.
[59] W. Huang, P. Abbeel, D. Pathak, and I. Mordatch, "Language models as zero-shot planners: Extracting actionable knowledge for embodied agents," in International Conference on Machine Learning (ICML), 2022.
[60] X. Xiao, B. Liu, G. Warnell, and P. Stone, “Motion planning and control for mobile robot navigation using machine learning: A survey,” Autonomous Robots, vol. 46, no. 5, pp. 569–597, 2022.
[61] B. Singh, R. Kumar, and V. P. Singh, “Reinforcement learning in robotic applications: A comprehensive survey,” Artificial Intelligence Review, vol. 55, no. 2, pp. 945–990, 2022.
[62] T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, and P. Dhariwal, “Language models are few-shot learners,” Advances in Neural Information Processing Systems (NeurIPS), vol. 33, pp. 1877–1901, 2020.
[63] E. Kaufmann, L. Bauersfeld, A. Loquercio, M. Müller, V. Koltun, and D. Scaramuzza, “Champion-level drone racing using deep reinforcement learning,” Nature, vol. 620, no. 7976, pp. 982–987, 2023.
[64] J. Orr and A. Dutta, “Multi-agent deep reinforcement learning for multi-robot applications: A survey,” Sensors, vol. 23, no. 7, p. 3625, 2023.
[65] D. Fox, “Adapting the sample size in particle filters through kld-sampling,” The International Journal of Robotics Research, vol. 22, no. 12, pp. 985–1003, 2003.
[66] M. Xu, P. Huang, Y. Niu, V. Kumar, J. Qiu, and C. Fang, "Creative robot tool use with large language models," arXiv preprint arXiv:2310.13065, 2023.
[67] S. Kuutti, R. Bowden, Y. Jin, P. Barber, and S. Fallah, "A survey of deep learning applications to autonomous vehicle control," IEEE Transactions on Intelligent Transportation Systems, vol. 22, no. 2, pp. 712–733, 2021.
[68] G. Grisetti, C. Stachniss, and W. Burgard, “Improved techniques for grid mapping with rao-blackwellized particle filters,” IEEE Transactions on Robotics, vol. 23, no. 1, pp. 34–46, 2007.