From 4444227465e568d92c95816770e1e53c5833fe19 Mon Sep 17 00:00:00 2001 From: CodeMyGame1 Date: Thu, 16 Jul 2026 09:42:04 -0700 Subject: [PATCH 1/8] feat: add stage 1 intro --- src/config/sidebarConfig.ts | 8 +++---- .../stage-1/stage-1a/stage-overview.mdx | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx diff --git a/src/config/sidebarConfig.ts b/src/config/sidebarConfig.ts index 72e16be..6c33b2e 100644 --- a/src/config/sidebarConfig.ts +++ b/src/config/sidebarConfig.ts @@ -98,10 +98,10 @@ export const sidebarSections: Record = { label: 'Stage 1', collapsed: true, items: [ - // { - // label: 'Stage 1 Introduction', - // slug: 'learning-course/stage-1a-commands/overview', - // }, + { + label: 'Stage 1 Introduction', + slug: 'learning-course/stage-1/stage-1a/stage-overview', + }, { label: 'Stage 1A: TBD', collapsed: true, diff --git a/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx b/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx new file mode 100644 index 0000000..5891603 --- /dev/null +++ b/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx @@ -0,0 +1,21 @@ +--- +title: Stage 1 Overview +description: An overview of Stage 1 +prev: false +next: stage-1a/frc-prog-intro +--- + +Congratulations! Whether you already know Java, have programmed an FRC robot before, +or are a complete beginner, you should have a good grasp of the basic syntax of the Java language by now. +In Stage 1, we'll be moving on to the exciting part: actually writing code for a robot! +It might seem daunting at first, but the best way to think through it is to focus on understanding +how each individual component of the code works, instead of trying to tackle it all at once. + +This stage covers how to fully program a working kitbot for the 2026 FIRST Robotics Competition game, +REBUILT. You'll start at stage 1A, which covers a simple way to code the kitbot. +Then, you'll move on to stage 1B, which uses a slightly more complex paradigm known as commands. +In addition, you'll also get to debug your robot in a simulation, to check if your code works! +Feel free to play around with the robot and control it in sim once you've finished! + +This stage will cover the following topics: +- WIP \ No newline at end of file From 8ef7e93c17ec9df195bfa7b9f5a070073dda12dd Mon Sep 17 00:00:00 2001 From: CodeMyGame1 Date: Thu, 16 Jul 2026 09:49:46 -0700 Subject: [PATCH 2/8] linting fixes --- .../learning-course/stage-1/stage-1a/stage-overview.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx b/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx index 5891603..270d006 100644 --- a/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx +++ b/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx @@ -12,10 +12,12 @@ It might seem daunting at first, but the best way to think through it is to focu how each individual component of the code works, instead of trying to tackle it all at once. This stage covers how to fully program a working kitbot for the 2026 FIRST Robotics Competition game, -REBUILT. You'll start at stage 1A, which covers a simple way to code the kitbot. +REBUILT. +You'll start at stage 1A, which covers a simple way to code the kitbot. Then, you'll move on to stage 1B, which uses a slightly more complex paradigm known as commands. In addition, you'll also get to debug your robot in a simulation, to check if your code works! Feel free to play around with the robot and control it in sim once you've finished! This stage will cover the following topics: -- WIP \ No newline at end of file + +- WIP From ccd0cc32cf74cbe8db144af76756e49875d07c31 Mon Sep 17 00:00:00 2001 From: CodeMyGame1 Date: Fri, 17 Jul 2026 09:24:45 -0700 Subject: [PATCH 3/8] feat: add stage 1a intro --- examples/stage1/snippets/Main.java | 11 ++ src/config/sidebarConfig.ts | 12 +- .../stage-1/stage-1a/stage-overview.mdx | 109 +++++++++++++++--- .../stage-1/stage-overview.mdx | 24 ++++ 4 files changed, 134 insertions(+), 22 deletions(-) create mode 100644 examples/stage1/snippets/Main.java create mode 100644 src/content/docs/learning-course/stage-1/stage-overview.mdx diff --git a/examples/stage1/snippets/Main.java b/examples/stage1/snippets/Main.java new file mode 100644 index 0000000..6155073 --- /dev/null +++ b/examples/stage1/snippets/Main.java @@ -0,0 +1,11 @@ +// [main] +import org.wpilib.framework.RobotBase; + +public final class Main { + private Main() {} + + public static void main(String... args) { + RobotBase.startRobot(first.robot.Robot.class); + } +} +// [/main] \ No newline at end of file diff --git a/src/config/sidebarConfig.ts b/src/config/sidebarConfig.ts index 6c33b2e..bc28b2b 100644 --- a/src/config/sidebarConfig.ts +++ b/src/config/sidebarConfig.ts @@ -100,16 +100,16 @@ export const sidebarSections: Record = { items: [ { label: 'Stage 1 Introduction', - slug: 'learning-course/stage-1/stage-1a/stage-overview', + slug: 'learning-course/stage-1/stage-overview', }, { - label: 'Stage 1A: TBD', + label: 'Stage 1A', collapsed: true, items: [ - // { - // label: 'TBD', - // slug: 'stage-1a-commands/command-based-overview', - // }, + { + label: 'Stage 1A Overview', + slug: 'learning-course/stage-1/stage-1a/stage-overview', + }, // { // label: 'TBD', // slug: 'stage-1a-commands/the-command-body', diff --git a/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx b/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx index 270d006..71cdc94 100644 --- a/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx +++ b/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx @@ -1,22 +1,99 @@ --- -title: Stage 1 Overview -description: An overview of Stage 1 -prev: false -next: stage-1a/frc-prog-intro +title: Stage 1A Overview +description: An overview of Stage 1A +prev: ../stage-overview +next: false --- -Congratulations! Whether you already know Java, have programmed an FRC robot before, -or are a complete beginner, you should have a good grasp of the basic syntax of the Java language by now. -In Stage 1, we'll be moving on to the exciting part: actually writing code for a robot! -It might seem daunting at first, but the best way to think through it is to focus on understanding -how each individual component of the code works, instead of trying to tackle it all at once. - -This stage covers how to fully program a working kitbot for the 2026 FIRST Robotics Competition game, -REBUILT. -You'll start at stage 1A, which covers a simple way to code the kitbot. -Then, you'll move on to stage 1B, which uses a slightly more complex paradigm known as commands. -In addition, you'll also get to debug your robot in a simulation, to check if your code works! -Feel free to play around with the robot and control it in sim once you've finished! +import YouTube from "../../../../../components/YouTube.astro"; + +Now, before we get into the depths of the robot code, it's useful to look at a high-level overview of the contents of a +typical WPILib project. As your code gets more advanced, you'll see more folders and files appear, but they're all controlled +by the same basic components. Below, you can see the sample file structure you'll be starting off with as a template for Stage 1A. +If your robot has REV electronics, then the template folder's name will be `rev/` instead of `ctre/` + +### Stage 1A Template Structure + +```text +ctre/ +├── src/main/ +| ├── java/first/ +| | ├── robot/ +| | | ├── opmode/ +| | | | ├── MyAuto.java +| | | | ├── MyTeleop.Java +| | | ├── simulation/ +| | | | ├── DrivetrainSim.Java +| | | | ├── SingleFlywheelSim.java +| | | ├── Robot.java +| | ├── Main.java +``` + +You'll notice that we're skipping a lot of files here, because you don't have to edit those. What's great about about using a framework +like WPILib is that it automatically generates these files when you create a new project, so you can get started coding quicker. +The other folders, like `src/main/deploy/` for example, will come in handy as your robot code becomes more advanced. +Thus, the only files shown above are the ones directly responsible for controlling what our kitbot will do. + + + +### `Main.java` +The first file to take note of is the `Main.java` file; this is the entrypoint for any Java project in real life. +Its contents are pretty short and sweet (comments and package declaration removed for brevity): +```java stage1/snippets/Main.java#main + +``` +You can see that all the `Main.java` file is doing is, quite literally, starting up the robot, +so there's really no reason to edit this file for now. + + + +### `Robot.java` +But what is that one line in `Main.java` doing? +```java +RobotBase.startRobot(first.robot.Robot.class); +``` +It seems to be "starting" an instance of the `first.robot.Robot` class, and if we go to that class file, we end up at `Robot.java`. +This is the core of your robot code, where: +- your subsystems are defined +- your controls are binded +- your opmodes are modified and used +- your debugging data is logged (aka telemetry). + + + +We'll go through this file, as well as all of the above functionalities, more in detail later. + +### `opmode/` + +For those who are used to WPILib 2026 and earlier versions, this will probably be the most significant change. +In WPILib 2027 and later versions, robot frameworks are getting a new way to control the current "mode" of the robot: OpModes. +We'll talk about this a bit more in-depth later, but they essentially allow you to define various "states" for a robot during +autonomous and teleop, which can then be set directly through the FIRST Driver Station. This would be useful, for example, +when picking what autonomous routine to run without having to push a different version of the code for every single match. +WPILib 2027 decouples many of the functions that used to be in `Robot.java` and moves them to separate files for autonomous +and teleop periods, making it easier to differentiate what functionalities the robot has during each stage of the match. + +### `simulation/` +These are the files that control simulation of the robot, allowing you to test code without actually having a physical robot in front of you. +We've set this up for you already; you'll just have to set up the simulation software yourself, which we'll cover at the end of Stage 1A. + +### The 2026 Kitbot + +But what is all this code actually going to control? Well, the answer is the 2026 FIRST Robotics Competition kitbot, the best starting point +for new FRC teams, as well as the simplest robot to get fully working. You can watch the below video to learn more about what functionalities the kitbot has. +If you're a bit confused after watching that video, don't worry. We'll explain the kitbot more in depth in the next section. + + +And that's all you need to know to get started! The rest of Stage 1A will cover how to get from the template code to a working kitbot. This stage will cover the following topics: diff --git a/src/content/docs/learning-course/stage-1/stage-overview.mdx b/src/content/docs/learning-course/stage-1/stage-overview.mdx new file mode 100644 index 0000000..118472b --- /dev/null +++ b/src/content/docs/learning-course/stage-1/stage-overview.mdx @@ -0,0 +1,24 @@ +--- +title: Stage 1 Overview +description: An overview of Stage 1 +prev: false +next: stage-1a/stage-overview +--- + +Congratulations! Whether you already know Java, have programmed an FRC robot before, +or are a complete beginner, you should have a good grasp of the basic syntax of the Java language by now. +In Stage 1, we'll be moving on to the exciting part: actually writing code for a robot! +It might seem daunting at first, but the best way to think through it is to focus on understanding +how each individual component of the code works, instead of trying to tackle it all at once. + +This stage covers how to fully program a working kitbot for the 2026 FIRST Robotics Competition game, +REBUILT. +You'll start at stage 1A, which covers a simple way to code the kitbot. +Then, you'll move on to stage 1B, which uses a slightly more complex paradigm known as commands. +In addition, you'll also get to debug your robot in a simulation, to check if your code works! +Feel free to play around with the robot and control it in sim once you've finished! + +This stage is composed of the following sub-stages: + +- Stage 1A +- WIP From 2641422b103c03ac56302fb01b7fe9566d14aee3 Mon Sep 17 00:00:00 2001 From: Renie Joshi Date: Wed, 22 Jul 2026 10:38:58 -0700 Subject: [PATCH 4/8] Fix linting errors --- examples/stage1/snippets/Main.java | 5 +++++ .../docs/learning-course/stage-1/stage-1a/stage-overview.mdx | 2 ++ 2 files changed, 7 insertions(+) diff --git a/examples/stage1/snippets/Main.java b/examples/stage1/snippets/Main.java index 6155073..c5bb66f 100644 --- a/examples/stage1/snippets/Main.java +++ b/examples/stage1/snippets/Main.java @@ -1,3 +1,8 @@ +/* + * Copyright 2026 FRCSoftware + * + * SPDX-License-Identifier: BSD-3-Clause + */ // [main] import org.wpilib.framework.RobotBase; diff --git a/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx b/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx index 71cdc94..1ae7f64 100644 --- a/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx +++ b/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx @@ -14,6 +14,7 @@ If your robot has REV electronics, then the template folder's name will be `rev/ ### Stage 1A Template Structure +{/* rli:ignore */} ```text ctre/ ├── src/main/ @@ -55,6 +56,7 @@ so there's really no reason to edit this file for now. ### `Robot.java` But what is that one line in `Main.java` doing? +{/* rli:ignore */} ```java RobotBase.startRobot(first.robot.Robot.class); ``` From 6e31f1539dd7c91d8c5b09703c5a80806a48432a Mon Sep 17 00:00:00 2001 From: Renie Joshi Date: Wed, 22 Jul 2026 11:56:57 -0700 Subject: [PATCH 5/8] Fix linting and formating errors --- src/config/sidebarConfig.ts | 1 - .../stage-1/stage-1a/stage-overview.mdx | 43 +++++++++++++------ 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/config/sidebarConfig.ts b/src/config/sidebarConfig.ts index 842385f..c149c00 100644 --- a/src/config/sidebarConfig.ts +++ b/src/config/sidebarConfig.ts @@ -113,7 +113,6 @@ export const sidebarSections: Record = { // slug: 'stage-1a-commands/commands-and-mechanisms', // }, ], - items: [], }, { label: 'Stage 1B: Commands', diff --git a/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx b/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx index 1ae7f64..e919b5d 100644 --- a/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx +++ b/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx @@ -5,16 +5,19 @@ prev: ../stage-overview next: false --- -import YouTube from "../../../../../components/YouTube.astro"; +import YouTube from '../../../../../components/YouTube.astro'; Now, before we get into the depths of the robot code, it's useful to look at a high-level overview of the contents of a -typical WPILib project. As your code gets more advanced, you'll see more folders and files appear, but they're all controlled -by the same basic components. Below, you can see the sample file structure you'll be starting off with as a template for Stage 1A. +typical WPILib project. +As your code gets more advanced, you'll see more folders and files appear, but they're all controlled +by the same basic components. +Below, you can see the sample file structure you'll be starting off with as a template for Stage 1A. If your robot has REV electronics, then the template folder's name will be `rev/` instead of `ctre/` ### Stage 1A Template Structure {/* rli:ignore */} + ```text ctre/ ├── src/main/ @@ -30,46 +33,55 @@ ctre/ | | ├── Main.java ``` -You'll notice that we're skipping a lot of files here, because you don't have to edit those. What's great about about using a framework +You'll notice that we're skipping a lot of files here, because you don't have to edit those. +What's great about about using a framework like WPILib is that it automatically generates these files when you create a new project, so you can get started coding quicker. The other folders, like `src/main/deploy/` for example, will come in handy as your robot code becomes more advanced. Thus, the only files shown above are the ones directly responsible for controlling what our kitbot will do. ### `Main.java` + The first file to take note of is the `Main.java` file; this is the entrypoint for any Java project in real life. Its contents are pretty short and sweet (comments and package declaration removed for brevity): + ```java stage1/snippets/Main.java#main ``` + You can see that all the `Main.java` file is doing is, quite literally, starting up the robot, so there's really no reason to edit this file for now. ### `Robot.java` + But what is that one line in `Main.java` doing? {/* rli:ignore */} + ```java RobotBase.startRobot(first.robot.Robot.class); ``` + It seems to be "starting" an instance of the `first.robot.Robot` class, and if we go to that class file, we end up at `Robot.java`. This is the core of your robot code, where: + - your subsystems are defined - your controls are binded - your opmodes are modified and used - your debugging data is logged (aka telemetry). We'll go through this file, as well as all of the above functionalities, more in detail later. @@ -79,20 +91,25 @@ We'll go through this file, as well as all of the above functionalities, more in For those who are used to WPILib 2026 and earlier versions, this will probably be the most significant change. In WPILib 2027 and later versions, robot frameworks are getting a new way to control the current "mode" of the robot: OpModes. We'll talk about this a bit more in-depth later, but they essentially allow you to define various "states" for a robot during -autonomous and teleop, which can then be set directly through the FIRST Driver Station. This would be useful, for example, +autonomous and teleop, which can then be set directly through the FIRST Driver Station. +This would be useful, for example, when picking what autonomous routine to run without having to push a different version of the code for every single match. WPILib 2027 decouples many of the functions that used to be in `Robot.java` and moves them to separate files for autonomous and teleop periods, making it easier to differentiate what functionalities the robot has during each stage of the match. ### `simulation/` + These are the files that control simulation of the robot, allowing you to test code without actually having a physical robot in front of you. We've set this up for you already; you'll just have to set up the simulation software yourself, which we'll cover at the end of Stage 1A. ### The 2026 Kitbot But what is all this code actually going to control? Well, the answer is the 2026 FIRST Robotics Competition kitbot, the best starting point -for new FRC teams, as well as the simplest robot to get fully working. You can watch the below video to learn more about what functionalities the kitbot has. -If you're a bit confused after watching that video, don't worry. We'll explain the kitbot more in depth in the next section. +for new FRC teams, as well as the simplest robot to get fully working. +You can watch the below video to learn more about what functionalities the kitbot has. +If you're a bit confused after watching that video, don't worry. +We'll explain the kitbot more in depth in the next section. + And that's all you need to know to get started! The rest of Stage 1A will cover how to get from the template code to a working kitbot. From e1207d1b20934d7e20b398cc25a691517f482287 Mon Sep 17 00:00:00 2001 From: Renie Joshi Date: Wed, 22 Jul 2026 12:18:55 -0700 Subject: [PATCH 6/8] Fix spotless errors --- examples/build.gradle | 2 +- examples/stage1/snippets/Main.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/build.gradle b/examples/build.gradle index 183721d..f9e09db 100644 --- a/examples/build.gradle +++ b/examples/build.gradle @@ -16,7 +16,7 @@ spotless { java { target fileTree(rootDir) { include "**/*.java" - exclude "**/build/**", "**/.gradle/**", "stage0/snippets/**" + exclude "**/build/**", "**/.gradle/**", "stage0/snippets/**", "stage1/snippets/**" } licenseHeaderFile rootProject.file('gradle/LICENSE_HEADER') } diff --git a/examples/stage1/snippets/Main.java b/examples/stage1/snippets/Main.java index c5bb66f..d8d6f48 100644 --- a/examples/stage1/snippets/Main.java +++ b/examples/stage1/snippets/Main.java @@ -3,6 +3,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ + // [main] import org.wpilib.framework.RobotBase; @@ -13,4 +14,4 @@ public static void main(String... args) { RobotBase.startRobot(first.robot.Robot.class); } } -// [/main] \ No newline at end of file +// [/main] From f659d219eb9141499451b49a305110e2bfb95fbd Mon Sep 17 00:00:00 2001 From: Renie Joshi Date: Wed, 22 Jul 2026 18:32:27 -0700 Subject: [PATCH 7/8] Fix folder naming conventions --- src/config/sidebarConfig.ts | 4 ++-- .../learning-course/{stage-1 => stage1}/stage-overview.mdx | 0 .../{stage-1/stage-1a => stage1/stage1a}/stage-overview.mdx | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/content/docs/learning-course/{stage-1 => stage1}/stage-overview.mdx (100%) rename src/content/docs/learning-course/{stage-1/stage-1a => stage1/stage1a}/stage-overview.mdx (100%) diff --git a/src/config/sidebarConfig.ts b/src/config/sidebarConfig.ts index c149c00..9d96cce 100644 --- a/src/config/sidebarConfig.ts +++ b/src/config/sidebarConfig.ts @@ -94,7 +94,7 @@ export const sidebarSections: Record = { items: [ { label: 'Stage 1 Introduction', - slug: 'learning-course/stage-1/stage-overview', + slug: 'learning-course/stage1/stage-overview', }, { label: 'Stage 1A', @@ -102,7 +102,7 @@ export const sidebarSections: Record = { items: [ { label: 'Stage 1A Overview', - slug: 'learning-course/stage-1/stage-1a/stage-overview', + slug: 'learning-course/stage1/stage1a/stage-overview', }, // { // label: 'TBD', diff --git a/src/content/docs/learning-course/stage-1/stage-overview.mdx b/src/content/docs/learning-course/stage1/stage-overview.mdx similarity index 100% rename from src/content/docs/learning-course/stage-1/stage-overview.mdx rename to src/content/docs/learning-course/stage1/stage-overview.mdx diff --git a/src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx b/src/content/docs/learning-course/stage1/stage1a/stage-overview.mdx similarity index 100% rename from src/content/docs/learning-course/stage-1/stage-1a/stage-overview.mdx rename to src/content/docs/learning-course/stage1/stage1a/stage-overview.mdx From 505ca1c8666452a0f5355de89f29762b9f6d2ebc Mon Sep 17 00:00:00 2001 From: Renie Joshi Date: Wed, 22 Jul 2026 18:38:44 -0700 Subject: [PATCH 8/8] Update src/config/sidebarConfig.ts Co-authored-by: Zach Harel --- src/config/sidebarConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/sidebarConfig.ts b/src/config/sidebarConfig.ts index 9d96cce..299505d 100644 --- a/src/config/sidebarConfig.ts +++ b/src/config/sidebarConfig.ts @@ -101,7 +101,7 @@ export const sidebarSections: Record = { collapsed: true, items: [ { - label: 'Stage 1A Overview', + label: 'Stage 1A Introduction', slug: 'learning-course/stage1/stage1a/stage-overview', }, // {