Skip to content
Programming, Controls & Sensors·Lesson 8 of 51

VS Code, the WPILib Extension, and Deploying Code

Create a project from a template, then build and deploy it to the roboRIO using the WPILib extension.

Sign in to track progress, earn XP, and save lessons.

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

  1. Open the command palette → "Create a new project."
  2. Choose a project type: Template (bare base classes), Example (working sample code), or Gradle import.
  3. Pick a base class — for beginners, start with Timed Skeleton or the Command Robot template.
  4. Choose your language (Java/C++).
  5. 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:

  1. Builds the code if needed.
  2. Copies the program to the roboRIO.
  3. 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

  1. Create a Command Robot project with your team number.
  2. Build it (should succeed with no edits).
  3. Connect to the roboRIO and deploy.
  4. 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

  • 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/.

Lesson quiz

Required

Answer all 3 questions correctly to complete this lesson.

1.What is the standard way to run WPILib commands inside VS Code?

2.Which command builds your project and sends the compiled program to the roboRIO?

3.Which build system does the WPILib extension invoke when you build or deploy robot code?

Answer every question to submit.