# lecar-lab/falcon architecture

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

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

## Overview

FALCON trains and evaluates force-adaptive humanoid locomotion and loco-manipulation policies, then supports simulation and robot deployment. The training path connects task environments to physics simulation and PPO; deployment paths run exported policies with simulated or robot state and action interfaces. The README documents Isaac Gym training and Unitree/Booster sim-to-real support. Some backend and deployment wiring is unsampled, so uncertain links are omitted or marked dashed.

Main entry points: [`humanoidverse/envs/base_task/base_task.py`](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/base_task/base_task.py) (Base task), [`humanoidverse/agents/ppo/ppo.py`](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/agents/ppo/ppo.py) (PPO), [`sim2real/rl_policy/base_policy.py`](https://github.com/lecar-lab/falcon/blob/main/sim2real/rl_policy/base_policy.py) (Runtime policy), [`humanoidverse/train_agent.py`](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/train_agent.py) (Training entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Training workflow"]
  node_trainer["Training entry<br/>[train_agent.py]"]
  node_evaluator["Evaluation entry<br/>[eval_agent.py]"]
  node_ppo["PPO<br/>[ppo.py]"]
  node_dualppo["Decoupled PPO"]
  node_networks["Policy networks<br/>[ppo_modules.py]"]
  node_rollouts["Rollout storage<br/>[data_utils.py]"]
end

subgraph group_environment["Robot environments"]
  node_task["Base task<br/>[base_task.py]"]
  node_legged["Legged robot task"]
  node_locomotion["Locomotion task<br/>[locomotion_ma.py]"]
  node_stand["Stand task"]
  node_force_task["Force-adaptive task"]
  node_diff_force["Force variation"]
end

subgraph group_simulation["Physics simulation"]
  node_sim_api["Simulator interface<br/>[base_simulator.py]"]
  node_isaacgym["Isaac Gym backend<br/>[isaacgym.py]"]
  node_isaacsim["Isaac Sim backend<br/>[isaacsim.py]"]
  node_genesis["Genesis backend<br/>[genesis.py]"]
  node_terrain["Terrain utilities<br/>[terrain.py]"]
end

subgraph group_deployment["Policy deployment"]
  node_policy_base["Runtime policy<br/>[base_policy.py]"]
  node_loco_policy["Locomotion policy<br/>[dec_loco.py]"]
  node_manip_policy["Loco-manip policy<br/>[loco_manip.py]"]
  node_sim_env["Deployment simulator<br/>[base_sim.py]"]
  node_sim_loco["Loco-manip simulator<br/>[loco_manip.py]"]
  node_robot["Robot interfaces<br/>[robot.py]"]
  node_sdk_bridge["SDK bridges"]
  node_command["Command senders"]
  node_state["State processors"]
  node_arm_ik["Arm inverse kinematics<br/>[robot_arm_ik.py]"]
end

subgraph group_support["Shared runtime"]
  node_motion["Motion library"]
  node_averages["Training metrics<br/>[average_meters.py]"]
  node_torch_utils["Tensor utilities<br/>[torch_utils.py]"]
  node_rotations["Rotation utilities<br/>[rotations.py]"]
  node_math_sim2real["Deployment math<br/>[math.py]"]
end

node_engineer(("Researcher"))

node_engineer -->|"starts training"| node_trainer
node_engineer -->|"evaluates checkpoint"| node_evaluator
node_trainer -->|"instantiates task"| node_task
node_trainer -->|"instantiates algorithm"| node_ppo
node_trainer -->|"selects backend"| node_isaacgym
node_evaluator -->|"instantiates task"| node_task
node_evaluator -->|"loads algorithm"| node_ppo
node_ppo -->|"collects experience"| node_task
node_ppo -->|"builds policies"| node_networks
node_ppo -->|"stores samples"| node_rollouts
node_dualppo -->|"builds agents"| node_networks
node_dualppo -->|"stores samples"| node_rollouts
node_dualppo -->|"trains against"| node_task
node_task -->|"creates environments"| node_sim_api
node_legged -->|"extends task"| node_task
node_locomotion -->|"extends task"| node_legged
node_force_task -->|"extends task"| node_stand
node_diff_force -->|"extends task"| node_force_task
node_isaacgym -->|"implements backend"| node_sim_api
node_isaacgym -->|"uses terrain"| node_terrain
node_sim_api -.->|"backend option"| node_isaacsim
node_sim_api -.->|"backend option"| node_genesis
node_policy_base -->|"reads robot setup"| node_robot
node_loco_policy -->|"extends runtime"| node_policy_base
node_manip_policy -->|"extends policy"| node_loco_policy
node_manip_policy -->|"uses arm IK"| node_arm_ik
node_sim_env -->|"uses robot config"| node_robot
node_sim_env -->|"uses SDK bridge"| node_sdk_bridge
node_sim_loco -->|"extends simulator"| node_sim_env
node_policy_base -.->|"sends commands"| node_command
node_policy_base -.->|"reads robot state"| node_state
node_sdk_bridge -.->|"bridges commands"| node_command
node_sdk_bridge -.->|"bridges state"| node_state
node_ppo -->|"tracks metrics"| node_averages
node_task -->|"uses tensor helpers"| node_torch_utils
node_legged -->|"uses rotations"| node_rotations
node_policy_base -->|"uses math helpers"| node_math_sim2real

click node_trainer "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/train_agent.py"
click node_evaluator "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/eval_agent.py"
click node_ppo "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/agents/ppo/ppo.py"
click node_dualppo "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/agents/decouple/ppo_decoupled_wbc_ma.py"
click node_networks "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/agents/modules/ppo_modules.py"
click node_rollouts "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/agents/modules/data_utils.py"
click node_task "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/base_task/base_task.py"
click node_legged "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/legged_base_task/legged_robot_base_ma.py"
click node_locomotion "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/locomotion/locomotion_ma.py"
click node_stand "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/decoupled_locomotion/decoupled_locomotion_stand_ma.py"
click node_force_task "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/decoupled_locomotion/decoupled_locomotion_stand_height_waist_wbc_ma.py"
click node_diff_force "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/decoupled_locomotion/decoupled_locomotion_stand_height_waist_wbc_ma_diff_force.py"
click node_sim_api "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/simulator/base_simulator/base_simulator.py"
click node_isaacgym "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/simulator/isaacgym/isaacgym.py"
click node_isaacsim "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/simulator/isaacsim/isaacsim.py"
click node_genesis "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/simulator/genesis/genesis.py"
click node_terrain "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/env_utils/terrain.py"
click node_policy_base "https://github.com/lecar-lab/falcon/blob/main/sim2real/rl_policy/base_policy.py"
click node_loco_policy "https://github.com/lecar-lab/falcon/blob/main/sim2real/rl_policy/dec_loco/dec_loco.py"
click node_manip_policy "https://github.com/lecar-lab/falcon/blob/main/sim2real/rl_policy/loco_manip/loco_manip.py"
click node_sim_env "https://github.com/lecar-lab/falcon/blob/main/sim2real/sim_env/base_sim.py"
click node_sim_loco "https://github.com/lecar-lab/falcon/blob/main/sim2real/sim_env/loco_manip.py"
click node_robot "https://github.com/lecar-lab/falcon/blob/main/sim2real/utils/robot.py"
click node_sdk_bridge "https://github.com/lecar-lab/falcon/blob/main/sim2real/utils/sdk2py_bridge/base/basic_sdk2py_bridge.py"
click node_command "https://github.com/lecar-lab/falcon/tree/main/sim2real/utils/comm/command_sender"
click node_state "https://github.com/lecar-lab/falcon/tree/main/sim2real/utils/comm/state_processor"
click node_arm_ik "https://github.com/lecar-lab/falcon/blob/main/sim2real/utils/arm_ik/robot_arm_ik.py"
click node_motion "https://github.com/lecar-lab/falcon/tree/main/humanoidverse/utils/motion_lib"
click node_averages "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/utils/average_meters.py"
click node_torch_utils "https://github.com/lecar-lab/falcon/blob/main/humanoidverse/utils/torch_utils.py"
click node_rotations "https://github.com/lecar-lab/falcon/blob/main/isaac_utils/isaac_utils/rotations.py"
click node_math_sim2real "https://github.com/lecar-lab/falcon/blob/main/sim2real/utils/math.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_trainer,node_evaluator,node_ppo,node_dualppo,node_networks,node_rollouts toneBlue
class node_task,node_legged,node_locomotion,node_stand,node_force_task,node_diff_force toneAmber
class node_sim_api,node_isaacgym,node_isaacsim,node_genesis,node_terrain toneMint
class node_policy_base,node_loco_policy,node_manip_policy,node_sim_env,node_sim_loco,node_robot,node_sdk_bridge,node_command,node_state,node_arm_ik toneRose
class node_motion,node_averages,node_torch_utils,node_rotations,node_math_sim2real,node_engineer toneIndigo
```

## Components

### Training workflow

- [Training entry](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/train_agent.py): `humanoidverse/train_agent.py`
- [Evaluation entry](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/eval_agent.py): `humanoidverse/eval_agent.py`
- [PPO](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/agents/ppo/ppo.py): `humanoidverse/agents/ppo/ppo.py`
- [Decoupled PPO](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/agents/decouple/ppo_decoupled_wbc_ma.py): `humanoidverse/agents/decouple/ppo_decoupled_wbc_ma.py`
- [Policy networks](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/agents/modules/ppo_modules.py): `humanoidverse/agents/modules/ppo_modules.py`
- [Rollout storage](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/agents/modules/data_utils.py): `humanoidverse/agents/modules/data_utils.py`

### Robot environments

- [Base task](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/base_task/base_task.py): `humanoidverse/envs/base_task/base_task.py`
- [Legged robot task](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/legged_base_task/legged_robot_base_ma.py): `humanoidverse/envs/legged_base_task/legged_robot_base_ma.py`
- [Locomotion task](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/locomotion/locomotion_ma.py): `humanoidverse/envs/locomotion/locomotion_ma.py`
- [Stand task](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/decoupled_locomotion/decoupled_locomotion_stand_ma.py): `humanoidverse/envs/decoupled_locomotion/decoupled_locomotion_stand_ma.py`
- [Force-adaptive task](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/decoupled_locomotion/decoupled_locomotion_stand_height_waist_wbc_ma.py): `humanoidverse/envs/decoupled_locomotion/decoupled_locomotion_stand_height_waist_wbc_ma.py`
- [Force variation](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/decoupled_locomotion/decoupled_locomotion_stand_height_waist_wbc_ma_diff_force.py): `humanoidverse/envs/decoupled_locomotion/decoupled_locomotion_stand_height_waist_wbc_ma_diff_force.py`

### Physics simulation

- [Simulator interface](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/simulator/base_simulator/base_simulator.py): `humanoidverse/simulator/base_simulator/base_simulator.py`
- [Isaac Gym backend](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/simulator/isaacgym/isaacgym.py): `humanoidverse/simulator/isaacgym/isaacgym.py`
- [Isaac Sim backend](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/simulator/isaacsim/isaacsim.py): `humanoidverse/simulator/isaacsim/isaacsim.py`
- [Genesis backend](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/simulator/genesis/genesis.py): `humanoidverse/simulator/genesis/genesis.py`
- [Terrain utilities](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/envs/env_utils/terrain.py): `humanoidverse/envs/env_utils/terrain.py`

### Policy deployment

- [Runtime policy](https://github.com/lecar-lab/falcon/blob/main/sim2real/rl_policy/base_policy.py): `sim2real/rl_policy/base_policy.py`
- [Locomotion policy](https://github.com/lecar-lab/falcon/blob/main/sim2real/rl_policy/dec_loco/dec_loco.py): `sim2real/rl_policy/dec_loco/dec_loco.py`
- [Loco-manip policy](https://github.com/lecar-lab/falcon/blob/main/sim2real/rl_policy/loco_manip/loco_manip.py): `sim2real/rl_policy/loco_manip/loco_manip.py`
- [Deployment simulator](https://github.com/lecar-lab/falcon/blob/main/sim2real/sim_env/base_sim.py): `sim2real/sim_env/base_sim.py`
- [Loco-manip simulator](https://github.com/lecar-lab/falcon/blob/main/sim2real/sim_env/loco_manip.py): `sim2real/sim_env/loco_manip.py`
- [Robot interfaces](https://github.com/lecar-lab/falcon/blob/main/sim2real/utils/robot.py): `sim2real/utils/robot.py`
- [SDK bridges](https://github.com/lecar-lab/falcon/blob/main/sim2real/utils/sdk2py_bridge/base/basic_sdk2py_bridge.py): `sim2real/utils/sdk2py_bridge/base/basic_sdk2py_bridge.py`
- [Command senders](https://github.com/lecar-lab/falcon/tree/main/sim2real/utils/comm/command_sender): `sim2real/utils/comm/command_sender`
- [State processors](https://github.com/lecar-lab/falcon/tree/main/sim2real/utils/comm/state_processor): `sim2real/utils/comm/state_processor`
- [Arm inverse kinematics](https://github.com/lecar-lab/falcon/blob/main/sim2real/utils/arm_ik/robot_arm_ik.py): `sim2real/utils/arm_ik/robot_arm_ik.py`

### Shared runtime

- [Motion library](https://github.com/lecar-lab/falcon/tree/main/humanoidverse/utils/motion_lib): `humanoidverse/utils/motion_lib`
- [Training metrics](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/utils/average_meters.py): `humanoidverse/utils/average_meters.py`
- [Tensor utilities](https://github.com/lecar-lab/falcon/blob/main/humanoidverse/utils/torch_utils.py): `humanoidverse/utils/torch_utils.py`
- [Rotation utilities](https://github.com/lecar-lab/falcon/blob/main/isaac_utils/isaac_utils/rotations.py): `isaac_utils/isaac_utils/rotations.py`
- [Deployment math](https://github.com/lecar-lab/falcon/blob/main/sim2real/utils/math.py): `sim2real/utils/math.py`

### Other components

- **Researcher**

## Connections

- Researcher → Training entry: starts training (evidence: `README.md`)
- Researcher → Evaluation entry: evaluates checkpoint (evidence: `README.md`)
- Training entry → Base task: instantiates task (evidence: `humanoidverse/train_agent.py`)
- Training entry → PPO: instantiates algorithm (evidence: `humanoidverse/train_agent.py`)
- Training entry → Isaac Gym backend: selects backend (evidence: `README.md`)
- Evaluation entry → Base task: instantiates task (evidence: `humanoidverse/eval_agent.py`)
- Evaluation entry → PPO: loads algorithm (evidence: `humanoidverse/eval_agent.py`)
- PPO → Base task: collects experience (evidence: `humanoidverse/agents/ppo/ppo.py`)
- PPO → Policy networks: builds policies (evidence: `humanoidverse/agents/ppo/ppo.py`)
- PPO → Rollout storage: stores samples (evidence: `humanoidverse/agents/ppo/ppo.py`)
- Decoupled PPO → Policy networks: builds agents (evidence: `humanoidverse/agents/decouple/ppo_decoupled_wbc_ma.py`)
- Decoupled PPO → Rollout storage: stores samples (evidence: `humanoidverse/agents/decouple/ppo_decoupled_wbc_ma.py`)
- Decoupled PPO → Base task: trains against (evidence: `humanoidverse/agents/decouple/ppo_decoupled_wbc_ma.py`)
- Base task → Simulator interface: creates environments (evidence: `humanoidverse/envs/base_task/base_task.py`)
- Legged robot task → Base task: extends task (evidence: `humanoidverse/envs/legged_base_task/legged_robot_base_ma.py`)
- Locomotion task → Legged robot task: extends task (evidence: `humanoidverse/envs/locomotion/locomotion_ma.py`)
- Force-adaptive task → Stand task: extends task (evidence: `humanoidverse/envs/decoupled_locomotion/decoupled_locomotion_stand_height_waist_wbc_ma.py`)
- Force variation → Force-adaptive task: extends task (evidence: `humanoidverse/envs/decoupled_locomotion/decoupled_locomotion_stand_height_waist_wbc_ma_diff_force.py`)
- Isaac Gym backend → Simulator interface: implements backend (evidence: `humanoidverse/simulator/isaacgym/isaacgym.py`)
- Isaac Gym backend → Terrain utilities: uses terrain (evidence: `humanoidverse/simulator/isaacgym/isaacgym.py`)
- Simulator interface → Isaac Sim backend: backend option
- Simulator interface → Genesis backend: backend option
- Runtime policy → Robot interfaces: reads robot setup (evidence: `sim2real/rl_policy/base_policy.py`)
- Locomotion policy → Runtime policy: extends runtime (evidence: `sim2real/rl_policy/dec_loco/dec_loco.py`)
- Loco-manip policy → Locomotion policy: extends policy (evidence: `sim2real/rl_policy/loco_manip/loco_manip.py`)
- Loco-manip policy → Arm inverse kinematics: uses arm IK (evidence: `sim2real/rl_policy/loco_manip/loco_manip.py`)
- Deployment simulator → Robot interfaces: uses robot config (evidence: `sim2real/sim_env/base_sim.py`)
- Deployment simulator → SDK bridges: uses SDK bridge (evidence: `sim2real/sim_env/base_sim.py`)
- Loco-manip simulator → Deployment simulator: extends simulator (evidence: `sim2real/sim_env/loco_manip.py`)
- Runtime policy → Command senders: sends commands
- Runtime policy → State processors: reads robot state
- SDK bridges → Command senders: bridges commands
- SDK bridges → State processors: bridges state
- PPO → Training metrics: tracks metrics (evidence: `humanoidverse/agents/ppo/ppo.py`)
- Base task → Tensor utilities: uses tensor helpers (evidence: `humanoidverse/envs/base_task/base_task.py`)
- Legged robot task → Rotation utilities: uses rotations (evidence: `humanoidverse/envs/legged_base_task/legged_robot_base_ma.py`)
- Runtime policy → Deployment math: uses math helpers (evidence: `sim2real/rl_policy/base_policy.py`)
