arXiv:2610.41168cs.SEOct 2026

Manuscript Offprint

arXiv:2610.41168

ROSTrans: Empirically Benchmarking LLMs for ROS1-to-ROS2 Migration

Yichen Zhao, Minghao Shao, Zhuoyan Yu, Yijun Shen, Boyuan Chen, Yik-Cheung Tam, Muhammad Shafique

Yichen Zhao*, Minghao Shao†‡, Zhuoyan Yu*, Yijun Shen*, Boyuan Chen†‡, Yik-Cheung Tam*, Muhammad Shafique‡

*Center for Data Science, NYU Shanghai, China †NYU Tandon, USA ‡NYU Abu Dhabi, UAE {yz10469, shao.minghao, ys6126, zy3077, bc3194, wilson.tam, muhammad.shafique}@nyu.edu

Abstract—Although large language models have shown strong capabilities in domain-specific code generation, their performance in robotics software development, especially for the Robot Operating System (ROS), remains largely unexplored. ROS code generation presents distinctive challenges, including complex inter-node coordination, middleware configuration, and lifecycle semantics that go far beyond standard coding benchmarks, and many important correctness properties become observable only once migrated nodes are launched and communicate. We present ROSTrans, a benchmark for evaluating LLMs on ROS1-to-ROS2 code migration, a representative and practically important setting for ROS code generation. ROSTrans comprises 108 scaffolded completion tasks drawn from a diverse set of 70+ open-source ROS1 repositories and organized into a hierarchical taxonomy assessing interface-level, behavioral-level and system-level correctness. For every task we establish an executable reference: a verified ROS2 implementation, a runtime test suite that launches the nodes and exercises their topics, services, actions and parameters, and a container ensuring reproducibility. Candidates are scored by injecting only their target files into an otherwise fixed copy of the reference package, so a candidate can neither supply nor weaken the tests it is judged by. Evaluating six frontier LLMs over five stochastic generations per task, we find pass@1 below 10.9%, and that 56.5% of all samples build successfully and then fail at runtime, and 32.0% fail runtime assertions on the migrated interfaces, a class of error no compile-only oracle can detect. Execution-guided repair further improves task success, reaching 49.1% and 47.2% for Claude Opus 4.6 and GPT-5.5 after three rounds, respectively.

I. INTRODUCTION

Large language models have evolved into general-purpose reasoning engines, showing strong performance in content understanding and knowledge-grounded question answering [1]. Beyond natural language processing, LLMs are now widely applied to code generation across specialized domains, from hardware design and verification [2], [3], [4] to quantum circuit generation [5]. Models such as Codex, CodeLlama, and DeepSeek-Coder achieve strong results on mainstream programming languages [6], while recent work extends code intelligence to repository-scale understanding, cross-file patch generation [7], and vulnerability detection and repair [8], [9]. LLM-based code generation is therefore advancing along two closely related directions, broadening domain coverage while deepening software engineering reasoning from isolated functions to complete project lifecycles.

Despite this progress, LLM capabilities in robotics software development remain insufficiently explored. The ongoing transition from the legacy ROS1 ecosystem to ROS2 provides a representative and practically important setting

Figure

Fig. 1. ROSTrans overview. ROS1 repositories are transformed into 108 tasks via LLM-assisted hollowing, then evaluated via pass rate.

for ROS code generation, yet it requires more than API renaming. It demands rethinking communication middleware, node lifecycle management, execution semantics, and system organization [10]. Robotics code must also satisfy complex inter-node coordination, real-time Quality of Service constraints, and execution semantics that go beyond the scope of standard coding benchmarks [11]. These challenges are further amplified by the heterogeneity of ROS packages, distributions, build systems, and application domains, where high-quality public code is limited and fragmented. As a result, data-driven models struggle to acquire the structural priors needed for reliable robotics programming [12]. Yet the community still lacks standardized benchmarks for evaluating LLM performance on ROS1-to-ROS2 migration.

To bridge this gap, we present ROSTrans¹, a comprehensive benchmark evaluating LLMs on robotics-specific code migration. Given a partially specified ROS1 codebase and a task description, the goal is to generate functionally equivalent ROS2 code with correct inter-node communication and logical execution flow. ROSTrans derives 108 tasks from 70+ open-source ROS1 repositories, organized by a hierarchical taxonomy measuring interface, behavioral and system-level correctness. All tasks use scaffolded code completion to isolate architectural reasoning from boilerplate generation. For

¹Benchmark source code and evaluation framework are open source at: github https://github.com/NYU-Serendipity-LLM4Coding/ROSTrans each task we establish an executable reference by translating the hollowed sources, building the result in a container, running the tests it must satisfy, and feeding failures back for repair until the package builds and passes. Candidates are then scored by a hybrid-injection protocol in which only the candidate's target files replace their counterparts in an otherwise fixed copy of the reference package, leaving the tests and the build configuration outside the candidate's reach. Our contributions are as follows.

  • We propose ROSTrans, a benchmark dedicated to ROS1-to-ROS2 code migration in which every task is decided by building and running the migrated package, across three levels of architectural scope.
  • We describe a construction and evaluation protocol that makes such a benchmark auditable: references are established by execution rather than asserted, test adequacy is checked by mutation, and the evaluation path itself is validated by scoring the reference as a candidate and by injecting deliberately invalid content.
  • We evaluate six frontier LLMs and find uniformly low success rates, with the majority of failures occurring after a successful build, and characterize where and why the migrations break down.

References (27)