RoboScript: Code Generation for Free-Form Manipulation Tasks across Real and Simulation

Junting Chen, Yao Mu, Qiaojun Yu, Tianming Wei, Silang Wu, Zhecheng Yuan, Zhixuan Liang, Chao Yang, Kaipeng Zhang, Wenqi Shao, Yu Qiao, Huazhe Xu, Mingyu Ding, Ping LuoarXiv 2024 · DOI

Abstract

RoboScript is a modular platform and benchmark designed to bridge the "ideal-to-real" gap in robot manipulation by transforming free-form natural language instructions into executable robot control code. By integrating Large Language Models (LLMs) with a comprehensive perception-to-motion-planning pipeline, RoboScript addresses the challenges of physical constraints, sensor noise, and 3D collision avoidance. Our evaluation demonstrates that while high-level reasoning is achievable with models like GPT-4, the transition to realistic perception and physical execution introduces significant complexities. We validate our approach across diverse tasks in both simulation and on real-world hardware, including Franka Panda and UR5 robot arms.

Introduction

While Embodied AI has advanced significantly in high-level task planning, a persistent gap remains between semantic reasoning and physical execution. Most current systems excel at abstract logic but struggle with the "nitty-gritty" of robotics: generating syntactically correct code for the Robot Operating System (ROS), ensuring 3D collision avoidance, and managing the physical nuances of various grippers and object geometries. Existing benchmarks often overlook these lower-level control and physical constraints, such as workspace limits or articulation dynamics, which are critical for real-world deployment. RoboScript addresses this by providing a full-stack pipeline that connects high-level instructions to low-level motion planning.

The RoboScript Pipeline

The RoboScript framework employs a modular architecture that utilizes LLMs to generate Python code, which then invokes specialized tools for perception and motion planning.

Figure 1: Overview of the RoboScript pipeline, integrating sensor input, human instructions, and URDFs through LLM-driven code generation to control real and simulated robots.

Hierarchical Code Generation

The system uses a hierarchical approach where a "Main Agent" outlines the task workflow and "Sub-Agents" generate specific function definitions. Chain-of-Thought (CoT) prompting is utilized to help the model reason through complex physical interactions. This process ensures that the generated code is not just semantically correct but also physically grounded.

Perception-in-the-Loop

To move beyond idealized ground-truth data, RoboScript incorporates a realistic perception stack. This includes GLIP for 2D object grounding, TSDF fusion for 3D scene reconstruction, and AnyGrasp for predicting 6-DOF grasp poses from point clouds. This "perception-in-the-loop" approach allows the system to handle sensor noise and dynamic environments.

Figure 2: Detailed data flow and Chain-of-Code execution for a manipulation task, showing the transition from natural language to perception and motion planning.

Motion Planning and ROS Integration

Generated code interfaces with MoveIt and the Open Motion Planning Library (OMPL) via a conda-compatible ROS infrastructure (Robostack). This allows for collision-free pathfinding and seamless deployment across simulation environments (Gazebo) and physical hardware (Franka Panda, UR5).

Experimental Evaluation

The RoboScript Benchmark includes eight core tasks of varying difficulty, utilizing a library of over 1,000 objects and articulated furniture from datasets like YCB, Google Scanned Objects, and PartNet-Mobility.

Key Results

  • LLM Proficiency: GPT-4 serves as the "gold standard," achieving 100% correctness under ground-truth perception. In contrast, GPT-3.5 and Gemini-pro struggled with complex spatial reasoning and formatting.
  • Impact of Realistic Perception: Transitioning from ground-truth data to the actual perception pipeline resulted in a success rate drop of approximately 10.1% for "Pick and Place" tasks and 6.0% for "Open Drawer" tasks, highlighting the sensitivity of motion planning to perception noise.
  • Physical Nuances: Noise in the perception pipeline, particularly in Octomap construction, significantly impacts motion planning more than grasp detection. Furthermore, object geometry (e.g., spheres or cylinders) can lead to mechanical instability during transport in constrained spaces.

Conclusion

RoboScript demonstrates that LLMs can effectively generate low-level control code for complex manipulation tasks when integrated into a robust perception and planning pipeline. While challenges remain regarding heuristic reliance and sensitivity to environmental clutter, the successful real-world validation on multiple robot platforms marks a significant step toward closing the "ideal-to-real" gap in embodied AI.

Summary updated

BibTeX
@misc{chen2024roboscript,
  author = {Junting Chen and Yao Mu and Qiaojun Yu and Tianming Wei and Silang Wu and Zhecheng Yuan and Zhixuan Liang and Chao Yang and Kaipeng Zhang and Wenqi Shao and Yu Qiao and Huazhe Xu and Mingyu Ding and Ping Luo},
  title = {{RoboScript: Code Generation for Free-Form Manipulation Tasks across Real and Simulation}},
  year = {2024},
  eprint = {2402.14623},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.14623},
}
Figure