# zhengyiluo/phc architecture

> Architecture diagram of the GitHub repository zhengyiluo/phc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zhengyiluo/phc
- Repository: https://github.com/zhengyiluo/phc

## Overview

##### Project Type and Core Components
This is a physics-based humanoid control system with the following main components:

A. Core System Components:
- Motion Control System
- Physics Simulation (Isaac Gym)
- Learning Framework
- Data Processing Pipeline
- Visualization System

**[Input Layer]**

**[Processing Layer]**

**[Control Layer]**

**[Simulation Layer]**

**[Output/Visualization Layer]**

##### Input Layer
- Motion Data Sources (AMASS Dataset)
- Real-time Inputs (Video/VR/Language)
- SMPL Model Parameters

##### Processing Layer
- Data Processing Pipeline
- Motion Library
- Progressive Multiplicative Control Policy (PMCP)

##### Control Layer
- PHC Controller
- Policy Networks
- State Management

##### Simulation Layer
- Isaac Gym Environment
- Physics Engine
- Robot Models (SMPL/SMPL-X)

##### Output Layer
- Visualization Tools
- Performance Metrics
- Real-time Rendering

- Blue: Input/Data components
- Green: Processing/Learning components
- Orange: Control components
- Purple: Simulation components
- Gray: Output/Visualization components

Connections to Show:
##### Data Flow
- Motion data → Processing → Control
- Sensor inputs → Control
- Control → Simulation
- Simulation → Visualization

##### Control Flow
- Policy decisions
- State transitions
- Feedback loops

##### Training Flow
- Data collection
- Policy updates
- Performance evaluation

Special Considerations:

##### Progressive Learning Architecture
- How PMCP allocates network capacity
- Primitive learning progression
- Demonstrate fail-state recovery integration

##### Real-time Components
- Real-time processing paths
- Parallel processing elements
- Feedback loops

##### Integration Points
- SMPL model integration
- External input processing
- Physics simulation coupling

- Component types
- State indicators
- Processing stages
- Interface points

Key Architectural Patterns to Highlight:

##### Visualization and feedback systems

This will create a comprehensive visualization of the system's architecture while maintaining clarity and showing the relationships between components.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Input
        MD["Motion Data (AMASS)"]:::input
        RT["Real-time Inputs"]:::input
        SP["SMPL Parameters"]:::input
    end

    subgraph Processing
        DPP["Data Processing Pipeline"]:::processing
        ML["Motion Library"]:::processing
        PMCP["Progressive Multiplicative Control Policy"]:::processing
    end

    subgraph Control
        PHC["PHC Controller"]:::control
        PN["Policy Networks"]:::control
        SM["State Management"]:::control
    end

    subgraph Simulation
        IG["Isaac Gym Environment"]:::simulation
        PE["Physics Engine"]:::simulation
        RM["Robot Models"]:::simulation
    end

    subgraph Output
        VT["Visualization Tools"]:::output
        PM["Performance Metrics"]:::output
        RR["Real-time Rendering"]:::output
    end

    %% Connections
    MD --> DPP
    RT --> PHC
    SP --> ML

    DPP --> ML
    ML --> PMCP
    PMCP --> PN

    PN --> PHC
    PHC --> SM
    SM --> IG

    IG --> PE
    PE --> RM
    RM --> VT

    VT --> PM
    PM --> RR

    %% Feedback Loops
    RM --> SM
    PM --> PMCP

    %% Click Events
    click DPP "https://github.com/ZhengyiLuo/PHC/tree/master/scripts/data_process/"
    click ML "https://github.com/ZhengyiLuo/PHC/blob/master/phc/utils/motion_lib_smpl.py"
    click PMCP "https://github.com/ZhengyiLuo/PHC/tree/master/scripts/pmcp/"
    click PHC "https://github.com/ZhengyiLuo/PHC/blob/master/phc/env/tasks/humanoid_im.py"
    click PN "https://github.com/ZhengyiLuo/PHC/blob/master/phc/learning/amp_network_builder.py"
    click IG "https://github.com/ZhengyiLuo/PHC/blob/master/phc/env/tasks/humanoid_teleop.py"
    click PE "https://github.com/ZhengyiLuo/PHC/tree/master/phc/data/assets/mjcf/"
    click RM "https://github.com/ZhengyiLuo/PHC/tree/master/phc/data/assets/robot/"
    click VT "https://github.com/ZhengyiLuo/PHC/tree/master/scripts/vis/"
    click SP "https://github.com/ZhengyiLuo/PHC/tree/master/phc/data/assets/mesh/smpl/"

    %% Styles
    classDef input fill:#3498db,stroke:#2980b9,color:white
    classDef processing fill:#2ecc71,stroke:#27ae60,color:white
    classDef control fill:#e67e22,stroke:#d35400,color:white
    classDef simulation fill:#9b59b6,stroke:#8e44ad,color:white
    classDef output fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        L1["Input Components"]:::input
        L2["Processing Components"]:::processing
        L3["Control Components"]:::control
        L4["Simulation Components"]:::simulation
        L5["Output Components"]:::output
    end
```
