# hammerheads5000/2024crescendo architecture

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

- Interactive diagram: https://gitdiagram.com/hammerheads5000/2024crescendo
- Repository: https://github.com/hammerheads5000/2024crescendo

## Overview

##### Project type and purpose
- This is an embedded control‐system project for an FRC competition robot (Team 5000, “Crescendo” 2024 season).
- It uses the WPILib command‐based framework, the PathPlanner trajectory library, vendor motor‐controller libraries (Phoenix, REV), and vision (PhotonVision/AprilTags).

##### File structure
- Build & config
– Gradle build scripts (build.gradle, settings.gradle, gradle/wrapper/…)
– vendordeps/*.json define external libraries (WPILib, Phoenix, REV, PathPlannerLib, photonlib)
- Path definitions
– pathplanner/ and src/main/deploy/pathplanner/… contain JSON navgrids and .path/.auto files that define autonomous trajectories and sequences.
- Java source tree (src/main/java/frc/robot)
– Core entry points: Main.java, Robot.java, RobotContainer.java, Constants.java
– Subsystems: packages under subsystems/ controlling hardware abstractions (Swerve drive, Shooter, Intake, TrapMechanism, Climber, Lights, AprilTag vision).
– Commands: under commands/ broken out by function (swerve, shooter, intake, trap mechanism, etc.) and autos.
- Deployment
– src/main/deploy/example.txt and pathplanner deploy files get pushed to roboRIO for runtime configuration.

##### Insights from README
- Confirms this is FRC Team 5000’s 2024 robot control code.

##### Be very detailed
- Break out each subsystem (Swerve, Shooter, Intake, TrapMechanism, Climber, Lights, Vision) as its own component
- Commands that orchestrate multi‐subsystem behaviors (e.g., PickUpNoteAndShootCommand)
- Vendor SDK layer between subsystems and physical actuators/sensors
- Autonomous routine loader (PathPlannerLib → CommandGroups)
- Don’t forget build/deploy pipeline: Gradle → roboRIO

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Deployment Data
    subgraph "Deployment Data"
        PPJSON["PathPlanner JSON & .path/.auto"]:::data
        DeployPaths["src/main/deploy/pathplanner/"]:::data
        ExampleTxt["example.txt"]:::data
    end

    %% Robot Code
    subgraph "Robot Code"
        Main["Main"]:::core
        Robot["Robot"]:::core
        RobotContainer["RobotContainer"]:::core
        Constants["Constants"]:::core
        CommandScheduler["CommandScheduler"]:::framework

        subgraph "PathPlanner Module"
            PathPlannerLib["PathPlanner Library"]:::lib
        end

        subgraph "Subsystems"
            Swerve["Swerve"]:::subsys
            Shooter["ShooterSubsystem"]:::subsys
            ShooterPID["ShooterHeightPIDSubsystem"]:::subsys
            Intake["IntakeSubsystem"]:::subsys
            Trap["TrapMechanismSubsystem"]:::subsys
            TrapPID["TrapHeightPIDSubsystem"]:::subsys
            Climber["ClimberSubsystem"]:::subsys
            Lights["LightsSubsystem"]:::subsys
            AprilTag["AprilTagSubsystem"]:::subsys
            Power["PowerSubsystem"]:::subsys
            Bonker["BonkerSubsystem"]:::subsys
        end

        subgraph "Commands"
            TeleopSwerve["TeleopSwerve"]:::cmd
            ClimbCmd["ClimbCommand"]:::cmd
            AimShooter["AimShooterCommand"]:::cmd
            SpinShooter["SpinShooterCommand"]:::cmd
            IntakeCmds["Intake Commands"]:::cmd
            TrapCmds["TrapMechanism Commands"]:::cmd
            LightsCmds["Lights Commands"]:::cmd
            PickUpShoot["PickUpNoteAndShootCommand"]:::cmd
            ShootNote["ShootNoteCommand"]:::cmd
        end
    end

    %% Hardware
    subgraph "Hardware"
        MC["Motor Controllers (Phoenix, REV)"]:::hardware
        Sensors["Sensors (Encoders, Gyro)"]:::hardware
        Camera["AprilTag Camera"]:::hardware
    end

    %% External
    DriverStation["Driver Station"]:::external
    NetworkTables["NetworkTables"]:::middleware

    %% Connections
    PPJSON -->|deploys to| PathPlannerLib
    DeployPaths -->|deploys to| PathPlannerLib
    ExampleTxt -->|deploys to| RobotCode

    DriverStation -->|joystick/buttons| NetworkTables
    Camera -->|video stream| AprilTag
    AprilTag -->|target data| NetworkTables

    NetworkTables -->|inputs| RobotContainer
    RobotContainer -->|init| CommandScheduler
    Main -->|calls| Robot
    Robot -->|uses| RobotContainer
    RobotContainer -->|binds| TeleopSwerve
    RobotContainer -->|binds| ClimbCmd

    CommandScheduler -->|schedules| TeleopSwerve
    CommandScheduler -->|schedules| ClimbCmd
    CommandScheduler -->|schedules| PickUpShoot

    TeleopSwerve -->|controls| Swerve
    ClimbCmd -->|controls| Climber
    AimShooter -->|controls| Shooter
    AimShooter -->|controls| ShooterPID
    SpinShooter -->|controls| Shooter
    IntakeCmds -->|controls| Intake
    TrapCmds -->|controls| Trap
    TrapCmds -->|controls| TrapPID
    LightsCmds -->|controls| Lights
    PickUpShoot -->|composes| ShootNote
    ShootNote -->|controls| Shooter

    PathPlannerLib -->|generates| Swerve

    Swerve -->|actuates| MC
    Shooter -->|actuates| MC
    Intake -->|actuates| MC
    Trap -->|actuates| MC
    Climber -->|actuates| MC
    Lights -->|actuates| MC
    Bonker -->|actuates| MC

    Sensors -->|feedback| Swerve
    Sensors -->|feedback| Shooter
    Sensors -->|feedback| Intake
    Sensors -->|feedback| Trap
    Sensors -->|feedback| Climber

    %% Click Events
    click Main "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/Main.java"
    click Robot "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/Robot.java"
    click RobotContainer "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/RobotContainer.java"
    click Constants "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/Constants.java"

    click Swerve "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/subsystems/Swerve.java"
    click Shooter "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java"
    click ShooterPID "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/subsystems/shooter/ShooterHeightPIDSubsystem.java"
    click Intake "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/subsystems/IntakeSubsystem.java"
    click Trap "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/subsystems/trapmechanism/TrapMechanismSubsystem.java"
    click TrapPID "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/subsystems/trapmechanism/TrapHeightPIDSubsystem.java"
    click Climber "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/subsystems/ClimberSubsystem.java"
    click Lights "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/subsystems/LightsSubsystem.java"
    click AprilTag "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/subsystems/AprilTagSubsystem.java"
    click Power "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/subsystems/PowerSubsystem.java"
    click Bonker "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/subsystems/BonkerSubsystem.java"

    click TeleopSwerve "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/commands/TeleopSwerve.java"
    click ClimbCmd "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/commands/ClimbCommand.java"
    click AimShooter "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/commands/shooter/AimShooterCommand.java"
    click SpinShooter "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/commands/shooter/SpinShooterCommand.java"
    click IntakeCmds "https://github.com/hammerheads5000/2024crescendo/tree/main/src/main/java/frc/robot/commands/intake/"
    click TrapCmds "https://github.com/hammerheads5000/2024crescendo/tree/main/src/main/java/frc/robot/commands/trapmechanism/"
    click LightsCmds "https://github.com/hammerheads5000/2024crescendo/tree/main/src/main/java/frc/robot/commands/lights/"
    click PickUpShoot "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/commands/autos/PickUpNoteAndShootCommand.java"
    click ShootNote "https://github.com/hammerheads5000/2024crescendo/blob/main/src/main/java/frc/robot/commands/autos/ShootNoteCommand.java"
    click PPJSON "https://github.com/hammerheads5000/2024crescendo/tree/main/pathplanner/"
    click DeployPaths "https://github.com/hammerheads5000/2024crescendo/tree/main/src/main/deploy/pathplanner/"

    %% Styles
    classDef core fill:#f9f,stroke:#333,stroke-width:1px
    classDef framework fill:#bbf,stroke:#333,stroke-width:1px
    classDef subsys fill:#cfc,stroke:#333,stroke-width:1px
    classDef cmd fill:#fcf,stroke:#333,stroke-width:1px
    classDef hardware fill:#fcc,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef data fill:#cff,stroke:#333,stroke-width:1px
    classDef lib fill:#ffc,stroke:#333,stroke-width:1px
    classDef external fill:#eee,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef middleware fill:#eef,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
```
