# ranchodvt/comp-v3 architecture

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

- Interactive diagram: https://gitdiagram.com/ranchodvt/comp-v3
- Repository: https://github.com/ranchodvt/comp-v3

## Overview

##### Main Components

A. Hardware Layer
- VEX V5 Brain (Central Processing Unit)
- Motors and Sensors
- Vision Sensor (planned feature)
- Controller Interface

B. Software Components (based on the file structure):
- Configuration System (/include/config, /src/config)
- System (/include/display, /src/display)
- Competition Control System (/src/comptition)
- Core Functions (/src/functions.cpp)
- External Storage (SD Card support)

**┌─────────────────────────────────────────────┐**
- User Interface               │
- (Display System, Controller Interface)     │
- ┤
- Core Control Systems              │
- AWD/FWD/RWD Switcher                    │
- Traction & Stability Control            │
- Diagnostic Mode                         │
- Competition Control                     │
- ┤
- Configuration Layer               │
- Robot Config                            │
- External Config Manager                 │
- SD Card Interface                       │
- ┤
- Hardware Abstraction Layer        │
- Motor Controls                          │
- Sensor Interfaces                       │
- Vision Systems (planned)                │
- ┘

##### Key Features to Highlight

- Implemented features (✅) - Green
- In-progress features (🔃) - Yellow
- Planned features (❌) - Red

##### Data Flow Indicators

- Configuration Layer ↔️ Core Control Systems
- Core Control Systems ↔️ Hardware Abstraction Layer
- User Interface ↔️ Core Control Systems

##### External Interfaces

Connections to:
- SD Card Storage
- Remote Update System (planned)
- Controller Input
- Output

##### Technical Details

Annotations for:
- Custom SDK integration
- VEX V5 API dependencies
- File system organization
- Configuration management flow

- Hardware interface components
- Core logic systems
- User interface elements
- Configuration management
- Safety systems

Remember to indicate the status of features (implemented, in-progress, planned) as this appears to be an actively developed project with several features in various states of completion.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef hardware fill:#e6e6e6,stroke:#333
    classDef interface fill:#d4e6ff,stroke:#333
    classDef core fill:#ffe6cc,stroke:#333
    classDef config fill:#e6ffe6,stroke:#333
    classDef implemented fill:#90EE90,stroke:#333
    classDef inprogress fill:#FFD700,stroke:#333
    classDef planned fill:#FFB6C1,stroke:#333

    %% Hardware Layer
    subgraph Hardware
        Brain["VEX V5 Brain"]
        Motors["Motors & Sensors"]
        Vision["Vision Sensor"]:::planned
        Controller["Controller Interface"]
    end
    class Brain,Motors,Controller hardware

    %% User Interface Layer
    subgraph UI
        Display["Display System"]
        Logging["Logging System"]
        GIF["GIF Animation System"]
    end
    click Display "https://github.com/RanchoDVT/Comp-V3/blob/dev/src/display/display.cpp"
    click Logging "https://github.com/RanchoDVT/Comp-V3/blob/dev/src/display/logging.cpp"
    click GIF "https://github.com/RanchoDVT/Comp-V3/blob/dev/src/display/gifplayer/gifplayer.cpp"

    %% Core Control Systems
    subgraph CoreSystems
        DriveControl["Drive Control System"]
        TractionControl["Traction & Stability"]:::implemented
        DiagMode["Diagnostic Mode"]:::implemented
        CompControl["Competition Control"]:::implemented
        CoreFunc["Core Functions"]
    end
    click CompControl "https://github.com/RanchoDVT/Comp-V3/blob/dev/src/comptition/comptition.cpp"
    click CoreFunc "https://github.com/RanchoDVT/Comp-V3/blob/dev/src/functions.cpp"

    %% Configuration Layer
    subgraph Config
        RobotConfig["Robot Configuration"]
        ConfigMgr["Configuration Manager"]
        SDCard["SD Card Interface"]
        VEXConfig["VEX System Config"]
    end
    click RobotConfig "https://github.com/RanchoDVT/Comp-V3/blob/dev/include/config/robot-config.h"
    click ConfigMgr "https://github.com/RanchoDVT/Comp-V3/blob/dev/include/config/extern/configManager.h"
    click SDCard "https://github.com/RanchoDVT/Comp-V3/blob/dev/src/config/extern/sdcard.cpp"
    click VEXConfig "https://github.com/RanchoDVT/Comp-V3/blob/dev/vex/mkenv.mk"

    %% Main Program
    MainEntry["Main Program Entry"]
    click MainEntry "https://github.com/RanchoDVT/Comp-V3/blob/dev/src/main.cpp"

    %% Relationships
    MainEntry --> CoreSystems
    MainEntry --> Config
    
    Config --> CoreSystems
    CoreSystems --> Hardware
    UI --> CoreSystems
    
    Brain --> Motors
    Brain --> Vision
    Brain --> Controller
    
    RobotConfig --> ConfigMgr
    ConfigMgr --> SDCard
    
    Display --> Logging
    Display --> GIF
    
    DriveControl --> TractionControl
    DriveControl --> Motors
    
    CompControl --> DriveControl
    CoreFunc --> DriveControl

    %% Legend
    subgraph Legend
        L1["Implemented"]:::implemented
        L2["In Progress"]:::inprogress
        L3["Planned"]:::planned
    end
```
