Simulator-Based Digital Twin of a Robotics Laboratory †
Abstract
1. Introduction
2. State of the Art
2.1. Model-Based Design
2.2. Software Generation
2.3. Robotics Education
3. Course Contents
3.1. Behavior Modeling
3.2. EFS2M Software Generation
3.2.1. EFS2M Programming Template
| Listing 1. The code for the EFSM of Figure 2 serves as a pattern for software synthesis that includes both direct correspondence between graphical elements and program instructions and self-diagnosis (lines 37–42). |
![]() |
| Listing 2. Programming the EFSM of Figure 2 includes false optimizations that may mask model errors. |
![]() |
3.2.2. Automatic Software Synthesis
3.3. Real-Time Simulation
3.4. Simulation and Reality Synchronization
3.5. Model Update
4. Conclusions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| AI | Artificial Intelligence |
| BDI | Belief–Desire–Intention |
| BT | Behavior Tree |
| DDS | Data Distribution Service |
| ECTS | European Credit Transfer System |
| EFSM | Extended Finite State Machine |
| EFS2M | Extended Finite State Stack Machine |
| FSM | Finite State Machine |
| HCEFSM | Hierarchical Concurrent Extended Finite State Machine |
| HSM | Hierarchical State Machine |
| IDE | Integrated Development Environment |
| LLM | Large Language Model |
| MBD | Model-Based Design |
| MBSE | Model-Based Systems Engineering |
| MIR | Model Intermediate Representation |
| PID | Proportional–Integral–Derivative Controller |
| ROS, ROS 2 | Robot Operating System (versions 1 and 2) |
| SLAM | Simultaneous Localization and Mapping |
| SSSM | Single-State State Machine |
| UML | Unified Modeling Language |
| XR | Extended Reality |
| YOLO | You Only Look Once |
References
- Ribas-Xirgo, L. State Machine Model of a Controller System for an Educational Mobile Robot. In Proceedings of the International Workshop on Physical Agents, Cartagena, Spain, 4–5 September 2025; Available online: http://hdl.handle.net/10317/21020 (accessed on 2 February 2026). [CrossRef]
- Cruz-Lemus, J.A.; Genero, M.; Manso, M.E.; Morasca, S.; Piattini, M. Assessing the understandability of UML statechart diagrams with composite states—A family of empirical studies. Empir. Softw. Eng. 2009, 14, 685–719. [Google Scholar] [CrossRef]
- Pasupuleti, S. Model-Based Systems Engineering (MBSE) for the Design and Integration of Complex Robotics Systems. ESP J. Eng. Technol. Adv. 2023, 3, 126–132. Available online: http://espjeta.org/Volume3-Issue3/JETA-V3I7P116.pdf (accessed on 2 February 2026). [CrossRef]
- Zhang, L.; Chen, Z.; Laili, Y.; Ren, L.; Deen, M.J.; Cai, W.; Zhang, Y.; Zeng, Y.; Gu, P. MBSE 2.0: Toward More Integrated, Comprehensive, and Intelligent MBSE. Systems 2025, 13, 584. [Google Scholar] [CrossRef]
- Vogel-Heuser, B.; Schütz, D.; Frank, T.; Legat, C. Model-driven engineering of Manufacturing Automation Software Projects—A SysML-based approach. Mechatronics 2014, 24, 883–897. [Google Scholar] [CrossRef]
- Center, K. Describing and Deploying Satellite Behaviors Using Rules-based Statecharts. In Small Satellite Conference; Utah State University’s (USU) Institutional Repository: Logan, UT, USA, 2014; Available online: https://digitalcommons.usu.edu/smallsat/2014/IntellSoftware/2/ (accessed on 2 February 2026).
- Cariou, E.; Brunschwig, L.; Le Goaer, O.; Barbier, F. A software development process based on UML state machines. In Proceedings of the International Conference on Advanced Aspects of Software Engineering (ICAASE), Constantine, France, 1–8 November 2020. [Google Scholar] [CrossRef]
- Harel, D. Statecharts: A Visual Formalism for Complex Systems. Sci. Comput. Program. 1987, 8, 231–274. [Google Scholar] [CrossRef]
- Yang, N.; Cuijpers, P.; Schiffelers, R.; Lukkien, J.; Serebrenik, A. Single-state state machines in model-driven software engineering: An exploratory study. Empir. Softw. Eng. 2021, 26, 6. [Google Scholar] [CrossRef]
- Su, Z.; Wang, D.; Yang, Y.; Yu, Z.; Chang, W.; Li, W. MDD: A Unified Model-Driven Design Framework for Embedded Control Software. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2022, 41, 3252–3265. [Google Scholar] [CrossRef]
- Open Robotics. ROS—Robot Operating System: Home and ROS 2 Releases. 2024–2025 Updates. Available online: www.ros.org/ (accessed on 2 February 2026).
- Pagare, T. The Future of Robotics Simulation and ROS 2 in 2025. LinkedIn Article. 29 May 2025. Available online: www.linkedin.com/pulse/future-robotics-simulation-ros-2-2025-tejas-pagare-gh03e/ (accessed on 2 February 2026).
- Trinh, H.H.; Sirjani, M.; Ciccozzi, F.; Masud, A.N.; Sjödin, M. Modelling and Model-Checking a ROS2 Multi-Robot System using Timed Rebeca. arXiv 2025. Available online: https://arxiv.org/abs/2511.15227 (accessed on 2 February 2026).
- Dust, L.; Gu, R.; Mubeen, S.; Ekström, M.; Seceleanu, C. A model-based approach to automation of formal verification of ROS 2-based systems. Front. Robot. AI 2025, 12, 1592523. [Google Scholar] [CrossRef]
- Sarraf, G. ROS 2 Control for Custom Robots: Mastering Real-Time Robot Control. ThinkRobotics Blog. 3 September 2025. Available online: https://thinkrobotics.com/blogs/learn/ros-2-control-for-custom-robots-mastering-real-time-robot-control (accessed on 2 February 2026).
- Naderhirn, M.; Köpf, M.; Mendler, J. Model Based Design for Safety Critical Controller Design with ROS and Gazebo. In ROSCon 2017. Available online: https://roscon.ros.org/2017/presentations/ROSCon%202017%20Kontrol.pdf (accessed on 2 February 2026).
- Flores González, J.M.; Coronado, E.; Yamanobe, N. ROS-Compatible Robotics Simulators for Industry 4.0 and Industry 5.0: A Systematic Review of Trends and Technologies. Appl. Sci. 2025, 15, 8637. [Google Scholar] [CrossRef]
- Winiarski, T.; Kaniuka, J.; Giełdowski, D.; Ostrysz, J.; Radlak, K.; Kushnir, D. ROS-Related Robotic Systems Development with V-Model-Based Application of MeROS Metamodel. arXiv 2025. [Google Scholar] [CrossRef]
- Heller, M. LLMs and the Rise of the AI Code Generators. InfoWorld. May 2023. Available online: www.infoworld.com/article/2338500/llms-and-the-rise-of-the-ai-code-generators.html (accessed on 2 February 2026).
- Huynh, N.; Lin, B. A Survey On Large Language Models For Code Generation. arXiv 2025. [Google Scholar] [CrossRef]
- Jiang, J.; Wang, F.; Shen, J.; Kim, S.; Kim, S. A Survey on Large Language Models for Code Generation. ACM Trans. Softw. Eng. Methodol. 2025, 35, 2. [Google Scholar] [CrossRef]
- Yan, H.; Vaidya, S.S.; Zhang, X.; Yao, Z. Guiding AI to Fix Its Own Flaws: An Empirical Study on LLM-Driven Secure Code Generation. arXiv 2025. Available online: https://arxiv.org/html/2506.23034v1 (accessed on 2 February 2026).
- Wang, J.; Luo, X.; Cao, L.; He, H.; Huang, H.; Xie, J.; Jatowt, A.; Cai, Y. Is Your AI-Generated Code Really Secure? Evaluating Large Language Models on Secure Code Generation with CodeSecEval. arXiv 2024. [Google Scholar] [CrossRef]
- Liu, Y.; Chen, X.; Gao, Y.; Su, Z.; Zhang, F.; Zan, D.; Lou, J.; Chen, P.; Ho, T. Uncovering and quantifying social biases in code generation. In Proceedings of the 37th International Conference on Neural Information Processing Systems (NIPS ’23); Curran Associates Inc.: Red Hook, NY, USA, 2023; pp. 2368–2380. [Google Scholar]
- Wang, C.; Li, Z.; Gao, C.; Wang, W.; Peng, T.; Huang, H.; Deng, Y.; Wang, S.; Lyu, M. Exploring Multi-Lingual Bias of Large Code Models in Code Generation. arXiv 2024. [Google Scholar] [CrossRef]
- Huang, D.; Zhang, J.; Bu, Q.; Xie, X.; Chen, J.; Cui, H. Bias Testing and Mitigation in LLM-based Code Generation. ACM Trans. Softw. Eng. Methodol. 2026, 35, 5. [Google Scholar] [CrossRef]
- Dou, S.; Jia, H.; Wu, S.; Zheng, H.; Wu, M.; Tao, Y.; Zhang, M.; Chai, M.; Fan, J.; Xi, Z.; et al. What is Wrong with Your Code Generated by Large Language Models? An Extensive Study. Sci. China Inf. Sci. 2025, 69, 112107. [Google Scholar] [CrossRef]
- Pan, R.; Ibrahimzada, A.R.; Krishna, R.; Sankar, D.; Wassi, L.P.; Merler, M.; Sobolev, B.; Pavuluri, R.; Sinha, S.; Jabbarvand, R. Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code. In Proceedings of the IEEE/ACM 46th International Conference on Software Engineering (ICSE ’24); Association for Computing Machinery: New York, NY, USA, 2024; p. 82. [Google Scholar] [CrossRef]
- Liu, Y.; Le-Cong, T.; Widyasari, R.; Tantithamthavorn, C.; Li, L.; Le, X.-B.D.; Lo, D. Refining ChatGPT-Generated Code: Characterizing and Mitigating Code Quality Issues. ACM Trans. Softw. Eng. Methodol. 2024, 33, 116. [Google Scholar] [CrossRef]
- Wang, Z.; Zhou, Z.; Song, D.; Huang, Y.; Chen, S.; Ma, L.; Zhang, T. Towards Understanding the Characteristics of Code Generation Errors Made by Large Language Models. In Proceedings of the 2025 IEEE/ACM 47th International Conference on Software Engineering, ICSE 2025; IEEE Computer Society: Washington, DC, USA, 2025; pp. 2587–2599. [Google Scholar] [CrossRef]
- Ma, Z.; Guo, H.; Chen, J.; Peng, G.; Cao, Z.; Ma, Y.; Gong, Y. LLaMoCo: Instruction Tuning of Large Language Models for Optimization Code Generation. arXiv 2024. [Google Scholar] [CrossRef]
- Tsai, Y.D.; Liu, M.; Ren, H. Code less, align more: Efficient LLM fine-tuning for code generation with data pruning. arXiv 2024. [Google Scholar] [CrossRef]
- Weyssow, M.; Zhou, X.; Kim, K.; Lo, D.; Sahraoui, H. Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Models. ACM Trans. Softw. Eng. Methodol. 2025, 34, 204. [Google Scholar] [CrossRef]
- Chawre, H. Fine-Tuning LLMs: Overview, Methods, and Best Practices. Turing. March 2025. Available online: www.turing.com/resources/finetuning-large-language-models (accessed on 2 February 2026).
- Mu, F.; Shi, L.; Wang, S.; Yu, Z.; Zhang, B.; Wang, C.; Liu, S.; Wang, Q. ClarifyGPT: A Framework for Enhancing LLM-Based Code Generation via Requirements Clarification. Proc. ACM Softw. Eng. 2024, 1, 103. [Google Scholar] [CrossRef]
- Tian, H.; Lu, W.; Li, T.; Tang, X.; Cheung, S.; Klein, J.; Bissyandé, T. Is ChatGPT the ultimate programming assistant: How far is it? arXiv 2023, arXiv:2304.11938. [Google Scholar] [CrossRef]
- Bordt, S.; Luxburg, U. ChatGPT Participates in a Computer Science Exam. arXiv 2023, arXiv:2303.09461. [Google Scholar] [CrossRef]
- Hou, W.; Ji, Z. Comparing Large Language Models and Human Programmers for Generating Programming Code. Adv. Sci. 2025, 12, 2412279. [Google Scholar] [CrossRef]
- Siegwart, R.; Nourbaksh, I.R. Introduction to Autonomous Mobile Robots; The MIT Press: Cambridge, MA, USA, 2004. [Google Scholar]
- Graig, J.J. Introduction to Robotics: Mechanics and Control; Pearson Education International: London, UK, 2005. [Google Scholar]
- Murphy, R.R. Introduction to AI Robotics; The MIT Press: Cambridge, MA, USA, 2019. [Google Scholar]
- Gil-Vázquez, P. Intelligent Robotics. Master’s Thesis, Universitat d’Alacant, Sant Vicent del Raspeig, Spain, 2023. [Google Scholar]
- Sacré, P. Introduction to Intelligent Robotics. Master’s Thesis, University of Liège, Liège, Belgium, 2025. [Google Scholar]
- Čehovin Zajc, L.; Rezelj, A.; Skočaj, D. Teaching Intelligent Robotics with a Low-Cost Mobile Robot Platform. In Proceedings of the Robotics in Education (RiE), Yverdon-les-Bains, Switzerland, 20–23 May 2015. [Google Scholar]
- PlayerStage Homepage. Available online: https://sourceforge.net/projects/playerstage/ (accessed on 2 February 2026).
- Coppelia Robotics: CoppeliaSim. Available online: www.coppeliarobotics.com (accessed on 2 February 2026).
- Cyberbotics: Webots. Available online: https://cyberbotics.com/ (accessed on 2 February 2026).
- Macenski, S.; Foote, T.; Gerkey, B.; Lalancette, C.; Woodall, W. Robot Operating System 2: Design, architecture, and uses in the wild. Sci. Robot. 2022, 7, eabm6074. [Google Scholar] [CrossRef] [PubMed]
- Cañas-Plaza, J.; Perdices, E.; García-Pérez, L.; Fernández-Conde, J. A ROS-Based Open Tool for Intelligent Robotics Education. Appl. Sci. 2020, 10, 7419. [Google Scholar] [CrossRef]
- Roldán-Álvarez, D.; Mahna, S.; Cañas, J.M. A ROS-based Open Web Platform for Intelligent Robotics Education. In Robotics in Education (RiE); Merdan, M., Lepuschitz, W., Koppensteiner, G., Balogh, R., Obdržálek, D., Eds.; Advances in Intelligent Systems and Computing Series; Springer: Cham, Switzerland, 2022; Volume 1359. [Google Scholar] [CrossRef]
- Martín-Rico, F. A Concise Introduction to Robot Programming with ROS2; Chapman & Hall: London, UK, 2022. [Google Scholar]
- Ptolemaeus, C. (Ed.) System Design, Modeling, and Simulation using Ptolemy II; Ptolemy.org: Berkeley, CA, USA, 2014. [Google Scholar]
- Wong, K.; Ehlers, R.; Kress-Gazit, H. Correct High-level Robot Behavior in Environments with Unexpected Events. In Proceedings of the 2014 Robotics: Science and Systems Conference, Berkeley, CA, USA, 12–16 July 2014. [Google Scholar] [CrossRef]
- Gharbi, A. Faulty control system. Cogn. Syst. Res. 2024, 86, 101233. [Google Scholar] [CrossRef]
- Bradski, G. The OpenCV Library. Dr. Dobb’S J. Softw. Tools 2000, 25, 2236121. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR); IEEE: New York, NY, USA, 2016; pp. 779–788. [Google Scholar] [CrossRef]
- JGraph: Diagrams.net, Draw.io. Available online: https://app.diagrams.net/ (accessed on 2 February 2026).
- Ierusalimschy, R.; Figueiredo, L.H.d.; Celes, W. Lua 5.1 Reference Manual; Lua.org: Rio de Janeiro, Brazil, 2006. [Google Scholar]
- Kulchenko, P. ZeroBrane Studio: Lightweight IDE for Your Lua Needs. Available online: https://studio.zerobrane.com (accessed on 2 February 2026).
- Rivas, D.; Das, P.; Saiz-Alcaine, J.; Ribas-Xirgo, L. Synthesis of Controllers from Finite State Stack Machine Diagrams. In IEEE International Conference on Emerging Technologies and Factory Automation (ETFA); IEEE: New York, NY, USA, 2018; pp. 1179–1182. [Google Scholar]
- de Silva, L.; Meneguzzi, F.; Logan, B. BDI agent architectures: A survey. In Proceedings of the 29th International Joint Conference on Artificial Intelligence (IJCAI); Bessiere, C., Ed.; IJCAI Organization: Menlo Park, CA, USA, 2020; pp. 4914–4921. [Google Scholar]
- Hyde, R. The Fallacy of Premature Optimization. Ubiquity 2009, 2009, 1. [Google Scholar] [CrossRef]
- Bernateau, S.; Derigent, W.; Marangé, P.; Aubry, A.; Attar, A.B. Review of Methods for Synchronizing a Digital Twin in an Industrial Context. In Service Oriented, Holonic and Multi-Agent Manufacturing Systems for Industry of the Future; Borangiu, T., Trentesaux, D., Leitão, P., Legat, C., Eds.; SOHOMA 2024; Studies in Computational Intelligence; Springer: Cham, Switzerland, 2025; Volume 1197. [Google Scholar] [CrossRef]
- Soykan, B.; Blanc, G.; Rabadi, G. A Proof-of-Concept Digital Twin for Real-Time Simulation: Leveraging a Model-Based Systems Engineering Approach. IEEE Access 2025, 13, 58899–58912. [Google Scholar] [CrossRef]
- Abou-Chakra, J.; Sun, L.; Rana, K.; May, B.; Schmeckpeper, K.; Suenderhauf, N.; Minniti, M.V.; Herlant, L. Real-is-Sim: Bridging the Sim-to-Real Gap with a Dynamic Digital Twin. arXiv 2025. [Google Scholar] [CrossRef]
- Chaile, I.F.; Ribas-Xirgo, L. MASYM, a Framework to Deploy Synchronized Industrial Systems Based on Any ABM Simulator. IEEE Lat. Am. Trans. 2015, 13, 3244–3252. [Google Scholar] [CrossRef]
- Ribas-Xirgo, L. A state-based multi-agent system model of taxi fleets. Multimed. Tools Appl. 2022, 81, 3515–3534. [Google Scholar] [CrossRef]
- Deubert, D.; Schultze, S.; Selig, A.; Verl, A. Synchronized online simulation at field level for virtual sensing of web tension. Discov. Appl. Sci. 2025, 7, 574. [Google Scholar] [CrossRef]
- Cao, Y.; Currie, C.; Onggo, B.S.; Higgins, M. Simulation Optimization for a Digital Twin Using a Multi-Fidelity Framework. In Winter Simulation Conference (WSC), Phoenix, AZ, USA, 12–15 December 2021; IEEE: New York, NY, USA, 2021; pp. 1–12. [Google Scholar] [CrossRef]
- Maddukuri, A.; Jiang, Z.; Chen, L.Y.; Nasiriany, S.; Xie, Y.; Fang, Y.; Huang, W.; Wang, Z.; Xu, Z.; Chernyadev, N.; et al. Sim-and-Real Co-Training: A Simple Recipe for Vision-Based Robotic Manipulation. In Proceedings of the Robotics: Science and Systems (RSS), Los Angeles, CA, USA, 21–25 June 2025; Available online: https://co-training.github.io/ (accessed on 2 February 2026).
- Xiu, D.; Tartakovsky, D.M. Computational Framework for Real-Time Digital Twins. Thermopedia 2025. Available online: www.thermopedia.com/content/10452 (accessed on 2 February 2026).
- Das, P.; Ribas-Xirgo, L. Travel Time Estimation for Optimal Planning in Internal Transportation. World Electr. Veh. J. 2024, 15, 565. [Google Scholar] [CrossRef]
- Ribas-Xirgo, L. Introduction to Intelligent, Mobile Robots with State-based Controllers. Zenodo 2026. [Google Scholar] [CrossRef]









Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Ribas-Xirgo, L. Simulator-Based Digital Twin of a Robotics Laboratory. Machines 2026, 14, 273. https://doi.org/10.3390/machines14030273
Ribas-Xirgo L. Simulator-Based Digital Twin of a Robotics Laboratory. Machines. 2026; 14(3):273. https://doi.org/10.3390/machines14030273
Chicago/Turabian StyleRibas-Xirgo, Lluís. 2026. "Simulator-Based Digital Twin of a Robotics Laboratory" Machines 14, no. 3: 273. https://doi.org/10.3390/machines14030273
APA StyleRibas-Xirgo, L. (2026). Simulator-Based Digital Twin of a Robotics Laboratory. Machines, 14(3), 273. https://doi.org/10.3390/machines14030273



