# kscalelabs/krecviz architecture

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

- Interactive diagram: https://gitdiagram.com/kscalelabs/krecviz
- Repository: https://github.com/kscalelabs/krecviz

## Overview

##### Main Components

a) Input Layer:
- KREC File Handler (for robot movement recordings)
- URDF File Parser (for robot model descriptions)

b) Core Processing Layer:
- Visualization Engine
- Data Transformation Module

c) Output Layer:
- RRD (Robot Recording Data) Generator
- Viewer Interface

##### Component Relationships

- Input files (KREC/URDF) → Data Processing → Visualization → Output (RRD format)
- Both CLI and Python API entry points

##### Specific Implementation Details

**[Input Sources]**

- KREC Files (.krec) ─────┐
- (Robot Recordings)      │
- v
**[Processing Layer] ────── Data Transformer**

- URDF Files (.urdf) ────┘
- (Robot Description)

**[Visualization Engine]**

- v
**[Output Layer]**
- RRD File Generator
- Rerun Viewer Interface

##### Important Elements to Highlight

a) File Format Support:
- .krec (Robot movement recordings)
- .urdf (Robot description files)
- .rrd (Output format)

b) Integration Points:
- CLI interface
- Python API
- Rerun viewer integration

##### Technical Details

- Python package structure
- External dependencies
- Data flow direction between components
- File format transformations

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        KREC[KREC File Handler]
        URDF[URDF File Parser]
        MESH[Robot Mesh Files]
        JOINT[Joint Configurations]
    end

    subgraph Processing
        DT[Data Transformer]
        VE[Visualization Engine]
    end

    subgraph Output
        RRD[RRD Generator]
        RV[Rerun Viewer Interface]
    end

    KREC --> DT
    URDF --> DT
    MESH --> VE
    JOINT --> VE
    DT --> VE
    VE --> RRD
    VE --> RV

    classDef input fill:#a8d1ff,stroke:#333
    classDef processing fill:#90EE90,stroke:#333
    classDef output fill:#FFB6C1,stroke:#333
    classDef viewer fill:#DDA0DD,stroke:#333

    class KREC,URDF,MESH,JOINT input
    class DT,VE processing
    class RRD output
    class RV viewer

    click KREC "https://github.com/kscalelabs/krecviz/tree/master/krecviz/data/krec_examples/"
    click URDF "https://github.com/kscalelabs/krecviz/blob/master/krecviz/urdf_logger.py"
    click MESH "https://github.com/kscalelabs/krecviz/tree/master/krecviz/data/urdf_examples/gpr/meshes/"
    click JOINT "https://github.com/kscalelabs/krecviz/blob/master/krecviz/data/urdf_examples/gpr/joints.py"
    click VE "https://github.com/kscalelabs/krecviz/blob/master/krecviz/visualize.py"
    click RRD "https://github.com/kscalelabs/krecviz/blob/master/krecviz/data/urdf_examples/gpr/test_output.rrd"

    subgraph Legend
        L1[Input Components]:::input
        L2[Processing Components]:::processing
        L3[Output Components]:::output
        L4[Viewer Interface]:::viewer
    end
```
