# tucanusfrc/swerve2026-2027 architecture

> Architecture diagram of the GitHub repository tucanusfrc/swerve2026-2027, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tucanusfrc/swerve2026-2027
- Repository: https://github.com/tucanusfrc/swerve2026-2027

## Overview

This is WPILib robot-control software for a swerve-drive robot. The runtime starts the TimedRobot, whose teleop loop sends Xbox input and gyro heading through chassis-speed and swerve-kinematics calculations to four wheel modules; robot periodic also publishes module telemetry. The graph includes configuration and hardware interfaces. The README is empty, so capabilities beyond the sampled source are not inferred; edges reflect calls and data access visible in the excerpts.

Main entry points: [`src/main/java/frc/robot/SwerveDrive.java`](https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/SwerveDrive.java) (Swerve drive), [`src/main/java/frc/robot/Robot.java`](https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/Robot.java) (Robot lifecycle), [`src/main/java/frc/robot/SwerveModule.java`](https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/SwerveModule.java) (Swerve module), [`src/main/java/frc/robot/Gyro.java`](https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/Gyro.java) (Gyro adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Robot runtime"]
  node_main["Robot entry<br/>[Main.java]"]
  node_robot["Robot lifecycle<br/>[Robot.java]"]
  node_constants["Robot constants<br/>[Constants.java]"]
end

subgraph group_control["Drive control"]
  node_drive["Swerve drive<br/>[SwerveDrive.java]"]
  node_module["Swerve module<br/>[SwerveModule.java]"]
end

subgraph group_hardware["Hardware interfaces"]
  node_gyro["Gyro adapter<br/>[Gyro.java]"]
  node_canhw{{"CAN hardware"}}
end

subgraph group_telemetry["Telemetry"]
  node_dashboard["SmartDashboard"]
end

node_driver(("Driver station"))

node_main -->|"starts"| node_robot
node_robot -->|"constructs, runs"| node_drive
node_robot -->|"constructs"| node_gyro
node_robot -->|"reads IDs"| node_constants
node_driver -->|"provides input"| node_robot
node_driver -->|"provides axes"| node_drive
node_drive -->|"reads yaw"| node_gyro
node_drive -->|"sets states"| node_module
node_drive -->|"reads deadband"| node_constants
node_module -->|"reads wheel data"| node_constants
node_gyro -->|"reads yaw sensor"| node_canhw
node_module -->|"controls, reads"| node_canhw
node_robot -->|"requests telemetry"| node_drive
node_drive -->|"publishes values"| node_dashboard

click node_main "https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/Main.java"
click node_robot "https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/Robot.java"
click node_constants "https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/Constants.java"
click node_drive "https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/SwerveDrive.java"
click node_module "https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/SwerveModule.java"
click node_gyro "https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/Gyro.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_robot,node_constants toneBlue
class node_drive,node_module toneAmber
class node_gyro,node_canhw toneMint
class node_dashboard toneRose
class node_driver toneIndigo
```

## Components

### Robot runtime

- [Robot entry](https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/Main.java): `src/main/java/frc/robot/Main.java`
- [Robot lifecycle](https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/Robot.java): `src/main/java/frc/robot/Robot.java`
- [Robot constants](https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/Constants.java): `src/main/java/frc/robot/Constants.java`

### Drive control

- [Swerve drive](https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/SwerveDrive.java): `src/main/java/frc/robot/SwerveDrive.java`
- [Swerve module](https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/SwerveModule.java): `src/main/java/frc/robot/SwerveModule.java`

### Hardware interfaces

- [Gyro adapter](https://github.com/tucanusfrc/swerve2026-2027/blob/main/src/main/java/frc/robot/Gyro.java): `src/main/java/frc/robot/Gyro.java`
- **CAN hardware**

### Telemetry

- **SmartDashboard**

### Other components

- **Driver station**

## Connections

- Robot entry → Robot lifecycle: starts (evidence: `src/main/java/frc/robot/Main.java`)
- Robot lifecycle → Swerve drive: constructs, runs (evidence: `src/main/java/frc/robot/Robot.java`)
- Robot lifecycle → Gyro adapter: constructs (evidence: `src/main/java/frc/robot/Robot.java`)
- Robot lifecycle → Robot constants: reads IDs (evidence: `src/main/java/frc/robot/Robot.java`)
- Driver station → Robot lifecycle: provides input (evidence: `src/main/java/frc/robot/Robot.java`)
- Driver station → Swerve drive: provides axes (evidence: `src/main/java/frc/robot/SwerveDrive.java`)
- Swerve drive → Gyro adapter: reads yaw (evidence: `src/main/java/frc/robot/SwerveDrive.java`)
- Swerve drive → Swerve module: sets states (evidence: `src/main/java/frc/robot/SwerveDrive.java`)
- Swerve drive → Robot constants: reads deadband (evidence: `src/main/java/frc/robot/SwerveDrive.java`)
- Swerve module → Robot constants: reads wheel data (evidence: `src/main/java/frc/robot/SwerveModule.java`)
- Gyro adapter → CAN hardware: reads yaw sensor (evidence: `src/main/java/frc/robot/Gyro.java`)
- Swerve module → CAN hardware: controls, reads (evidence: `src/main/java/frc/robot/SwerveModule.java`)
- Robot lifecycle → Swerve drive: requests telemetry (evidence: `src/main/java/frc/robot/Robot.java`)
- Swerve drive → SmartDashboard: publishes values (evidence: `src/main/java/frc/robot/SwerveDrive.java`)
