Skip to content

VS Code, the WPILib Extension, and Deploying Code

learnfrc.com
learnfrc.comAuthor
Veer Bajaj
Veer BajajMaintainer

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.

  1. Open the command palette → “Create a new project.”
  2. 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.
  3. Choose your language (Java/C++).
  4. 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.)
  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.

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.

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.

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.

  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.

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