Research Analyzer
← Back ICRA 2026

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

Weihang Guo, Theodoros Tyrovouzis, Lydia Kavraki

PDF

AI summary

Key figure (auto-extracted from paper)
LLM-assisted generation of nanobind wrappers, guided by human review and structured prompts, reliably produces high-performance Python bindings for large C++ libraries.
Python bindings nanobind Large language models OMPL Human-in-the-loop C++ robotics

Problem

Automating Python bindings for large C++ robotics libraries is tedious and error-prone, with legacy tools failing on modern compilers and creating a heavy maintenance burden.

Approach

The authors implement a human-in-the-loop workflow that mirrors the C++ codebase to scaffold wrapper files, uses LLMs to generate nanobind code, and applies expert review to ensure correctness and performance.

Key results

  • A modular, file-per-module scaffolding workflow for nanobind wrappers
  • Documentation of common LLM failure modes like shared pointer mismanagement and overload handling
  • Prompt design strategies and in-context examples that significantly improve generation reliability
  • Runtime performance of generated bindings comparable to legacy C++-native solutions

Why it matters

Offers a scalable, maintainable blueprint for robotics researchers and library developers to modernize C++ bindings using AI-assisted workflows.

Abstract

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.

Index terms

Methods and Tools for Robot System Design

Related papers