# escape-velocity-14343/intothesleep architecture

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

- Interactive diagram: https://gitdiagram.com/escape-velocity-14343/intothesleep
- Repository: https://github.com/escape-velocity-14343/intothesleep

## Overview

##### Project Type and Purpose
This is a robotics control system for FTC competitions, consisting of two main modules:
- FtcRobotController (core control module)
- TeamCode (team-specific implementation)

##### Main Components

A. Hardware Layer:
- Robot Hardware Components
- Motors and Servos
- Camera Systems
- LED Systems

B. Control Layer:
- FtcRobotController Module
- Core Robot Controller
- OpMode Registration
- Hardware Abstractions

C. Team Implementation Layer:
- Subsystems
- Drive Subsystem (MecanumDriveSubsystem)
- Vision Subsystem (CameraSubsystem)
- Manipulation Subsystems (IntakeSubsystem, PivotSubsystem, etc.)
- Sensor Subsystems (IMULocalizer, PinpointSubsystem)

D. Command Layer:
- Command Groups
- Individual Commands
- Autonomous Commands
- Teleop Commands

**┌─────────────────────────────────────────────┐**
- User Interface                 │
- (FtcRobotControllerActivity)              │
- ┤
- Operation Modes                   │
- ┌──────────────┐    ┌──────────────┐    │
- Autonomous │    │    TeleOp    │    │
- ┘    └──────────────┘    │
- ┤
- Command Layer                     │
- ┌──────────────┐    ┌──────────────┐    │
- Group Commands│    │Base Commands  │    │
- ┘    └──────────────┘    │
- ┤
- Subsystems                        │
- ┌────────┐ ┌────────┐ ┌────────┐        │
- Drive  │ │Vision  │ │Intake  │        │
- ┘ └────────┘ └────────┘        │
- ┤
- Hardware Abstraction              │
- ┌────────┐ ┌────────┐ ┌────────┐        │
- Motors  │ │Sensors │ │Cameras │        │
- ┘ └────────┘ └────────┘        │
- ┘

##### Important Elements to Highlight
- Command flow between layers
- Hardware communication paths
- Sensor data flow
- Vision processing pipeline
- Control loop feedback

##### Implementation Details
- Version information and key dependencies

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#a8d1f0,stroke:#000
    classDef control fill:#90caf9,stroke:#000
    classDef command fill:#a5d6a7,stroke:#000
    classDef subsystem fill:#fff59d,stroke:#000
    classDef hardware fill:#ffcc80,stroke:#000

    %% User Interface Layer
    UI[FtcRobotControllerActivity]:::ui
    click UI "https://github.com/escape-velocity-14343/IntoTheSleep/blob/master/FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/internal/FtcRobotControllerActivity.java"

    %% Control Layer
    subgraph Control
        OpModeReg[FtcOpModeRegister]:::control
        RobotHW[Robot Hardware Integration]:::control
    end
    click OpModeReg "https://github.com/escape-velocity-14343/IntoTheSleep/blob/master/FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/internal/FtcOpModeRegister.java"
    click RobotHW "https://github.com/escape-velocity-14343/IntoTheSleep/blob/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/Robot.java"

    %% Operation Modes
    subgraph OpModes
        Auto["Autonomous Commands"]:::control
        Teleop["Teleop Commands"]:::control
    end
    click Auto "https://github.com/escape-velocity-14343/IntoTheSleep/tree/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/auton/"
    click Teleop "https://github.com/escape-velocity-14343/IntoTheSleep/tree/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/teleop/"

    %% Command Layer
    subgraph Commands
        BaseCmd["Base Commands"]:::command
        GroupCmd["Command Groups"]:::command
    end
    click BaseCmd "https://github.com/escape-velocity-14343/IntoTheSleep/tree/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/commands/custom/"
    click GroupCmd "https://github.com/escape-velocity-14343/IntoTheSleep/tree/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/commands/group/"

    %% Subsystems Layer
    subgraph Subsystems
        Drive["Mecanum Drive"]:::subsystem
        Vision["Camera System"]:::subsystem
        Intake["Intake"]:::subsystem
        Pivot["Pivot"]:::subsystem
        Extension["Extension"]:::subsystem
        IMU["IMU Localizer"]:::subsystem
        Pinpoint["Pinpoint"]:::subsystem
        LED["LED System"]:::subsystem
    end
    click Drive "https://github.com/escape-velocity-14343/IntoTheSleep/blob/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/MecanumDriveSubsystem.java"
    click Vision "https://github.com/escape-velocity-14343/IntoTheSleep/blob/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/CameraSubsystem.java"
    click Intake "https://github.com/escape-velocity-14343/IntoTheSleep/blob/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/IntakeSubsystem.java"
    click Pivot "https://github.com/escape-velocity-14343/IntoTheSleep/blob/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/PivotSubsystem.java"
    click Extension "https://github.com/escape-velocity-14343/IntoTheSleep/blob/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/ExtensionSubsystem.java"
    click IMU "https://github.com/escape-velocity-14343/IntoTheSleep/blob/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/IMULocalizer.java"
    click Pinpoint "https://github.com/escape-velocity-14343/IntoTheSleep/blob/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/PinpointSubsystem.java"
    click LED "https://github.com/escape-velocity-14343/IntoTheSleep/blob/master/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/LEDSubsystem.java"

    %% Hardware Layer
    subgraph Hardware
        Motors[(Motors)]:::hardware
        Sensors[(Sensors)]:::hardware
        Cameras[(Cameras)]:::hardware
        LEDs[(LEDs)]:::hardware
    end

    %% Connections
    UI --> OpModeReg
    OpModeReg --> Auto & Teleop
    Auto & Teleop --> BaseCmd & GroupCmd
    BaseCmd & GroupCmd --> Drive & Vision & Intake & Pivot & Extension & IMU & Pinpoint & LED
    Drive --> Motors
    Vision --> Cameras
    Intake & Pivot & Extension --> Motors
    IMU & Pinpoint --> Sensors
    LED --> LEDs
    RobotHW --> Motors & Sensors & Cameras & LEDs

    %% Legend
    subgraph Legend
        UI_L[User Interface]:::ui
        Control_L[Control Layer]:::control
        Command_L[Command Layer]:::command
        Subsystem_L[Subsystems]:::subsystem
        Hardware_L[Hardware]:::hardware
    end
```
