the video version
The same lesson as a narrated video. Watch it on YouTube
The WPILib command palette#
Everything FRC-specific in VS Code lives behind the red "W" icon in the top-right corner (or press Ctrl+Shift+P and type "WPILib"). This opens the WPILib command palette.
Creating a new project#
- Open the command palette → "Create a new project."
- Choose a project type: Template (bare base classes) or Example (working sample code). Importing an existing Gradle project is a separate command, not a choice here.
- Choose your language (Java/C++).
- Pick a base class — for beginners, start with TimedRobot or the Command Robot template. (The "TimedRobot Skeleton" variant strips out comments and the autonomous example, so WPILib recommends it once you're already familiar with TimedRobot, not as a first project.)
- Set a folder, project name, and your team number.
The extension generates a Gradle project: source under src/main/java/..., a build.gradle, and a vendordeps/ folder for vendor libraries.
Building robot code#
Use the command palette → "Build Robot Code" (or the shortcut menu in the top-right). Gradle compiles your code and reports errors. Building does not require a robot — you can build anywhere. Always build before a competition to catch compile errors early.
Deploying to the roboRIO#
With the roboRIO powered and connected (USB, Ethernet, or robot radio), use "Deploy Robot Code." This:
- Builds the code if needed.
- Copies the program to the roboRIO.
- Restarts the robot program so your new code runs.
The Deploy console (the RioLog) shows progress and runtime System.out / print output, which is your first-line debugging tool.
Critical warning: Never power off the robot while deploying. Interrupting a deploy can corrupt the roboRIO filesystem, forcing a re-image.
Vendor libraries (vendordeps)#
Motor-controller vendors ship their own libraries (CTRE Phoenix 6, REVLib, PathPlannerLib, ChoreoLib, etc.). Install them via the command palette → "Manage Vendor Libraries" → "Install new libraries (online)" and paste the vendor's JSON URL, or "offline" if the installer placed them locally. Each adds a file in vendordeps/. You'll do this in Module 3.
A typical first session#
- Create a Command Robot project with your team number.
- Build it (should succeed with no edits).
- Connect to the roboRIO and deploy.
- Open the Driver Station, enable Teleop, and confirm the program is running (the Driver Station shows "Communications," "Robot Code," and "Joysticks" indicators green).
If all three indicators are green, your toolchain is fully working and you're ready to write real code.
the part worth keeping
Key takeaways
- The red 'W' icon opens all WPILib commands in VS Code.
- Create projects from Template or Example; Command Robot is a great starting point.
- Build works anywhere; Deploy requires a connected roboRIO and restarts the robot program.
- Never power off during a deploy — it can corrupt the roboRIO.
- Vendor libraries are added through 'Manage Vendor Libraries' and land in vendordeps/.
Programming, Controls & SensorsFoundations: Tools, Languages, and Your First Robot Programlesson 4 of 4
Keep going
Take the quiz+10 XP with an accountMore in Foundations: Tools, Languages, and Your First Robot Program
where this came from
Sources and corrections
This lesson is AI-assisted: drafted from primary sources, then reviewed and edited by hand. Errors still get through. When one is reported we fix it and write down what changed, in public, in the corrections log.
sources and further reading
- docs.wpilib.orgVS Code Basics and the WPILib Extension
- docs.wpilib.orgBuilding and Deploying Robot Code
- docs.wpilib.org3rd Party (Vendor) Libraries
clipped to this lesson
Articles that go further on this
The lesson gets you through the topic. These go wider on it, and they read in one sitting.
- 13 min readFRC Code Structure Best Practices: Command-Based Project ArchitectureHow to structure an FRC command-based robot project the right way — subsystems, commands, RobotContainer, and Constants — verified against official WPILib docs./blogread it
- 20 min readInstalling WPILib and VS Code for FRC (Step by Step)Learn how to install WPILib and VS Code for FRC step by step: download the installer, create a robot project, add vendordeps, and deploy to the roboRIO./blogread it
- 13 min readWPILib Won't Deploy: Every Cause and How to Fix ItYour WPILib deploy is failing? Work the decision tree: wrong folder in VS Code, team number, roboRIO image, JDK version, macOS network privacy. Fixes for each./blogread it
answer sheet
Lesson quiz
All 3 right completes the lesson. Miss one and only that question comes back, anything you already answered correctly stays banked.
0 of 3 answered
01What is the standard way to run WPILib commands inside VS Code?
02Which command builds your project and sends the compiled program to the roboRIO?
03What happens if you power off the robot in the middle of a deploy?
Answer every question to submit.
All 51 lessons in Programming, Controls & Sensorsopenclose
01 / prerequisites
02 / foundations-tools-and-first-program
03 / robot-program-and-command-based
04 / motors-and-control
05 / autonomous-trajectories-simulation
06 / sensing-fundamentals
07 / encoders
08 / gyros-imus-orientation
09 / closed-loop-control
10 / vision-pose-estimation
11 / worked-examples-mini-projects
- Not read yet:Mini-Project: A Closed-Loop Elevator with Motion Magic
- Not read yet:Mini-Project: A Velocity-Controlled Shooter on REVLib
- Not read yet:Mini-Project: A Teleop Swerve Drive Subsystem
- Not read yet:Mini-Project: An Autonomous Routine with PathPlanner
- Not read yet:Mini-Project: Vision-Aligned Scoring with Limelight
12 / common-mistakes-troubleshooting
13 / advanced-techniques-case-studies
- Not read yet:State-Space Control and Kalman Filtering
- Not read yet:Log Replay Architecture with AdvantageKit
- Not read yet:Advanced Pose Estimation: Multi-Tag Fusion and Standard Deviations
- Not read yet:Robot Coordination, Alerts, and Operator Feedback
- Not read yet:Case Study: Hardening Software Before an Event