Source-linked AI summary

CoEnv: Code-Driven Exploration in Real-to-Sim Digital Twins for Multi-Arm Manipulation

Li Kang, Yutao Fan, Rui Li, Heng Zhou, Yiran Qin, Zhemeng Zhang, Songtao Huang, Xiufeng Song, Zaibin Zhang, Bruno N. Y. Chen, Zhenfei Yin, Dongzhan Zhou, Wangmeng Zuo, Lei Bai

arXiv:2604.05484v2cs.ROcs.CV

TL;DR

Multi-arm robot programs need a safe place to practice, but hardware is risky and generic simulations do not match deployment workspaces. CoEx uses a reconstructed digital twin for code-driven program exploration and grounded verification; across five real-world tasks it outperforms the same system without a code agent, while verified rollouts also support policy fine-tuning.

  • Problem

    Multi-arm practice on hardware risks collisions and costly resets, while generic simulation benchmarks do not match deployment geometry, assets, or camera views.

    Source: §1 · pp. 1–2
  • Method

    CoEnv reconstructs a deployment workspace as an executable twin where a centralized code agent writes, runs, and refines complete multi-arm programs against grounded verification.

    Source: §1 · p. 2, §3.2 · p. 5
  • Results

    70% average real-world success versus 50% without the code agent across five tasks, with 3.8×–11.7× the ablated system’s verified-episode throughput.

    Source: §1 · pp. 2–3
  • Takeaways & Limitations

    Verified rollouts can be reused as policy supervision: a π0.5 policy fine-tuned on 200 agent-generated rollouts reaches 100% and 70% real-robot success on two tasks without human demonstrations.

    Source: §1 · p. 3, §3.4 · p. 6

    The twin covers rigid objects with pre-generated assets, fixed bases, and static scenes; coordination is centralized, execution is open-loop replay, and evaluation is modest in scale.

    Source: §5 · pp. 9–10

Abstract

from arXiv · show

General-purpose coding agents can now write, debug, and refine entire robot programs, but only if they have somewhere to practice. Physical hardware is a poor practice ground: exploratory rollouts are slow to reset and, when several arms share a workspace, unsafe. Generic simulation benchmarks are safe but do not match the geometry, assets, or viewpoints of the workspace where the robot must actually work. We present CoEx (Code-driven Exploration), which lets the agent practice in an executable digital twin of its own deployment workspace. The twin is built by CoEnv, our real-to-sim framework, which reconstructs the physical scene from multi-view RGBD into a physics simulation. Inside it, a centralized code agent explores at the program level, writing a complete multi-arm program, running it in the twin, and refining it against grounded verification (privileged state checks, checkpoint predicates on risky steps, and adaptive viewpoints against inter-arm occlusion). Verified programs transfer to hardware through collision-checked deployment. On five real-world multi-arm tasks with up to three heterogeneous robots, CoEx reaches 70% average success, against 50% for the same system without the code agent (where a VLM must choose every primitive step by step), outperforms two prior VLM-planning frameworks, and produces verified episodes at 3.8-11.7x the ablated rate. Because every verified rollout is also a demonstration, exploration leaves reusable experience behind: a $\pi_{0.5}$ policy fine-tuned purely on 200 agent-generated rollouts reaches 100% and 70% real-robot success on two tasks, with no human demonstrations.

1 INTRODUCTION

CoEx addresses the need for safe, deployment-matched practice by letting a code agent explore complete multi-arm programs in a reconstructed digital twin. Across five real-world tasks, it outperforms the same system without a code agent and leaves verified rollouts that can train policies.

