VS Code, the WPILib Extension, and Deploying Code
The WPILib command palette
Section titled “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
Section titled “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
Section titled “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
Section titled “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)
Section titled “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
Section titled “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.
Key takeaways
Section titled “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/.
This lesson was adapted from learnfrc.com.
