Modeling and Recovering Hierarchical Structural Architectures of ROS 2 Systems from Code and Launch Configurations using LLM-based Agents
New AI pipeline recovers hierarchical system models from code with high precision, tackling a major robotics challenge.
A new research paper presents a breakthrough in automating the understanding of complex robotic software systems. The team, led by Mohamed Benchat and 11 co-authors, developed a novel pipeline that uses LLM-based agents to recover the hierarchical structural architecture of ROS 2 (Robot Operating System 2) systems directly from source code and launch configurations. This addresses a critical pain point in robotics: while Model-Driven Engineering (MDE) relies on explicit architecture models, ROS 2 subsystem structures are often only implicitly defined across distributed configuration files, making them hard to document and maintain.
The technical approach is a two-part contribution. First, the researchers created a UML-based modeling concept specifically for capturing the hierarchical decomposition of ROS 2 systems. Second, they built an automated recovery pipeline that combines deterministic extraction techniques with LLM-based agents guided by a 'ROS 2 architectural blueprint.' This blueprint encodes structural contracts—defining nodes, topics, interfaces, and launch-induced wiring—to constrain the AI's synthesis and enable deterministic validation, significantly improving reliability over purely generative methods.
In evaluation on three ROS 2 codebases, including an industrial-scale subset, the method demonstrated high precision across different abstraction levels. However, the results also revealed a remaining challenge: recall at the subsystem level decreased as repository complexity increased, primarily due to implicit launch semantics that are difficult for any automated system to infer. The work represents a significant step toward making large-scale robotic software more maintainable and understandable, reducing the manual effort required for critical architectural documentation.
- Combines deterministic code extraction with LLM-based agents guided by structural contracts (a 'ROS 2 architectural blueprint') for reliable model synthesis.
- Achieved high precision in evaluations across three ROS 2 repositories, though subsystem-level recall drops with system complexity.
- Automates the recovery of hierarchical structural models—a first-class architectural view previously entangled with launch artifacts—saving significant engineering time.
Why It Matters
Automates the tedious, error-prone task of documenting complex robot software architectures, accelerating development and maintenance.