🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content
compass-fieldPublic

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

COMPASS: Bridging Agentic Reasoning and Dexterous Policies via Compiled Task Fields

Xiaoshen Han1,2, Jiahang Cao1,2, Xinghang Li2, Tao Kong2, Hang Lai2†, Weinan Zhang1†

1Shanghai Jiao Tong University    2Xiaomi Robotics    (†Corresponding authors)

Project Page | Paper (PDF) | arXiv | Video (YouTube) | Colab 3D Demo

This repository contains the official implementation of COMPASS (COMpiled Potentials for Action Selection and Steering).

COMPASS separates task reasoning from motor control. Before execution, a VLM agent compiles the instruction and the initial head-camera scene once into a stateful 3D task field over the policy's action space. At run time, the field tests every action chunk proposed by a frozen visuomotor policy on CPU: admissible chunks are executed, deviations are corrected by bounded gradient descent with detours out of local minima, and contact-rich manipulation is left to the policy inside each target's policy workspace $W_k$. The control loop makes zero VLM queries.


Installation

The core library depends only on numpy and scipy, runs on CPU and needs no GPU or robot hardware (Python 3.10 or newer). The commands below create an environment with uv, install the package and run the unit tests. With plain pip, replace the first two lines with python -m venv .venv && .venv/bin/pip install -e ".[dev]".

uv venv
uv pip install -e ".[dev]"
.venv/bin/pytest

Quick Start

Interactive 3D Demo (Google Colab)

Open In Colab

notebooks/compass_demo.ipynb runs on a free Colab CPU runtime. It renders the 3D task field (the potential $V_z$, the $C^2$ non-target bumps $\Phi_z$ and the policy workspace $W_k$), steps through the field's decision on each FakeReplayPolicy chunk (kept, corrected or detoured), and plots the control-sharing timeline of the four real-world tasks.

Closed-Loop Execution (compass.run)

compass.run executes a task end to end in the offline closed-loop runtime (CompassRunner with OfflineMockEnv and OfflineMockPolicy). It runs either one of the four real-world tasks (--demo-task) or a compiled field bundle, compiled_field.json, in the format the task skills under skills/ produce. The last two commands below write such a bundle with the Pack Box reference builder and run it:

.venv/bin/python -m compass.run --demo-task pack_box
.venv/bin/python -m compass.run --demo-task pack_earphone
# Write a compiled_field.json with the Pack Box reference builder (the format a task skill produces), then run it:
.venv/bin/python - <<'EOF'
import json
from mem.pack_box_ref import build_pack_box_spec

spec = build_pack_box_spec(
    ordered_objects=[{"id": "toothbrush", "center": [0.16, -0.10, 0.08], "half_extents": [0.02, 0.05, 0.02]}],
    box={"center": [-0.18, 0.0, 0.08], "half_extents": [0.08, 0.08, 0.05]},
    fixed_prompt="Put the toothbrush in the box.",
)
with open("compiled_field.json", "w") as f:
    json.dump(spec, f, indent=2)
EOF
.venv/bin/python -m compass.run --field-spec compiled_field.json --backend offline

Offline Rollout Replay (FakeReplayPolicy)

tests/fixtures/count_fruit_rollout.json is a synthetic offline rollout. compass.replay replays it through the field without hardware, exercising the chunk test and the bounded correction (Eq. 3 and 4), detours, and the quota updates of the stage ledger (TaskLedger):

.venv/bin/python -m compass.replay
# nearest-state lookup:
.venv/bin/python -m compass.replay --mode nearest_state

The same replay from Python:

from pathlib import Path
from compass.replay import FakeReplayPolicy, OfflineRollout, ReplayFieldRunner

rollout = OfflineRollout.load(Path("tests/fixtures/count_fruit_rollout.json"))
fake_policy = FakeReplayPolicy(rollout, mode="sequential")  # or mode="nearest_state"
runner = ReplayFieldRunner(rollout, policy=fake_policy)

results, ledger = runner.run_all()
n_policy = sum(1 for r in results if r.mode == "policy")
n_field = sum(1 for r in results if r.mode == "field")
print(f"Replayed {len(results)} chunks: {n_policy} kept (policy), {n_field} corrected (field)")

Repository Structure

compass/    # Task fields, chunk arbitration, detours, calibration, perception, transitions, and replay
skills/     # Skill documents: meta skill, real-world task skills (real/), simulation task skills (sim/)
mem/        # Task-judgment notes and reference field builders consulted during compilation
notebooks/  # Interactive 3D Plotly / Google Colab demo (FakeReplayPolicy vs. field guidance)
tests/      # Unit tests and a synthetic offline rollout fixture
sim/        # Simulation benchmark interfaces (RoboMME): single-arm task field runtime, runners, per-layout compile step

What Is Included

  • Included: the hardware-free runtime in compass/ (task fields, chunk arbitration, stage ledger, transition predicates, calibration and perception utilities, the offline and dry-run backends of compass.run, and replay); reference field builders (mem/) and skills (skills/real/) for the four real-world tasks; the RoboMME simulation integration with sixteen task fields (sim/robomme/tasks/) and their skills (skills/sim/robomme/); notebooks and tests.
  • Not included: robot and camera drivers or any hardware backend for compass.run, and policy checkpoints. The RoboMME $\pi_{0.5}$ checkpoint comes from the benchmark's release (see sim/robomme/README.md).

Real-World Tasks

The paper evaluates COMPASS on four real-world tasks. Each task has a skill under skills/real/ that compiles its task field; the table lists the capability the task tests and the frozen base policy it runs with.

Paper Task Skill Core Capability Base Policy
Pack box skills/real/pack_box Ordered instruction following & fixed-prompt field control $\pi_{0.5}$
Pack earphone skills/real/pack_earphone Disambiguating visually similar distractor earbuds XR1
Count fruit skills/real/count_fruit Long-horizon category quota memory in an opaque bag $\pi_{0.5}$
Puzzle skills/real/puzzle Spatial planning, mating orientation & distractor avoidance XR1

Simulation Benchmarks

sim/ applies the same compiled task fields to open simulation benchmarks. The first is RoboMME, run with a frozen $\pi_{0.5}$ policy.

The table lists held-out success on RoboMME over sixteen tasks, counted out of 38 held-out episodes per task (episodes 12-49 of each task; 608 in total), with 1300 steps per episode, the $\pi_{0.5}$ policy and the compile model gpt-6.1-sol.

Method Success (of 608) Rate
Base policy 108 17.8%
COMPASS-language 139 22.9%
COMPASS-waypoint 307 50.5%
COMPASS (fixed $W_k$) 519 85.4%
COMPASS (adaptive $W_k$) 548 90.1%

Per-task results are in sim/robomme/README.md.


Applying COMPASS to a New Task

The meta skill skills/meta takes the paper and a new task, on a real robot or in a simulation benchmark, to the task's fine skill. On a new robot or benchmark, it first builds the shared layers (embodiment and calibration, field library, ground rules) that every task of that environment starts from. The three levels of skills are described in skills/README.md.


Citation

If you find this work useful, please cite:

@article{han2026compass,
  title   = {{COMPASS}: Bridging Agentic Reasoning and Dexterous Policies via Compiled Task Fields},
  author  = {Han, Xiaoshen and Cao, Jiahang and Li, Xinghang and Kong, Tao and Lai, Hang and Zhang, Weinan},
  journal = {arXiv preprint arXiv:2611.37941},
  year    = {2026}
}

License

Released under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages