-
Notifications
You must be signed in to change notification settings - Fork 14
Add overview pages for stage 1 curriculum #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4444227
feat: add stage 1 intro
CodeMyGame1 8ef7e93
linting fixes
CodeMyGame1 ccd0cc3
feat: add stage 1a intro
CodeMyGame1 2641422
Fix linting errors
reniejoshi edd045c
Merge branch 'main' into stage1a-curriculum
reniejoshi 6e31f15
Fix linting and formating errors
reniejoshi e1207d1
Fix spotless errors
reniejoshi 813d4f3
Merge branch 'main' into stage1a-curriculum
reniejoshi f659d21
Fix folder naming conventions
reniejoshi 505ca1c
Update src/config/sidebarConfig.ts
reniejoshi 6830fb1
Add stage 1B overview
reniejoshi 5b731da
Merge branch 'main' of https://github.com/frcsoftware/frcsoftware.org…
reniejoshi 5a2c924
Fix formatting errors
reniejoshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /* | ||
| * Copyright 2026 FRCSoftware | ||
| * | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| */ | ||
|
|
||
| // [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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/content/docs/learning-course/stage1/stage-overview.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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: | ||
|
|
||
| - <a href="../stage-1a/stage-overview">Stage 1A</a> | ||
| - <a href="#">WIP</a> |
119 changes: 119 additions & 0 deletions
119
src/content/docs/learning-course/stage1/stage1a/stage-overview.mdx
|
reniejoshi marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| --- | ||
| title: Stage 1A Overview | ||
| description: An overview of Stage 1A | ||
| prev: ../stage-overview | ||
| next: false | ||
| --- | ||
|
|
||
| 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 | ||
|
|
||
| {/* rli:ignore */} | ||
|
|
||
| ```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. | ||
|
|
||
| <Aside type="note"> | ||
| For those who have programmed in FRC before, WPILib is currently undergoing | ||
| a massive rewrite for the 2027 version, especially with regards to OpModes | ||
| and Commands V3, so some files and components may be completely new! | ||
| </Aside> | ||
|
|
||
| ### `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. | ||
|
|
||
| <Aside type="note"> | ||
| Notice that the names of all Java files in the project are capitalized. This | ||
| is a convention you should follow throughout your code. | ||
| </Aside> | ||
|
|
||
| ### `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). | ||
|
|
||
| <Aside type="note"> | ||
| For prior FRC programmers, you might have noticed a `RobotContainer.java` | ||
| file is missing. This file is being removed in WPILib 2027. | ||
| </Aside> | ||
|
|
||
| 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. | ||
|
|
||
| <YouTube url="https://www.youtube.com/watch?v=nTmZXOgHntM" /> | ||
|
|
||
| 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: | ||
|
|
||
| - <a href="#">WIP</a> |
29 changes: 29 additions & 0 deletions
29
src/content/docs/learning-course/stage1/stage1b/stage-overview.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| title: Stage 1B Overview | ||
| description: An overview of Stage 1B | ||
| --- | ||
|
|
||
| Stage 1A used a simple sequential approach to controlling the kitbot. | ||
| But real robots need to respond to many inputs at once, like button presses, sensor data, and vision. | ||
| Command-based programming solves this by modeling robot behavior as commands (actions) triggered by triggers (events). | ||
|
|
||
| ## Key Concepts | ||
|
|
||
| Commands define individual robot actions (deploy the intake, index a game piece, drive based on joystick inputs). | ||
| Triggers define when commands should run (controller input, sensor data reaches a certain threshold, the start of autonomous or teleop). | ||
| Mechanisms represent the physical robot mechanisms that commands require and control (intake, indexer, drivetrain). | ||
|
|
||
| ## Stage 1B Goals | ||
|
|
||
| By the end of Stage 1B, you'll rewrite your Stage 1A kitbot code into a command-based architecture, adding controller bindings, default commands, and simple autonomous routines. | ||
|
|
||
| This stage will cover the following topics: | ||
|
|
||
| - [The Concepts of Command-Based Programming](https://frcsoftware.org/learning-course/stage1/stage1b/command-based-overview/) | ||
| - [The Body of a Command](https://frcsoftware.org/learning-course/stage1/stage1b/the-command-body/) | ||
| - [Commands & Mechanisms, Part 1](https://frcsoftware.org/learning-course/stage1/stage1b/commands-and-mechanisms/) | ||
| - [Triggers and Scheduling](https://frcsoftware.org/learning-course/stage1/stage1b/triggers/) | ||
| - [Commands and Mechanisms, Part 2](https://frcsoftware.org/learning-course/stage1/stage1b/commands-and-mechanisms-pt2/) | ||
| - [Exercise: Kitbot Rewrite, Pt 1](https://frcsoftware.org/learning-course/stage1/stage1b/command-based-kitbot/) | ||
| - [Suppliers in Command-Based](https://frcsoftware.org/learning-course/stage1/stage1b/suppliers-in-command-based/) | ||
| - [Exercise: Kitbot Rewrite, Pt 2](https://frcsoftware.org/learning-course/stage1/stage1b/command-based-kitbot-pt2/) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.