# frc7902/reefscape2025 architecture

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

- Interactive diagram: https://gitdiagram.com/frc7902/reefscape2025
- Repository: https://github.com/frc7902/reefscape2025

## Overview

##### Main Components
- Robot Core – Represent this as a central “Robot” or “Main Controller” block (derived from files like Main.java, Robot.java, and RobotContainer.java). This is where initialization and scheduling occur.
- Subsystems – Create individual components for each major subsystem that controls robot hardware. For instance, include nodes for SwerveSubsystem, ClimbSubsystem, CoralIndexerSubsystem, ElevatorSubsystem, and AlgaeManipulatorSubsystem.
- Command Groups – List the various command packages (for teleop and autonomous) that drive actions. This would include SwerveCommands, teleop commands for algae manipulator, climb, coral indexer, and elevator commands.
- Deployment Configurations & External Data – Include a block for deployment files (in src/main/deploy) that houses path planning for autonomous routines (autos and paths in the “pathplanner” folders) and configurations for swerve drive (including JSON configurations and properties files).
- Vendor Dependencies & Libraries – Identify the external library components (via the vendordeps folder) like WPILib, PathplannerLib, REVLib, Phoenix libraries, etc. Mention these as external services or libraries that support the core functionality.

##### Out Interactions and Relationships
- Robot Core interacting with its Subsystems. Use labels to indicate that RobotContainer is responsible for wiring commands to their respective subsystems.

##### Architectural Patterns and Design Principles
- Command-based design pattern common in WPILib projects: one central scheduler triggering Commands which in turn manipulate Subsystems.
- That the separation of concerns is visually clear – sensor/control logic in subsystems, and operational behavior in Commands.
- How integration of external libraries (via vendordeps) supports hardware abstraction and advanced functions (like path planning and swerve drive kinematics).

## Diagram (Mermaid)

```mermaid
flowchart TD
    Vendor["External Libraries"]:::vendor
    Deployment["Deployment Configurations"]:::deploy
    RC["Robot Core"]:::core

    %% Command Groups Subgraph
    subgraph "Command Groups"
        SwerveCmd["Swerve Commands"]:::command
        AlgaeCmd["Algae Manipulator Commands"]:::command
        ClimbCmd["Climb Commands"]:::command
        CoralCmd["Coral Indexer Commands"]:::command
        ElevatorCmd["Elevator Commands"]:::command
    end

    %% Subsystems Subgraph
    subgraph "Subsystems"
        SwerveSub["SwerveSubsystem"]:::subsystem
        ClimbSub["ClimbSubsystem"]:::subsystem
        CoralIndexerSub["CoralIndexerSubsystem"]:::subsystem
        ElevatorSub["ElevatorSubsystem"]:::subsystem
        AlgaeManipulatorSub["AlgaeManipulatorSubsystem"]:::subsystem
    end

    %% Interactions
    Vendor -->|"supports"| RC
    Deployment -->|"configures"| RC
    RC -->|"wires"| SwerveCmd
    SwerveCmd -->|"triggers"| SwerveSub
    Deployment -->|"configures"| SwerveCmd
    Deployment -->|"configures"| SwerveSub

    %% Click Events for Robot Core and Groups
    click RC "https://github.com/frc7902/reefscape2025/tree/main/src/main/java/frc/robot"
    click SwerveSub "https://github.com/frc7902/reefscape2025/tree/main/src/main/java/frc/robot/subsystems"
    click ClimbSub "https://github.com/frc7902/reefscape2025/tree/main/src/main/java/frc/robot/subsystems"
    click CoralIndexerSub "https://github.com/frc7902/reefscape2025/tree/main/src/main/java/frc/robot/subsystems"
    click ElevatorSub "https://github.com/frc7902/reefscape2025/tree/main/src/main/java/frc/robot/subsystems"
    click AlgaeManipulatorSub "https://github.com/frc7902/reefscape2025/tree/main/src/main/java/frc/robot/subsystems"
    click SwerveCmd "https://github.com/frc7902/reefscape2025/tree/main/src/main/java/frc/robot/commands/teleop/SwerveCommands"
    click AlgaeCmd "https://github.com/frc7902/reefscape2025/tree/main/src/main/java/frc/robot/commands/teleop/algae_manipulator"
    click ClimbCmd "https://github.com/frc7902/reefscape2025/tree/main/src/main/java/frc/robot/commands/teleop/climb"
    click CoralCmd "https://github.com/frc7902/reefscape2025/tree/main/src/main/java/frc/robot/commands/teleop/coral_indexer"
    click ElevatorCmd "https://github.com/frc7902/reefscape2025/tree/main/src/main/java/frc/robot/commands/teleop/elevator"
    click Deployment "https://github.com/frc7902/reefscape2025/tree/main/src/main/deploy"
    click Vendor "https://github.com/frc7902/reefscape2025/tree/main/vendordeps"

    %% Styles
    classDef core fill:#ffcccb,stroke:#333,stroke-width:2px;
    classDef command fill:#ffd700,stroke:#333,stroke-width:2px;
    classDef subsystem fill:#dda0dd,stroke:#333,stroke-width:2px;
    classDef deploy fill:#90ee90,stroke:#333,stroke-width:2px;
    classDef vendor fill:#add8e6,stroke:#333,stroke-width:2px;
```
