# lecar-lab/asap architecture

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

- Interactive diagram: https://gitdiagram.com/lecar-lab/asap
- Repository: https://github.com/lecar-lab/asap

## Overview

ASAP is a humanoid whole-body skill-learning and transfer project built on HumanoidVerse. Its principal workflow prepares/retargets motion, trains a tracking or delta-action policy in a task on a selectable simulator, evaluates the checkpoint, then deploys policies in simulation or on a real robot. The graph preserves these distinct stages and the documented simulator choices. README workflows and sampled runtime files support the main links; links for unsampled training and retargeting internals are limited to explicitly documented relationships.

Main entry points: [`humanoidverse/train_agent.py`](https://github.com/lecar-lab/asap/blob/main/humanoidverse/train_agent.py) (Training entry), [`humanoidverse/eval_agent.py`](https://github.com/lecar-lab/asap/blob/main/humanoidverse/eval_agent.py) (Evaluation entry), [`humanoidverse/simulator/base_simulator/base_simulator.py`](https://github.com/lecar-lab/asap/blob/main/humanoidverse/simulator/base_simulator/base_simulator.py) (Simulator interface), [`sim2real/rl_policy/deepmimic_dec_loco.py`](https://github.com/lecar-lab/asap/blob/main/sim2real/rl_policy/deepmimic_dec_loco.py) (Sim2real policies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_retarget["Motion preparation"]
  node_shape_fit["Shape fitting<br/>[fit_smpl_shape.py]"]
  node_motion_fit["Motion fitting<br/>[fit_smpl_motion.py]"]
end

subgraph group_learning["Policy learning"]
  node_train_entry["Training entry<br/>[train_agent.py]"]
  node_algo["RL algorithms"]
  node_agent_modules["Policy modules"]
  node_delta_model["Delta action model"]
  node_eval_entry["Evaluation entry<br/>[eval_agent.py]"]
  node_policy_export["Policy export"]
end

subgraph group_runtime["Simulation runtime"]
  node_tracking_task["Motion tracking task<br/>[motion_tracking.py]"]
  node_locomotion_task["Locomotion task<br/>[locomotion.py]"]
  node_delta_task["Delta action tasks"]
  node_legged_base["Legged task base"]
  node_sim_base["Simulator interface<br/>[base_simulator.py]"]
  node_isaacgym["Isaac Gym<br/>[isaacgym.py]"]
  node_isaacsim["Isaac Sim<br/>[isaacsim.py]"]
  node_genesis["Genesis<br/>[genesis.py]"]
end

subgraph group_deployment["Policy deployment"]
  node_sim_policy["Sim2sim policies"]
  node_real_policy["Sim2real policies"]
  node_real_history["Observation history<br/>[history_handler.py]"]
  node_state_processor["State processing<br/>[state_processor.py]"]
  node_command_sender["Robot commands<br/>[command_sender.py]"]
end

subgraph group_motion["Motion and state"]
  node_motion_lib["Motion library<br/>[motion_lib_base.py]"]
  node_skeleton["Skeleton motion<br/>[skeleton.py]"]
end

node_researcher(("Researcher"))
node_smpl["SMPL / AMASS data"]
node_unitree(("Unitree robot"))

node_researcher -->|"prepare shape"| node_shape_fit
node_smpl -->|"fit shape"| node_shape_fit
node_researcher -->|"prepare motion"| node_motion_fit
node_smpl -->|"retarget motion"| node_motion_fit
node_motion_fit -->|"produces motions"| node_motion_lib
node_motion_lib -->|"uses skeletons"| node_skeleton
node_researcher -->|"configure training"| node_train_entry
node_train_entry -->|"instantiates"| node_algo
node_train_entry -->|"trains task"| node_tracking_task
node_train_entry -->|"trains task"| node_locomotion_task
node_train_entry -->|"trains task"| node_delta_task
node_algo -->|"uses modules"| node_agent_modules
node_algo -.->|"trains model"| node_delta_model
node_tracking_task -->|"loads motion"| node_motion_lib
node_tracking_task -->|"extends"| node_legged_base
node_locomotion_task -->|"extends"| node_legged_base
node_delta_task -->|"uses base"| node_legged_base
node_legged_base -->|"steps simulation"| node_sim_base
node_sim_base -.->|"selects adapter"| node_isaacgym
node_sim_base -.->|"selects adapter"| node_isaacsim
node_sim_base -.->|"selects adapter"| node_genesis
node_researcher -->|"evaluate checkpoint"| node_eval_entry
node_eval_entry -->|"loads policy"| node_algo
node_eval_entry -->|"runs environment"| node_tracking_task
node_eval_entry -.->|"exports policy"| node_policy_export
node_researcher -->|"deploy policy"| node_sim_policy
node_researcher -->|"deploy policy"| node_real_policy
node_real_policy -->|"updates and reads"| node_real_history
node_real_policy -->|"processes state"| node_state_processor
node_real_policy -->|"sends actions"| node_command_sender
node_command_sender -.->|"commands robot"| node_unitree

click node_shape_fit "https://github.com/lecar-lab/asap/blob/main/scripts/data_process/fit_smpl_shape.py"
click node_motion_fit "https://github.com/lecar-lab/asap/blob/main/scripts/data_process/fit_smpl_motion.py"
click node_motion_lib "https://github.com/lecar-lab/asap/blob/main/humanoidverse/utils/motion_lib/motion_lib_base.py"
click node_skeleton "https://github.com/lecar-lab/asap/blob/main/humanoidverse/utils/motion_lib/skeleton.py"
click node_train_entry "https://github.com/lecar-lab/asap/blob/main/humanoidverse/train_agent.py"
click node_algo "https://github.com/lecar-lab/asap/tree/main/humanoidverse/agents"
click node_agent_modules "https://github.com/lecar-lab/asap/tree/main/humanoidverse/agents/modules"
click node_delta_model "https://github.com/lecar-lab/asap/blob/main/humanoidverse/agents/delta_dynamics/delta_dynamics_model.py"
click node_tracking_task "https://github.com/lecar-lab/asap/blob/main/humanoidverse/envs/motion_tracking/motion_tracking.py"
click node_locomotion_task "https://github.com/lecar-lab/asap/blob/main/humanoidverse/envs/locomotion/locomotion.py"
click node_delta_task "https://github.com/lecar-lab/asap/tree/main/humanoidverse/envs/delta_a"
click node_legged_base "https://github.com/lecar-lab/asap/blob/main/humanoidverse/envs/legged_base_task/legged_robot_base.py"
click node_sim_base "https://github.com/lecar-lab/asap/blob/main/humanoidverse/simulator/base_simulator/base_simulator.py"
click node_isaacgym "https://github.com/lecar-lab/asap/blob/main/humanoidverse/simulator/isaacgym/isaacgym.py"
click node_isaacsim "https://github.com/lecar-lab/asap/blob/main/humanoidverse/simulator/isaacsim/isaacsim.py"
click node_genesis "https://github.com/lecar-lab/asap/blob/main/humanoidverse/simulator/genesis/genesis.py"
click node_eval_entry "https://github.com/lecar-lab/asap/blob/main/humanoidverse/eval_agent.py"
click node_policy_export "https://github.com/lecar-lab/asap/blob/main/humanoidverse/utils/inference_helpers.py"
click node_sim_policy "https://github.com/lecar-lab/asap/tree/main/sim2real/rl_policy"
click node_real_policy "https://github.com/lecar-lab/asap/blob/main/sim2real/rl_policy/deepmimic_dec_loco.py"
click node_real_history "https://github.com/lecar-lab/asap/blob/main/sim2real/utils/history_handler.py"
click node_state_processor "https://github.com/lecar-lab/asap/blob/main/sim2real/utils/state_processor.py"
click node_command_sender "https://github.com/lecar-lab/asap/blob/main/sim2real/utils/command_sender.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_shape_fit,node_motion_fit toneBlue
class node_train_entry,node_algo,node_agent_modules,node_delta_model,node_eval_entry,node_policy_export toneAmber
class node_tracking_task,node_locomotion_task,node_delta_task,node_legged_base,node_sim_base,node_isaacgym,node_isaacsim,node_genesis toneMint
class node_sim_policy,node_real_policy,node_real_history,node_state_processor,node_command_sender toneRose
class node_motion_lib,node_skeleton,node_researcher,node_smpl,node_unitree toneIndigo
```

## Components

### Motion preparation

- [Shape fitting](https://github.com/lecar-lab/asap/blob/main/scripts/data_process/fit_smpl_shape.py): `scripts/data_process/fit_smpl_shape.py`
- [Motion fitting](https://github.com/lecar-lab/asap/blob/main/scripts/data_process/fit_smpl_motion.py): `scripts/data_process/fit_smpl_motion.py`

### Policy learning

- [Training entry](https://github.com/lecar-lab/asap/blob/main/humanoidverse/train_agent.py): `humanoidverse/train_agent.py`
- [RL algorithms](https://github.com/lecar-lab/asap/tree/main/humanoidverse/agents): `humanoidverse/agents`
- [Policy modules](https://github.com/lecar-lab/asap/tree/main/humanoidverse/agents/modules): `humanoidverse/agents/modules`
- [Delta action model](https://github.com/lecar-lab/asap/blob/main/humanoidverse/agents/delta_dynamics/delta_dynamics_model.py): `humanoidverse/agents/delta_dynamics/delta_dynamics_model.py`
- [Evaluation entry](https://github.com/lecar-lab/asap/blob/main/humanoidverse/eval_agent.py): `humanoidverse/eval_agent.py`
- [Policy export](https://github.com/lecar-lab/asap/blob/main/humanoidverse/utils/inference_helpers.py): `humanoidverse/utils/inference_helpers.py`

### Simulation runtime

- [Motion tracking task](https://github.com/lecar-lab/asap/blob/main/humanoidverse/envs/motion_tracking/motion_tracking.py): `humanoidverse/envs/motion_tracking/motion_tracking.py`
- [Locomotion task](https://github.com/lecar-lab/asap/blob/main/humanoidverse/envs/locomotion/locomotion.py): `humanoidverse/envs/locomotion/locomotion.py`
- [Delta action tasks](https://github.com/lecar-lab/asap/tree/main/humanoidverse/envs/delta_a): `humanoidverse/envs/delta_a`
- [Legged task base](https://github.com/lecar-lab/asap/blob/main/humanoidverse/envs/legged_base_task/legged_robot_base.py): `humanoidverse/envs/legged_base_task/legged_robot_base.py`
- [Simulator interface](https://github.com/lecar-lab/asap/blob/main/humanoidverse/simulator/base_simulator/base_simulator.py): `humanoidverse/simulator/base_simulator/base_simulator.py`
- [Isaac Gym](https://github.com/lecar-lab/asap/blob/main/humanoidverse/simulator/isaacgym/isaacgym.py): `humanoidverse/simulator/isaacgym/isaacgym.py`
- [Isaac Sim](https://github.com/lecar-lab/asap/blob/main/humanoidverse/simulator/isaacsim/isaacsim.py): `humanoidverse/simulator/isaacsim/isaacsim.py`
- [Genesis](https://github.com/lecar-lab/asap/blob/main/humanoidverse/simulator/genesis/genesis.py): `humanoidverse/simulator/genesis/genesis.py`

### Policy deployment

- [Sim2sim policies](https://github.com/lecar-lab/asap/tree/main/sim2real/rl_policy): `sim2real/rl_policy`
- [Sim2real policies](https://github.com/lecar-lab/asap/blob/main/sim2real/rl_policy/deepmimic_dec_loco.py): `sim2real/rl_policy/deepmimic_dec_loco.py`
- [Observation history](https://github.com/lecar-lab/asap/blob/main/sim2real/utils/history_handler.py): `sim2real/utils/history_handler.py`
- [State processing](https://github.com/lecar-lab/asap/blob/main/sim2real/utils/state_processor.py): `sim2real/utils/state_processor.py`
- [Robot commands](https://github.com/lecar-lab/asap/blob/main/sim2real/utils/command_sender.py): `sim2real/utils/command_sender.py`

### Motion and state

- [Motion library](https://github.com/lecar-lab/asap/blob/main/humanoidverse/utils/motion_lib/motion_lib_base.py): `humanoidverse/utils/motion_lib/motion_lib_base.py`
- [Skeleton motion](https://github.com/lecar-lab/asap/blob/main/humanoidverse/utils/motion_lib/skeleton.py): `humanoidverse/utils/motion_lib/skeleton.py`

### Other components

- **Researcher**
- **SMPL / AMASS data**
- **Unitree robot**

## Connections

- Researcher → Shape fitting: prepare shape
- SMPL / AMASS data → Shape fitting: fit shape
- Researcher → Motion fitting: prepare motion
- SMPL / AMASS data → Motion fitting: retarget motion
- Motion fitting → Motion library: produces motions
- Motion library → Skeleton motion: uses skeletons
- Researcher → Training entry: configure training
- Training entry → RL algorithms: instantiates
- Training entry → Motion tracking task: trains task
- Training entry → Locomotion task: trains task
- Training entry → Delta action tasks: trains task
- RL algorithms → Policy modules: uses modules
- RL algorithms → Delta action model: trains model
- Motion tracking task → Motion library: loads motion
- Motion tracking task → Legged task base: extends
- Locomotion task → Legged task base: extends
- Delta action tasks → Legged task base: uses base
- Legged task base → Simulator interface: steps simulation
- Simulator interface → Isaac Gym: selects adapter
- Simulator interface → Isaac Sim: selects adapter
- Simulator interface → Genesis: selects adapter
- Researcher → Evaluation entry: evaluate checkpoint
- Evaluation entry → RL algorithms: loads policy
- Evaluation entry → Motion tracking task: runs environment
- Evaluation entry → Policy export: exports policy
- Researcher → Sim2sim policies: deploy policy
- Researcher → Sim2real policies: deploy policy
- Sim2real policies → Observation history: updates and reads
- Sim2real policies → State processing: processes state
- Sim2real policies → Robot commands: sends actions
- Robot commands → Unitree robot: commands robot
