Gray Matter
WorkshopProject Setup
WPILib 2027 is still in alpha: these pages change as the APIs settle.
LESSON 10

Project Setup

You generate a robot project with the WPILib New Project Creator, then swap it onto Commands v3 and add Phoenix 6. The build at the end proves Java, Gradle and the vendor libraries all work.

10 minutes
You’ll need
  • The WPILib 2027 alpha 6 installed, from Prerequisites.
  • An internet connection. The first build downloads a lot.
  • A local folder to work in, not one synced to the cloud.

The New Project Creator ships inside the WPILib copy of VS Code. It writes a working robot project in about four clicks, and you never create a file by hand.

What it writes is not quite what this course teaches, and the second half of this page is the one step that fixes it.

Make the project

The 2027 installer installs a WPILib-specific VS Code. Make sure to use this version, not the ordinary one. Once open, its title bar carries a small red WPILib icon at the top right. Click it.

Step 1 · The WPILib icon
Visual Studio Code welcome screen with the red WPILib icon circled in the top right of the title bar
No red icon here means you have the ordinary VS Code open. Close it and find the WPILib one.

The icon opens the command palette with >WPILib already in it. Type create and pick WPILib: Create a new project.

Step 2 · Create a new project
The VS Code command palette filtered to WPILib create, with WPILib: Create a new project highlighted
The palette also lists an import command for older projects. You want the create one.

The creator runs as four numbered pages. On the first, choose Template. An example is somebody else's finished robot, and you would spend the rest of Workshop 3 deleting it.

Step 3 · Template, not Example
WPILib New Project Creator step 1, with the Template card selected and Example beside it
Template gives you a skeleton. Example gives you a complete robot you did not write.

On the second page set Language to java and Project Base to OpMode Robot. OpModes are how the 2027 stack picks which routine runs.

Step 4 · Java and OpMode Robot
WPILib New Project Creator step 2, Language set to java and Project Base set to OpMode Robot
Timed Robot and Command v2 Robot sit in the same list. Neither matches what this course teaches.

The third page is the one worth slowing down for.

  1. Base Folder. Click Select Folder and pick Downloads, or any plain local path. Check that the box does not read OneDrive anywhere.
  2. Project Name. Type Workshop. Later lessons name that folder when they tell you where to look.
  3. Team Number. Yours. A deploy has no address to look for without it, and the screenshot below shows 5712.
  4. Enable Desktop Support. Tick it. This is the box that turns on simulation, and Workshop 3 runs the arm in simulation before it runs on a motor.
Step 5 · Location and config
WPILib New Project Creator step 3, with base folder Downloads, project name Workshop, team number 5712, and Enable Desktop Support circled and checked
Enable Desktop Support is circled. Miss it and simulation is not available in this project.
Watch out

Not in OneDrive

OneDrive, Google Drive and Dropbox rewrite files underneath Gradle while it is working. The build then fails in ways that look like broken code, and teams lose whole meetings to it. On a school laptop Documents and Desktop are often synced without anyone saying so. Downloads usually is not.

The fourth page repeats your choices back. Read the Location line, then press Create Project.

Step 6 · Review and create
WPILib New Project Creator step 4, reviewing project type Template, language java, project base OpMode Robot, location and team number
Five lines. If any of them is wrong, Back is cheaper than fixing it afterwards.

A dialog asks whether to open the folder. Choose Yes (Current Window). A new window works too, and leaves you with two VS Code windows and no way to tell them apart.

Step 7 · Yes (Current Window)
Dialog reading Project successfully created. Would you like to open the folder, with Yes (Current Window), Yes (New Window) and No
Pressing No leaves the project on disk unopened. File then Open Folder recovers it.

Commands v3 and Phoenix 6

The project you just made ships Commands v2 and no CTRE library. Every Java example in this course is Commands v3, and the hardware is CTRE. The two command libraries cannot sit in the same project, so v2 comes out before v3 goes in. One panel does all of it.

Click the WPILib icon in the activity bar, the narrow strip of icons down the left edge, to open WPILib Vendor Dependencies. Everything below is a button in that panel, and nothing needs a URL typed.

  1. Under Installed Dependencies, delete Commands V2 with the bin icon beside it.
  2. Under Available Dependencies, install Commands v3. It reads Loaded from Local Copy, because it came with the alpha and needs no download.
  3. In the same list, install CTRE-Phoenix (v6). Take care here. CTRE-Phoenix Replay (v6) sits directly under it and is a different library. Phoenix ignores the commands version, so its position in this order does not matter.
Step 8 · All three, one panel
The WPILib Vendor Dependencies panel, with the activity bar icon, the Commands V2 bin, and both Install buttons circled
Four circles: the panel icon, the bin, and the two Install buttons. Installed Dependencies should read 2 at the end.

Changing a dependency starts a build on its own. Leave it alone. The first one fetches Gradle, the Java 25 toolchain and the vendor libraries. That runs for several minutes at home, longer on school Wi-Fi. Later builds take seconds, because Gradle caches all of it in your home folder rather than in the project.

One thing goes wrong here, and it is the network. A build that stops on Could not resolve could not reach a library it needed. Reconnect first. Click the same WPILib icon you used to create the project, type build, and pick WPILib: Build Robot Code.

Check your work

Wait for the build to settle, then look at the file tree.

Check

You should see

  • BUILD SUCCESSFUL as the last line of the terminal.
  • A Workshop folder under Downloads, with gradlew at the top of it.
  • CommandsV3.json and a Phoenix 6 file under vendordeps/, and no CommandsV2.json.
  • Your team number in .wpilib/wpilib_preferences.json.
  • A Robot.java, and an opmode folder holding MyTeleop and MyAuto.

Check yourself

Which Project Base does this course use?

A fresh OpMode Robot project ships Commands v2. Why swap it?

Why not put the project in a OneDrive folder?

What does Enable Desktop Support turn on?

Pick an answer for each.