arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2603.04668cs.RO
收藏

Python绑定用于大型C++机器人库:OMPL案例

Python Bindings for a Large C++ Robotics Library: The Case of OMPL

Department of Computer Science, Rice University(计算机科学系,里士大学)

Weihang Guo, Theodoros Tyrovouzis, Lydia E. Kavraki

AI总结:

本文利用大语言模型生成Python绑定,提升大型C++机器人库的开发效率与性能。

摘要:

Python绑定是连接高性能C++库与Python灵活性的关键桥梁,使机器人研究能够快速原型设计、可重复实验,并与模拟和学习框架集成。然而,为大型代码库生成绑定是一个繁琐的过程,给维护小组带来沉重负担。本文研究了使用大语言模型(LLMs)协助生成nanobind封装器的方法,同时保持人类专家参与。我们的工作流程模仿C++代码库的结构,生成空封装文件,并利用LLMs填写绑定定义。专家随后审查和改进生成的代码以确保正确性、兼容性和性能。通过在大型C++运动规划库上的案例研究,我们记录了常见的失败模式,包括共享指针管理不当、重载和跳转点,展示了上下文示例和精心设计的提示如何提高可靠性。实验表明,生成的绑定在运行时性能上与传统解决方案相当。除了该案例研究,我们的结果为在大规模C++项目中应用LLMs进行绑定生成提供了普遍的启示。

英文摘要:

Python bindings are a critical bridge between high-performance C++ libraries and the flexibility of Python, enabling rapid prototyping, reproducible experiments, and integration with simulation and learning frameworks in robotics research. Yet, generating bindings for large codebases is a tedious process that creates a heavy burden for a small group of maintainers. In this work, we investigate the use of Large Language Models (LLMs) to assist in generating nanobind wrappers, with human experts kept in the loop. Our workflow mirrors the structure of the C++ codebase, scaffolds empty wrapper files, and employs LLMs to fill in binding definitions. Experts then review and refine the generated code to ensure correctness, compatibility, and performance. Through a case study on a large C++ motion planning library, we document common failure modes, including mismanaging shared pointers, overloads, and trampolines, and show how in-context examples and careful prompt design improve reliability. Experiments demonstrate that the resulting bindings achieve runtime performance comparable to legacy solutions. Beyond this case study, our results provide general lessons for applying LLMs to binding generation in large-scale C++ projects.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