1 INTRODUCTION

  • Hardware practice risks collisions, slow resets, and inter-arm occlusion, while generic benchmarks lack the deployment workspace’s geometry, assets, and camera views.Existing simulation approaches also depend on human demonstrations or rewards, leaving a sim-to-real gap to bridge.Source: §1 · pp. 1–2
  • CoEnv reconstructs the deployment scene into a physics twin where a centralized code agent writes, runs, and refines complete multi-arm programs against grounded verification.The twin provides privileged state, arbitrary viewpoints, and tools for occlusion and risky preconditions; deployment is collision-checked.Source: §1 · p. 2
  • 70% average real-world success versus 50% without the code agent, with 3.8×–11.7× the ablated system’s verified-episode throughput across five tasks.CoEx is also ahead of two prior VLM-planning frameworks.Source: §1 · pp. 2–3
  • A π0.5 policy fine-tuned on 200 CoEx rollouts reaches 100% and 70% real-robot success on two tasks, without human demonstrations.The 200 rollouts are agent-generated.Source: §1 · p. 3
  • Unlike simulation pipelines that generate training data, CoEx searches for a program; verified programs run on the real robot, yielding real demonstrations without a sim-to-real gap.The contribution also includes experience reuse: verified rollouts persist as exemplars and policy supervision.Source: §1 · pp. 2–3, Figure 1 · p. 2

2 RELATED WORK

Prior work uses coding agents for robot planning and simulation for training data, but CoEx practices in a twin of the deployment workspace. Its verified task-solving rollouts also serve as demonstrations.

2 RELATED WORK

  • CoEx practices in a twin of the actual deployment workspace, with verification for multi-arm occlusion and contact, rather than benchmark scenes.Its planner is deliberately centralized; multi-arm manipulation is a testbed, not a claim of decentralized autonomy.Source: §2 · p. 3, Figure 2 · p. 4
  • Prior simulation pipelines multiply demonstrations, co-train simulated and real data, or learn in reconstructed scenes; these place simulation upstream of data and retain a sim-to-real gap.The simulated behavior still originates from human demonstrations or a reward.Source: §2 · p. 3
  • Unlike learned world models, CoEx’s reconstructed physics twin exposes ground-truth poses, contacts, and swept volumes for checking outcomes and diagnosing failures.The related-work passage contrasts learned predictors (Hafner et al., 2023; Bruce et al., 2024; Yang et al., 2024) with workspace-aligned physics simulators.Source: §2 · p. 3
  • CoEx’s verified rollouts are a by-product of solving tasks and themselves function as demonstrations, unlike approaches that generate robot data as a primary goal.Prior approaches include synthesizing tasks and scenes, designing rewards, fleet collection, and distilling LLM-guided rollouts.Source: §2 · p. 4

3 METHOD

CoEnv couples a reconstructed, queryable digital twin with program-level exploration, collision-checked hardware deployment, and reusable verified experience. CoEx writes and refines complete multi-arm programs in the twin using privileged state, rendered views, and verification feedback.

3 METHOD

  • CoEnv couples a reconstructed digital twin with code-driven exploration, collision-checked deployment, and verified rollouts that persist as reusable experience.The twin is defined by a structured state space, physics transition function, and rendering over arbitrary camera poses.Source: §3 · p. 4

3.1 DIGITAL TWIN CONSTRUCTION FROM REAL SCENES

  • Multi-view RGBD is converted into a simulator-ready scene through generated meshes, object segmentation and disambiguation, fused 6-DoF poses, and iterative camera calibration.The scene is implemented in ManiSkill on SAPIEN and aligned to the workcell through render-and-compare camera refinement.Source: §3.1 · p. 4

3.2 CODE-DRIVEN EXPLORATION WITH GROUNDED VERIFICATION

  • CoEx generates a complete multi-arm program, runs it in the twin, and uses outcome evaluation and structured failure feedback to refine later programs.Free resets, privileged state, rendered views, and checkpoint predicates support trial-and-error; verified programs can be rerun from new initial states to generate further rollouts.Source: §3.2 · p. 5, §3.1 · p. 5, Figure 3 · p. 5
  • Program-level exploration commits to a whole multi-arm execution, amortizes deliberation across the task, and leaves source code that can be retrieved or rerun.Step-level deliberation instead repeats model calls at each step, and its reasoning does not persist after the episode.Source: §3.2 · p. 6
  • Adaptive camera views expose regions occluded by arms, while checkpoint predicates evaluate critical junctures using state and multi-view snapshots.The ablated baseline retains the twin, primitives, and tools but has a VLM choose each primitive step by step, leaving no reusable artifact.Source: §3.2 · p. 6

