# keyuanrong/cr3-lerobot architecture

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

- Interactive diagram: https://gitdiagram.com/keyuanrong/cr3-lerobot
- Repository: https://github.com/keyuanrong/cr3-lerobot

## Overview

This repository extends LeRobot for Dobot CR3 manipulation research: operators demonstrate tasks, recordings are reviewed and segmented into training datasets, policies are trained and tested in simulation, then deployed to the real arm or evaluated by replay. The README documents these capabilities and workflow; sampled source excerpts are partial, so links between broader subsystems follow documented behavior rather than inferred module calls.

Main entry points: [`scripts/inference/run_remote_pi0_policy.py`](https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/inference/run_remote_pi0_policy.py) (Remote policy client), [`scripts/collection/record_drag_dataset.py`](https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/collection/record_drag_dataset.py) (Demonstration recorder), [`src/lerobot/datasets`](https://github.com/keyuanrong/cr3-lerobot/tree/main/src/lerobot/datasets) (LeRobot datasets), [`scripts/inference/pi0_remote_policy_server.py`](https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/inference/pi0_remote_policy_server.py) (Remote Pi0 server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Robot data capture"]
  node_teleop["Leader-follower control"]
  node_cameras["Camera drivers"]
  node_recorder["Demonstration recorder"]
  node_raw[("Raw episodes")]
end

subgraph group_data["Dataset preparation"]
  node_curation["Review and segmentation"]
  node_converter["LeRobot conversion"]
  node_manifests["Dataset manifests"]
  node_dataset[("LeRobot datasets")]
  node_sampler["Mixed sampling"]
end

subgraph group_learning["Policy learning"]
  node_trainer["Policy training<br/>[lerobot_train.py]"]
  node_policies["Policy models"]
  node_checkpoint["Policy checkpoint"]
end

subgraph group_runtime["Execution and evaluation"]
  node_client["Remote policy client"]
  node_server["Remote Pi0 server"]
  node_cr3["Dobot CR3 and gripper"]
  node_replay["Replay evaluation"]
  node_results["Evaluation results"]
end

subgraph group_simulation["MuJoCo simulation"]
  node_mujoco["CR3 MuJoCo tools"]
  node_simresult["Simulation rollouts"]
end

node_operator(("Operator"))

node_operator -->|"operates"| node_teleop
node_operator -->|"demonstrates"| node_recorder
node_teleop -->|"provides control"| node_recorder
node_cameras -->|"provides images"| node_recorder
node_recorder -->|"records episodes"| node_raw
node_raw -->|"reviews and segments"| node_curation
node_raw -->|"converts"| node_converter
node_curation -->|"builds selections"| node_manifests
node_converter -->|"writes dataset"| node_dataset
node_manifests -->|"organizes sources"| node_dataset
node_dataset -->|"provides samples"| node_sampler
node_sampler -->|"feeds training"| node_trainer
node_trainer -->|"trains"| node_policies
node_policies -->|"saves weights"| node_checkpoint
node_checkpoint -->|"loads model"| node_server
node_checkpoint -.->|"loads policy"| node_mujoco
node_mujoco -->|"produces rollouts"| node_simresult
node_client -->|"sends observations"| node_server
node_server -->|"returns actions"| node_client
node_client -->|"commands arm"| node_cr3
node_cr3 -->|"provides state"| node_client
node_client -.->|"supports replay"| node_replay
node_replay -->|"records evaluation"| node_results
node_simresult -.->|"informs evaluation"| node_results

click node_teleop "https://github.com/keyuanrong/cr3-lerobot/blob/main/src/lerobot/robots/dobot_cr3/leader_follower_copy.py"
click node_cameras "https://github.com/keyuanrong/cr3-lerobot/tree/main/src/lerobot/cameras"
click node_recorder "https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/collection/record_drag_dataset.py"
click node_curation "https://github.com/keyuanrong/cr3-lerobot/tree/main/scripts/data_processing"
click node_converter "https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/datasets/convert_drag_to_lerobot.py"
click node_manifests "https://github.com/keyuanrong/cr3-lerobot/tree/main/scripts/datasets"
click node_dataset "https://github.com/keyuanrong/cr3-lerobot/tree/main/src/lerobot/datasets"
click node_sampler "https://github.com/keyuanrong/cr3-lerobot/blob/main/src/lerobot/datasets/weighted_mixture.py"
click node_trainer "https://github.com/keyuanrong/cr3-lerobot/blob/main/src/lerobot/scripts/lerobot_train.py"
click node_policies "https://github.com/keyuanrong/cr3-lerobot/tree/main/src/lerobot/policies"
click node_mujoco "https://github.com/keyuanrong/cr3-lerobot/tree/main/sim/cr3_mujoco"
click node_simresult "https://github.com/keyuanrong/cr3-lerobot/blob/main/sim/cr3_mujoco/rollout_smolvla_in_mujoco.py"
click node_client "https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/inference/run_remote_pi0_policy.py"
click node_server "https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/inference/pi0_remote_policy_server.py"
click node_cr3 "https://github.com/keyuanrong/cr3-lerobot/tree/main/src/lerobot/robots/dobot_cr3"
click node_replay "https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/evaluation/eval_remote_pi0_replay.py"
click node_results "https://github.com/keyuanrong/cr3-lerobot/tree/main/scripts/evaluation"

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_teleop,node_cameras,node_recorder,node_raw toneBlue
class node_curation,node_converter,node_manifests,node_dataset,node_sampler toneAmber
class node_trainer,node_policies,node_checkpoint toneMint
class node_client,node_server,node_cr3,node_replay,node_results toneRose
class node_mujoco,node_simresult,node_operator toneIndigo
```

## Components

### Robot data capture

- [Leader-follower control](https://github.com/keyuanrong/cr3-lerobot/blob/main/src/lerobot/robots/dobot_cr3/leader_follower_copy.py): `src/lerobot/robots/dobot_cr3/leader_follower_copy.py`
- [Camera drivers](https://github.com/keyuanrong/cr3-lerobot/tree/main/src/lerobot/cameras): `src/lerobot/cameras`
- [Demonstration recorder](https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/collection/record_drag_dataset.py): `scripts/collection/record_drag_dataset.py`
- **Raw episodes**

### Dataset preparation

- [Review and segmentation](https://github.com/keyuanrong/cr3-lerobot/tree/main/scripts/data_processing): `scripts/data_processing`
- [LeRobot conversion](https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/datasets/convert_drag_to_lerobot.py): `scripts/datasets/convert_drag_to_lerobot.py`
- [Dataset manifests](https://github.com/keyuanrong/cr3-lerobot/tree/main/scripts/datasets): `scripts/datasets`
- [LeRobot datasets](https://github.com/keyuanrong/cr3-lerobot/tree/main/src/lerobot/datasets): `src/lerobot/datasets`
- [Mixed sampling](https://github.com/keyuanrong/cr3-lerobot/blob/main/src/lerobot/datasets/weighted_mixture.py): `src/lerobot/datasets/weighted_mixture.py`

### Policy learning

- [Policy training](https://github.com/keyuanrong/cr3-lerobot/blob/main/src/lerobot/scripts/lerobot_train.py): `src/lerobot/scripts/lerobot_train.py`
- [Policy models](https://github.com/keyuanrong/cr3-lerobot/tree/main/src/lerobot/policies): `src/lerobot/policies`
- **Policy checkpoint**

### Execution and evaluation

- [Remote policy client](https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/inference/run_remote_pi0_policy.py): `scripts/inference/run_remote_pi0_policy.py`
- [Remote Pi0 server](https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/inference/pi0_remote_policy_server.py): `scripts/inference/pi0_remote_policy_server.py`
- [Dobot CR3 and gripper](https://github.com/keyuanrong/cr3-lerobot/tree/main/src/lerobot/robots/dobot_cr3): `src/lerobot/robots/dobot_cr3`
- [Replay evaluation](https://github.com/keyuanrong/cr3-lerobot/blob/main/scripts/evaluation/eval_remote_pi0_replay.py): `scripts/evaluation/eval_remote_pi0_replay.py`
- [Evaluation results](https://github.com/keyuanrong/cr3-lerobot/tree/main/scripts/evaluation): `scripts/evaluation`

### MuJoCo simulation

- [CR3 MuJoCo tools](https://github.com/keyuanrong/cr3-lerobot/tree/main/sim/cr3_mujoco): `sim/cr3_mujoco`
- [Simulation rollouts](https://github.com/keyuanrong/cr3-lerobot/blob/main/sim/cr3_mujoco/rollout_smolvla_in_mujoco.py): `sim/cr3_mujoco/rollout_smolvla_in_mujoco.py`

### Other components

- **Operator**

## Connections

- Operator → Leader-follower control: operates
- Operator → Demonstration recorder: demonstrates
- Leader-follower control → Demonstration recorder: provides control
- Camera drivers → Demonstration recorder: provides images
- Demonstration recorder → Raw episodes: records episodes
- Raw episodes → Review and segmentation: reviews and segments
- Raw episodes → LeRobot conversion: converts
- Review and segmentation → Dataset manifests: builds selections
- LeRobot conversion → LeRobot datasets: writes dataset
- Dataset manifests → LeRobot datasets: organizes sources
- LeRobot datasets → Mixed sampling: provides samples
- Mixed sampling → Policy training: feeds training
- Policy training → Policy models: trains
- Policy models → Policy checkpoint: saves weights
- Policy checkpoint → Remote Pi0 server: loads model
- Policy checkpoint → CR3 MuJoCo tools: loads policy
- CR3 MuJoCo tools → Simulation rollouts: produces rollouts
- Remote policy client → Remote Pi0 server: sends observations
- Remote Pi0 server → Remote policy client: returns actions
- Remote policy client → Dobot CR3 and gripper: commands arm
- Dobot CR3 and gripper → Remote policy client: provides state
- Remote policy client → Replay evaluation: supports replay
- Replay evaluation → Evaluation results: records evaluation
- Simulation rollouts → Evaluation results: informs evaluation
