Lesson 1.1: Project Structure
π― What Youβll Learn
By the end of this lesson you will be able to:
- Describe the standard Java project folder structure used by FRC teams
- Navigate from the project root to any robot code file
- Explain the difference between entry point files and support files
- Locate subsystems, commands, and constants in the project
- Apply the Code Reading Framework to a file you havenβt seen before
The Big Picture: How Java Projects Are Organized
Every FRC robot project follows the same folder structure. This isnβt random β itβs a convention that every Java project uses, and once you learn it, you can navigate any teamβs code.
Hereβs what the top level looks like:
Drive2026FBI/βββ src/β βββ main/β βββ java/ β All the Java source code lives hereβ β βββ frc/β β βββ robot/ β YOUR robot codeβ βββ deploy/ β Files deployed to the roboRIO (paths, configs)βββ vendordeps/ β Third-party library configs (CTRE, REV, etc.)βββ build.gradle β Build script (like a recipe for compiling)βββ ...The key path to remember is:
src/main/java/frc/robot/ β this is where all your teamβs robot code lives.
Everything outside that path is either build configuration, library setup, or deploy files. Youβll rarely need to touch those.
What is the key path where all your team's robot code lives?
Inside frc/robot/ β The Files That Matter
Letβs zoom into the folder where all the action happens. Open
frc/robot/βββ commands/ β Command classes (robot behaviors)β βββ AutoShootCommand.javaβββ generated/ β Auto-generated code (DO NOT EDIT)β βββ TunerConstants.javaβββ subsystems/ β Subsystem classes (hardware control)β βββ ClimberSubsystem.javaβ βββ CommandSwerveDrivetrain.javaβ βββ IntakeSubsystem.javaβ βββ ShooterSubsystem.javaβ βββ TurretSubsystem.javaβββ Constants.java β All configuration values (CAN IDs, speeds, etc.)βββ LimelightHelpers.java β Vision camera helper utilitiesβββ Main.java β Program entry point (don't touch)βββ Robot.java β Robot lifecycle managerβββ RobotContainer.java β Wires everything togetherβββ Telemetry.java β Dashboard/logging data publisherβββ TrajectoryCalculations.java β Math for shot trajectoriesThatβs a lot of files! But they fall into clear categories. Letβs break them down.
Entry Point Files vs. Support Files
Not all files are created equal. Some are entry points that the WPILib framework calls automatically, and others are support files that get used by those entry points.
Entry Point Files (The Core Four)
These four files form the backbone of every FRC robot program:
| File | Role | Do You Edit It? |
|---|---|---|
Starts the program β calls RobotBase.startRobot() | Almost never | |
| Manages the robot lifecycle (init, periodic, disabled) | Rarely | |
| Creates subsystems, binds buttons to commands | Often | |
| Stores all configuration values (CAN IDs, speeds, limits) | Often |
Think of it this way:
- Main.java is the ignition key β it starts the engine but you never modify the key itself
- Robot.java is the engine β it runs the lifecycle but you rarely open the hood
- RobotContainer.java is the dashboard β itβs where you wire controls to actions
- Constants.java is the settings panel β itβs where you tune values
Support Files
Everything else supports the core four:
- Subsystem files (in
subsystems/) β each one controls a physical mechanism on the robot - Command files (in
commands/) β each one defines a behavior the robot can perform - Helper files (
Telemetry.java,LimelightHelpers.java,TrajectoryCalculations.java) β utilities that other files use
- Main.java β Starts the robot program by calling
RobotBase.startRobot() - Robot.java β Manages the robot lifecycle (what happens during init, teleop, auto, disabled)
- RobotContainer.java β Creates all subsystems and binds controller buttons to commands
- Constants.java β Stores all configuration values like CAN IDs, motor speeds, and field measurements
Locating Subsystems
Subsystems are the building blocks of your robot. Each subsystem class controls one physical mechanism. They all live in the
Your teamβs robot has 5 subsystems:
| Subsystem | What It Controls |
|---|
Locating Commands
Commands tell the robot what to do. They use subsystems to make things happen. Your teamβs commands live in two places:
- The
commands/folder β for standalone command classes likeAutoShootCommand - Inside RobotContainer.java β for inline commands defined right where buttons are bound
Most FRC teams use a mix of both. Complex behaviors (like auto-shooting) get their own file. Simple one-liners (like βrun the intake at 50%β) are defined inline in RobotContainer.
A teammate wrote a complex command that coordinates three subsystems during autonomous. Where should that command class live?
Locating Constants
All the βmagic numbersβ in the robot code β CAN IDs, motor speeds, field positions β live in
Constants are organized into inner classes by system:
ShootingConstantsβ CAN IDs and settings for the shooter, turret, feederIntakeConstantsβ CAN IDs for intake rollers and deploy motorsClimberConstantsβ CAN IDs for climb motors and elevatorFieldConstantsβ Field dimensions, zone boundaries, target positions
For example, the intake left roller motor has CAN ID 31 and the shooter left flywheel is CAN ID 21.
Where would you look to find the CAN ID for the turret motor?
π Code Reading Exercise: Telemetry.java
Time to practice the Code Reading Framework on a file you havenβt studied yet. Open
Take a few minutes to read through the file before revealing the answers. Donβt worry if you donβt understand every line β focus on the big picture.
Telemetry.javaStarting from the project root:
- Open
src/main/java/frc/robot/subsystems/ - Open
IntakeSubsystem.java
The full path is src/main/java/frc/robot/subsystems/IntakeSubsystem.java. You know itβs in the subsystems/ folder because the intake is a physical mechanism (hardware control = subsystem). The file name matches the class name β IntakeSubsystem.
Quick Reference: Where to Find Things
| I need to find⦠| Look in⦠|
|---|---|
| Any robot code file | {robotConfig.projectRoot}/ |
| A subsystem (hardware control) | {robotConfig.projectRoot}/subsystems/ |
| A command (robot behavior) | {robotConfig.projectRoot}/commands/ or inline in RobotContainer.java |
| CAN IDs and motor speeds | {robotConfig.projectRoot}/{robotConfig.coreFiles.constants} |
| Button-to-command wiring | {robotConfig.projectRoot}/{robotConfig.coreFiles.robotContainer} |
| Auto-generated swerve config | {robotConfig.projectRoot}/generated/ (read only!) |
Whatβs Next?
Now that you can navigate the project, itβs time to understand how the code runs. In Lesson 1.2: Robot Lifecycle, youβll learn the sequence of methods that WPILib calls when the robot starts up, enters teleop, runs autonomous, and more.
In Activity 1.3: Open & Build, youβll open the project in your IDE and run your first Gradle build to make sure everything compiles.