3.3 COLLISION-AWARE REAL-WORLD DEPLOYMENT

  • Simulated joint configurations are densified by linear interpolation, then admitted for execution only when the swept collision volumes of every arm pair do not intersect.Otherwise, the action is discarded and replanning starts from the current state.Source: §3.3 · p. 6

3.4 REUSING VERIFIED EXPERIENCE

  • Verified episodes are stored as exemplars and can also be unrolled into camera-image and proprioception/action pairs for behavior-cloning policy fine-tuning.Unlike the agent, the resulting visuomotor policy acts from raw observations alone and replaces per-episode deliberation with a forward pass.Source: §3.4 · p. 6

4 EXPERIMENTS

The experiments test real-world multi-arm performance, comparisons with prior planning frameworks, exploration reliability, and reuse of verified experience. Across these questions, evaluations cover five tasks in two workcells, with 10 trials per agent per task.

4.2 REAL-WORLD MULTI-ARM EVALUATION (Q1)

  • CoEx achieves 70% average task success versus 50% without the code agent, leading on all five tasks and reaching 90% on Cube Stacking.CoEx finishes 35 of 40 trials that pass S1 (88%), compared with 25 of 44 (57%) for the step-wise baseline; no arm–arm collision occurs in 100 deployed trajectories.Source: Table 1 · p. 7, §4.2 · p. 7

4.1 SETUP

  • The evaluation covers five tasks across two workcell configurations, using 10 trials per agent per task and reporting milestone and task-success rates.The tasks span two-arm and three-arm setups with heterogeneous embodiments; the code-agent-free baseline differs in both backbone model and loop structure.Source: §4.1 · p. 7, Table 1 · p. 7

4.3 COMPARISON WITH PRIOR AGENTIC PLANNING FRAMEWORKS (Q2)

  • Across three representative tasks, CoEx reaches 77% success versus 57% without the code agent and 20% and 40% for the two prior frameworks.On Cylinder handover, CoEx completes 6/10 while the prior frameworks complete 1/10 and 0/10.Source: §4.3 · pp. 7–8, Figure 5 · p. 8

4.4 WHAT MAKES EXPLORATION RELIABLE, AND WHERE IT FAILS (Q3)

  • Removing adaptive camera control reduces average success from 50% to 30%, while removing checkpoint verification reduces it from 50% to 20%.Camera-control losses concentrate on occlusion-heavy tasks; checkpoint removal lets early errors compound through long horizons.Source: §4.4 · p. 8, Figure 5 · p. 8
  • Failures include residual sim-to-real pose offsets at grasp or placement, stalled replanning, and agent limitations on long sequences or anticipated handovers.Suggested remedies are contact residual correction and a hybrid that uses step-wise control for reactive substeps while retaining program-level control elsewhere.Source: §4.4 · p. 8

4.5 REUSING VERIFIED EXPERIENCE (Q4)

  • CoEx generates 17.5 verified episodes per session on Cube Stacking and 9.5 on Brush Box, respectively 11.7× and 3.8× the code-agent-free baseline.The comparison is 1.5 episodes on Cube Stacking and 2.5 on Brush Box for the baseline; a verified program amortizes reasoning across rollouts.Source: §4.5 · pp. 8–9, Table 2 · p. 9
  • A π0.5 policy fine-tuned on 200 real-robot CoEx rollouts reaches 10/10 and 7/10 success on the two tasks, while twin-recorded co-training reaches 3/10 and 0/10.The study reuses a verified program across reset configurations; scene resets were manual.Source: Table 2 · p. 9, §4.5 · p. 9, Figure 6 · p. 9

5 CONCLUSION AND LIMITATIONS

CoEx pairs an executable workspace twin with grounded verification and collision-checked hardware deployment, and its verified rollouts can support policy fine-tuning. The paper limits its claims to a modest, centralized tabletop evaluation and documents reproducibility, safety, and AI use.

5 CONCLUSION AND LIMITATIONS

  • The twin covers rigid objects with pre-generated assets, fixed bases, and static scenes; coordination is centralized, with no claim about decentralized autonomy or scaling beyond three arms.Real-world execution is open-loop replay, residual pose offsets remain a main source of failure, and the evaluation is modest in scale.Source: §5 · pp. 9–10

REPRODUCIBILITY STATEMENT

  • The authors will release code, including the twin-construction pipeline, agent interface, and prompts, and document proprietary foundation-model versions used in the experiments.Agents rely on GPT-5.6 Sol and Claude Code, whose behavior may change across versions.Source: REPRODUCIBILITY STATEMENT · p. 10

ETHICS STATEMENT

  • Real-robot experiments were conducted under human supervision with workspace barriers and emergency stops; the authors say these safeguards reduce but do not remove risk.The system first executes and verifies programs in a digital twin, then admits trajectories to hardware after a swept-volume collision check.Source: ETHICS STATEMENT · p. 10

AI USE STATEMENT

  • GPT-5.6 Sol and Claude Code are method components, while an LLM assistant also supported manuscript preparation, literature retrieval, number checks, and plotting.The authors state that they developed the research ideas, system, experiments, and analysis, and reviewed and revised AI-assisted text.Source: AI USE STATEMENT · p. 10

A POSITIONING WITH RESPECT TO PRIOR DATA PIPELINES

Prior sim-assisted pipelines rely on demonstrations or rewards to specify behavior, whereas CoEx supplies behavior itself. This makes the task description the human input and avoids using the simulator to produce training images.

A POSITIONING WITH RESPECT TO PRIOR DATA PIPELINES

  • CoEx supplies its own behavior, reducing human input to a task description, while prior pipelines require demonstrations or a reward.The comparison concerns where the simulator sits in sim-assisted manipulation data pipelines and what data the deployed policy trains on.Source: A POSITIONING WITH RESPECT TO PRIOR… · p. 15, Table 3 · p. 15
  • The simulator is not asked to produce a training image in CoEx.The distinction follows from CoEx generating behavior itself rather than replaying or optimizing behavior specified elsewhere.Source: A POSITIONING WITH RESPECT TO PRIOR… · p. 15
  • Table 3 compares pipelines including MimicGen, DexMimicGen, ComSim, sim-and-real co-training, RialTo, ACDC, and HATS.Its caption identifies the comparison as concerning the data on which the deployed policy is fitted.Source: Table 3 · p. 15

B TASK DESCRIPTIONS

The evaluation covers five tasks involving two to three robotic arms. Task success is defined by completing the final milestone after satisfying milestones in order.

B TASK DESCRIPTIONS

  • Five evaluation tasks are summarized in Table 4, and each involves two to three robotic arms.Table 5 lists the ordered subtask milestones and success criteria.Source: B TASK DESCRIPTIONS · p. 15, Table 4 · p. 15
  • Milestones must be satisfied in order, and a task succeeds only when its final milestone is achieved.The final milestone of each task defines its overall success condition.Source: B TASK DESCRIPTIONS · p. 15
  • Figure 7 shows keyframes from successful real-world executions of all five tasks.The figure caption describes the tasks as two-arm and three-arm settings.Source: B TASK DESCRIPTIONS · p. 15

C IMPLEMENTATION DETAILS

The implementation builds a workspace twin and exposes common robot-control and perception tools to both agents. CoEx refines complete programs in simulation, while the step-wise baseline chooses primitives iteratively; the reported real-robot comparison favors CoEx on all five tasks.

C IMPLEMENTATION DETAILS

  • The task-suite figure shows five tasks: three two-arm Franka tasks and two three-arm Franka–AgileX Piper tasks.The keyframes depict successful real-world executions; the last milestone in each task defines overall success.Source: Figure 7 · p. 16, Table 5 · p. 16

C.1 DIGITAL TWIN CONSTRUCTION

  • Twin construction generates simulation-ready object meshes from reference images, localizes and fuses multi-view poses, then iteratively calibrates camera extrinsics until reprojection error stabilizes at the millimeter range.The pose pipeline uses segmentation and VLM disambiguation, then averages translations and rotations across detecting views.Source: §C.1 · pp. 16–17

