# umersiddique94/reground architecture

> Architecture diagram of the GitHub repository umersiddique94/reground, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/umersiddique94/reground
- Repository: https://github.com/umersiddique94/reground

## Overview

ReGround is an inference-time robotics method for adapting frozen vision-language-action policies to changed robot actuation. The main workflow is task-agnostic babbling and policy-driven transition collection, fitting deployed-body dynamics, then evaluating the frozen policy with ReGround and summarizing results. Runtime components also cover LIBERO simulation and shifts, VLA inference, residual-based shift monitoring, and control. Edges are limited to README workflow statements and relationships visible in excerpts or the source index; several implementation details are unsampled.

Main entry points: [`reground/method/build.py`](https://github.com/umersiddique94/reground/blob/main/reground/method/build.py) (Method builder), [`reground/envs/libero_env.py`](https://github.com/umersiddique94/reground/blob/main/reground/envs/libero_env.py) (LIBERO task environment), [`main.py`](https://github.com/umersiddique94/reground/blob/main/main.py) (Experiment CLI), [`reground/method/mpc.py`](https://github.com/umersiddique94/reground/blob/main/reground/method/mpc.py) (ReGround MPC)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Experiment workflow"]
  node_cli["Experiment CLI<br/>[main.py]"]
  node_babble["Motor babbling<br/>[babble.py]"]
  node_jobs["Collection and eval jobs<br/>[jobs.py]"]
  node_rollout["Episode rollout<br/>[rollout.py]"]
  node_stats["Result summaries<br/>[stats.py]"]
end

subgraph group_environment["Robot environment"]
  node_env["LIBERO task environment<br/>[libero_env.py]"]
  node_shifts["Actuation shifts<br/>[shifts.py]"]
  node_safety["Safety constraints<br/>[safety.py]"]
end

subgraph group_models["Dynamics models"]
  node_cache["Model cache and fitting<br/>[cache.py]"]
  node_dynamics["Dynamics ensemble<br/>[dynamics.py]"]
  node_features["State features<br/>[features.py]"]
  node_idm["Inverse dynamics model<br/>[idm.py]"]
end

subgraph group_control["Policy and control"]
  node_vla["Frozen VLA adapter<br/>[vla.py]"]
  node_builder["Method builder<br/>[build.py]"]
  node_controller["Controller API<br/>[controller.py]"]
  node_mpc["ReGround MPC<br/>[mpc.py]"]
  node_monitor["Shift monitor and gate<br/>[monitor.py]"]
  node_reference["Motion reference<br/>[reference.py]"]
  node_delay["Delay compensation<br/>[delay.py]"]
  node_anchors["Control anchors<br/>[anchors.py]"]
end

node_engineer(("Experimenter"))
node_simulation["LIBERO simulator"]
node_policy_service["Pretrained policy weights"]

node_engineer -->|"selects stage"| node_cli
node_cli -->|"starts babbling"| node_babble
node_cli -->|"starts collection or evaluation"| node_jobs
node_cli -->|"requests summary"| node_stats
node_babble -->|"creates task environment"| node_env
node_jobs -->|"runs batches"| node_rollout
node_rollout -->|"queries policy"| node_vla
node_rollout -->|"steps environment"| node_env
node_jobs -->|"builds controller"| node_builder
node_env -->|"applies shift"| node_shifts
node_env -->|"uses safety checks"| node_safety
node_env -->|"wraps"| node_simulation
node_vla -->|"loads weights"| node_policy_service
node_builder -->|"loads or fits models"| node_cache
node_builder -->|"constructs base controller"| node_controller
node_builder -->|"constructs ReGround"| node_mpc
node_builder -->|"wraps gated controller"| node_monitor
node_builder -->|"fits optional anchor"| node_anchors
node_builder -->|"uses delay compensation"| node_delay
node_controller -->|"uses no-op action"| node_dynamics
node_mpc -->|"uses state features"| node_features
node_mpc -->|"extends controller"| node_controller
node_mpc -->|"uses reference"| node_reference
node_monitor -->|"scores model residuals"| node_dynamics
node_monitor -->|"computes state residuals"| node_features
node_monitor -->|"gates controller"| node_controller
node_cache -->|"loads or fits forward model"| node_dynamics
node_cache -->|"loads or fits inverse model"| node_idm
node_dynamics -->|"uses state features"| node_features

click node_cli "https://github.com/umersiddique94/reground/blob/main/main.py"
click node_babble "https://github.com/umersiddique94/reground/blob/main/reground/data/babble.py"
click node_jobs "https://github.com/umersiddique94/reground/blob/main/reground/eval/jobs.py"
click node_rollout "https://github.com/umersiddique94/reground/blob/main/reground/eval/rollout.py"
click node_stats "https://github.com/umersiddique94/reground/blob/main/reground/eval/stats.py"
click node_env "https://github.com/umersiddique94/reground/blob/main/reground/envs/libero_env.py"
click node_shifts "https://github.com/umersiddique94/reground/blob/main/reground/envs/shifts.py"
click node_safety "https://github.com/umersiddique94/reground/blob/main/reground/envs/safety.py"
click node_vla "https://github.com/umersiddique94/reground/blob/main/reground/policies/vla.py"
click node_builder "https://github.com/umersiddique94/reground/blob/main/reground/method/build.py"
click node_controller "https://github.com/umersiddique94/reground/blob/main/reground/method/controller.py"
click node_mpc "https://github.com/umersiddique94/reground/blob/main/reground/method/mpc.py"
click node_monitor "https://github.com/umersiddique94/reground/blob/main/reground/method/monitor.py"
click node_reference "https://github.com/umersiddique94/reground/blob/main/reground/method/reference.py"
click node_delay "https://github.com/umersiddique94/reground/blob/main/reground/method/delay.py"
click node_anchors "https://github.com/umersiddique94/reground/blob/main/reground/method/anchors.py"
click node_cache "https://github.com/umersiddique94/reground/blob/main/reground/models/cache.py"
click node_dynamics "https://github.com/umersiddique94/reground/blob/main/reground/models/dynamics.py"
click node_features "https://github.com/umersiddique94/reground/blob/main/reground/models/features.py"
click node_idm "https://github.com/umersiddique94/reground/blob/main/reground/models/idm.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_babble,node_jobs,node_rollout,node_stats toneBlue
class node_env,node_shifts,node_safety toneAmber
class node_cache,node_dynamics,node_features,node_idm toneMint
class node_vla,node_builder,node_controller,node_mpc,node_monitor,node_reference,node_delay,node_anchors toneRose
class node_engineer,node_simulation,node_policy_service toneIndigo
```

## Components

### Experiment workflow

- [Experiment CLI](https://github.com/umersiddique94/reground/blob/main/main.py): `main.py`
- [Motor babbling](https://github.com/umersiddique94/reground/blob/main/reground/data/babble.py): `reground/data/babble.py`
- [Collection and eval jobs](https://github.com/umersiddique94/reground/blob/main/reground/eval/jobs.py): `reground/eval/jobs.py`
- [Episode rollout](https://github.com/umersiddique94/reground/blob/main/reground/eval/rollout.py): `reground/eval/rollout.py`
- [Result summaries](https://github.com/umersiddique94/reground/blob/main/reground/eval/stats.py): `reground/eval/stats.py`

### Robot environment

- [LIBERO task environment](https://github.com/umersiddique94/reground/blob/main/reground/envs/libero_env.py): `reground/envs/libero_env.py`
- [Actuation shifts](https://github.com/umersiddique94/reground/blob/main/reground/envs/shifts.py): `reground/envs/shifts.py`
- [Safety constraints](https://github.com/umersiddique94/reground/blob/main/reground/envs/safety.py): `reground/envs/safety.py`

### Dynamics models

- [Model cache and fitting](https://github.com/umersiddique94/reground/blob/main/reground/models/cache.py): `reground/models/cache.py`
- [Dynamics ensemble](https://github.com/umersiddique94/reground/blob/main/reground/models/dynamics.py): `reground/models/dynamics.py`
- [State features](https://github.com/umersiddique94/reground/blob/main/reground/models/features.py): `reground/models/features.py`
- [Inverse dynamics model](https://github.com/umersiddique94/reground/blob/main/reground/models/idm.py): `reground/models/idm.py`

### Policy and control

- [Frozen VLA adapter](https://github.com/umersiddique94/reground/blob/main/reground/policies/vla.py): `reground/policies/vla.py`
- [Method builder](https://github.com/umersiddique94/reground/blob/main/reground/method/build.py): `reground/method/build.py`
- [Controller API](https://github.com/umersiddique94/reground/blob/main/reground/method/controller.py): `reground/method/controller.py`
- [ReGround MPC](https://github.com/umersiddique94/reground/blob/main/reground/method/mpc.py): `reground/method/mpc.py`
- [Shift monitor and gate](https://github.com/umersiddique94/reground/blob/main/reground/method/monitor.py): `reground/method/monitor.py`
- [Motion reference](https://github.com/umersiddique94/reground/blob/main/reground/method/reference.py): `reground/method/reference.py`
- [Delay compensation](https://github.com/umersiddique94/reground/blob/main/reground/method/delay.py): `reground/method/delay.py`
- [Control anchors](https://github.com/umersiddique94/reground/blob/main/reground/method/anchors.py): `reground/method/anchors.py`

### Other components

- **Experimenter**
- **LIBERO simulator**
- **Pretrained policy weights**

## Connections

- Experimenter → Experiment CLI: selects stage (evidence: `README.md`)
- Experiment CLI → Motor babbling: starts babbling (evidence: `README.md`)
- Experiment CLI → Collection and eval jobs: starts collection or evaluation (evidence: `README.md`)
- Experiment CLI → Result summaries: requests summary (evidence: `README.md`)
- Motor babbling → LIBERO task environment: creates task environment (evidence: `reground/data/babble.py`)
- Collection and eval jobs → Episode rollout: runs batches (evidence: `reground/eval/jobs.py`)
- Episode rollout → Frozen VLA adapter: queries policy (evidence: `reground/eval/rollout.py`)
- Episode rollout → LIBERO task environment: steps environment (evidence: `reground/eval/rollout.py`)
- Collection and eval jobs → Method builder: builds controller (evidence: `reground/eval/jobs.py`)
- LIBERO task environment → Actuation shifts: applies shift (evidence: `reground/envs/libero_env.py`)
- LIBERO task environment → Safety constraints: uses safety checks (evidence: `reground/envs/libero_env.py`)
- LIBERO task environment → LIBERO simulator: wraps (evidence: `reground/envs/libero_env.py`)
- Frozen VLA adapter → Pretrained policy weights: loads weights (evidence: `reground/policies/vla.py`)
- Method builder → Model cache and fitting: loads or fits models (evidence: `reground/method/build.py`)
- Method builder → Controller API: constructs base controller (evidence: `reground/method/build.py`)
- Method builder → ReGround MPC: constructs ReGround (evidence: `reground/method/build.py`)
- Method builder → Shift monitor and gate: wraps gated controller (evidence: `reground/method/build.py`)
- Method builder → Control anchors: fits optional anchor (evidence: `reground/method/build.py`)
- Method builder → Delay compensation: uses delay compensation (evidence: `reground/method/build.py`)
- Controller API → Dynamics ensemble: uses no-op action (evidence: `reground/method/controller.py`)
- ReGround MPC → State features: uses state features (evidence: `reground/method/mpc.py`)
- ReGround MPC → Controller API: extends controller (evidence: `reground/method/mpc.py`)
- ReGround MPC → Motion reference: uses reference (evidence: `reground/method/mpc.py`)
- Shift monitor and gate → Dynamics ensemble: scores model residuals (evidence: `reground/method/monitor.py`)
- Shift monitor and gate → State features: computes state residuals (evidence: `reground/method/monitor.py`)
- Shift monitor and gate → Controller API: gates controller (evidence: `reground/method/monitor.py`)
- Model cache and fitting → Dynamics ensemble: loads or fits forward model (evidence: `reground/models/cache.py`)
- Model cache and fitting → Inverse dynamics model: loads or fits inverse model (evidence: `reground/models/cache.py`)
- Dynamics ensemble → State features: uses state features (evidence: `reground/models/dynamics.py`)