C.2 HARDWARE AND ROBOT CONTROL

  • The setup uses Franka Research 3 and AgileX Piper arms with fixed-position synchronized RGBD cameras; motion waypoints are interpolated for smooth execution.Franka uses Deoxys interpolation, while the Piper setup implements linear interpolation between consecutive waypoints.Source: §C.2 · p. 17

C.3.1 SHARED INFRASTRUCTURE.

  • A shared ManiSkill-based layer provides four end-effector-relative primitives, state queries, robot-specific IK dispatch, and virtual views from arbitrary viewpoints.The primitives are MOVE, ROTATE, GRASP, and RELEASE; arm indices can specify synchronized multi-arm execution.Source: §C.3.1 · p. 17

C.3.2 COEX W/O CODE AGENT: STEP-WISE VLM BASELINE.

  • The baseline uses a VLM for a multi-round planning phase, then an observe–act–verify loop with checkpoint checks, corrective actions, and robustness aids.It can request camera viewpoints during planning and uses stuck-pattern detection, drift correction, and idle-arm stabilization during execution.Source: C IMPLEMENTATION DETAILS · p. 15, §C.3.2 · pp. 17–18

C.3.3 COEX: CODE-DRIVEN EXPLORATION.

  • CoEx generates a complete Python program for the multi-arm task and iteratively refines it from execution logs and checkpoint images after resetting the simulation.The sandbox enforces a restricted namespace and timeout; refinement runs for up to 10 iterations.Source: §C.3.3 · p. 18

C.3.4 COMPARISON OF THE TWO AGENTS.

  • CoEx is ahead of the step-wise baseline on all five real-robot tasks.The comparison identifies cost, reusability, and retaining success across milestones as the clearest design differences.Source: §C.3.4 · p. 18

C.4 PER-TASK COUNTS BEHIND FIG. 5

The section reports where per-task counts and tool-ablation milestones are presented, then describes how verified robot episodes are collected for the experience-reuse study.

C.4 PER-TASK COUNTS BEHIND FIG. 5

  • Tables 7 and 8 give per-task success counts, with Table 8 also covering tool-ablation subtask milestones plotted in Fig. 5.Table 7 compares prior VLM-planning frameworks and CoEx without the code agent on three representative tasks; Table 8 removes adaptive camera control or checkpoint verification.Source: §C.4 · p. 18, Table 7 · p. 19, Table 8 · p. 19

D EXPERIENCE REUSE: DISTILLATION STUDY DETAILS

D.1 DEMONSTRATION COLLECTION PROTOCOL

  • For Cube Stacking and Brush Box, CoEx collected 200 real-robot episodes per task, retaining only completed episodes and manually resetting hand-chosen initial configurations.Each episode records three RGB streams and all-arm joint positions; actions are joint-angle targets.Source: §D.1 · p. 19

D.2 POLICY FINE-TUNING AND EVALUATION

The study fine-tunes π0.5 on task-specific datasets and evaluates each policy on the real robot; the framework also retains experience as operational hints, with representative failures shown in Fig. 8.

D.2 POLICY FINE-TUNING AND EVALUATION

  • π0.5 is fine-tuned separately per task and dataset for 30k steps, then evaluated in 10 real-robot trials per task.Datasets comprise 20 teleoperated, 50 CoEx, or 200 CoEx episodes; policies use the recorded camera views and joint positions and output joint-angle targets.Source: §D.2 · p. 19

D.3 EXPERIENCE STORAGE AND REUSE

  • Instead of storing raw programs, the agent records verified strategies, grasp parameters, and failure causes as prompt hints for later runs.The experience-storage mechanism is not ablated separately.Source: §D.3 · p. 19
  • Figure 8 depicts four failures: cube slippage from placement offset, a dropped cylinder at handover, an unstable lid grasp, and a dropped brush during movement.Source: Figure 8 · p. 20

E FAILURE ANALYSIS

The failure analysis identifies recurring execution and planning problems, detailing positional discrepancies and planning-loop stagnation as two distinct failure modes.

E FAILURE ANALYSIS

  • The analysis groups the observed real-robot failures into three recurring modes and pairs them with qualitative mitigations.Source: E FAILURE ANALYSIS · p. 20

E.1 SIM-TO-REAL POSITIONAL DISCREPANCY

  • Residual sim-to-real positional error affects all five tasks, with millimeter-scale offsets causing contact failures in placement, bimanual pickup, and narrow-opening insertion.The authors suggest contact-time residual correction or camera-extrinsic recalibration from fiducials between trials.Source: §E.1 · p. 20

E.2 PLANNING LOOP STAGNATION

  • Planning can stagnate in both systems: the step-wise agent repeats minor grasp changes, while CoEx can make small parameter edits until its iteration budget is exhausted.The authors suggest diversity-promoting prompts or explicit failure memory as remedies.Source: §E.2 · p. 20

E.3 AGENT-SPECIFIC LIMITATIONS

This section describes the agents’ prompts and program-level control workflows, including how they plan, execute, diagnose, and revise actions. It identifies limitations such as drift in long step-wise sequences and programs that may not adapt to another arm’s actual endpoint.

E.3 AGENT-SPECIFIC LIMITATIONS

  • Long step-wise sequences accumulate controller tracking error, while CoEx can struggle when one arm’s motion depends on another’s actual endpoint; a hybrid approach could delegate reactive substeps to step-wise control.In Brush Box, drift can leave the brush several millimeters from the surface by the third or fourth stroke; Transfer Cylinder handover requires anticipating the other arm’s pose.Source: §E.3 · p. 20

F PROMPT DESIGN

  • The prompt-design section covers both agents, with separate prompts for the step-wise baseline and a single comprehensive prompt for code-driven exploration.The baseline uses a multi-round planning prompt and a closed-loop execution prompt; CoEx’s prompt directs the agent to write and iteratively refine Python control code.Source: F PROMPT DESIGN · p. 21, §F.2 · p. 21, §F.3 · p. 24

F.1 SHARED DOMAIN KNOWLEDGE

  • Both agents receive generic robot specifications and physics constraints, but no task-specific solutions or pre-computed trajectories.The model must reason about object geometry, grasp strategies, and multi-arm coordination from observations.Source: §F.1 · p. 21

F.2 COEX W/O CODE AGENT BASELINE: VLM PROMPTS

  • The step-wise baseline separates multi-round scene analysis from closed-loop action generation, using multimodal text-and-image inputs in both phases.The planning prompt creates a high-level strategy; the execution prompt observes the current scene and calculates movements.Source: §F.2 · p. 21, §F.2.2 · p. 23

F.2.1 PLANNING PHASE PROMPT.

  • The planning prompt requires multiple camera views and per-object grasp analysis, then outputs key observations, checkpoints, and a multi-arm execution plan.It calls for at least two views, analysis of shape and graspable width, and checkpoint criteria such as position and orientation tolerances.Source: §F.2.1 · pp. 22–23

F.2.2 EXECUTION PHASE PROMPT.

  • The execution prompt directs the baseline to recompute movements from current state and verify grasp position, orientation, and visual alignment before grasping.It warns that planning-phase deltas may be stale and instructs the agent not to rotate when orientation is already within 0.1 rad.Source: §F.2.2 · pp. 23–24

F.3 COEX: CODE AGENT PROMPT

  • The CoEx prompt specifies robot and object information, workspace limits, diagnostics, state-query and action APIs, and rules to read current state and checkpoint critical moments.It warns that unreachable moves may silently stop at the closest reachable point and recommends comparing target with actual position; checking object height after lift helps detect missed grasps.Source: §F.3 · pp. 24–25
  • The agent records per-object grasp strategies, multi-arm action sequences, and collision risks in a plan before coding.Optional exploration scripts do not count as rounds.Source: §F.3 · p. 26
  • Programs run to completion in one shot without real-time visual feedback; checkpoints capture images for post-run review only.The output includes execution logs, final states, initial views, and checkpoint images and states.Source: §F.3 · p. 26
  • Each round, the agent checks execution logs, final states, and key checkpoint images to identify root causes rather than symptoms.It then fixes the code and reruns, with the environment resetting each time.Source: §F.3 · p. 26
  • The workflow ends with a final report saved to the workspace.Source: §F.3 · p. 26
Loading 2604.05484v2…